How to force script to load tiff files as raster?

hennie
hennie Global Mapper UserTrusted User
How do I force GM to load *.tif files as raster and not elevation in a script. My problem originates when GM cannot, from the file header, decide what format to use. When doing the loading manually, I get a choice. How do I pick my choice through a script?

Answers

  • bmg_bob
    bmg_bob Global Mapper Programmer
    What version of Global Mapper are you using?  
    Can you post a sample file here (zip file)?
  • hennie
    hennie Global Mapper User Trusted User
    Hi Bob,
    I am using GM v17.1.0(b020116). An example is attached.
  • bmg_bob
    bmg_bob Global Mapper Programmer
    Answer ✓
    LOAD_FLAGS - contains flags for any import options that you were prompted for when loading the file, such as if you have a .tif file that you were prompted to select as elevation or raster. Also things like the coverages and tile sets for VPF layers. To see how to set these if you are writing a script, load a file with the settings that you want in the main user interface and then save a workspace, then examine the IMPORT command in the .gmw file for that file and see how the LOAD_FLAGS were set.

    After loading your file, I got LOAD_FLAGS="0~0~0~1~0~0".
  • hennie
    hennie Global Mapper User Trusted User
    Thanks Bob!
    Good suggestion to use the workspace file as for how to do stuff!
  • hennie
    hennie Global Mapper User Trusted User
    Another question please Bob:
    How to I make the gray surrounds of the Example.zip image I sent you transparent (not even in a script, but just the loaded raster image).
    I tried all the options of defining the transparent color, but to no avail.
    Please try and let me know.
    Thanks.
  • bmg_bob
    bmg_bob Global Mapper Programmer
    Answer ✓
    hennie said:
    Another question please Bob:
    How to I make the gray surrounds of the Example.zip image I sent you transparent (not even in a script, but just the loaded raster image).
    I tried all the options of defining the transparent color, but to no avail.
    Please try and let me know.
    Thanks.
    The easiest way is to crop out the data you don't want.  Draw an area feature that bounds the area you want to keep and select that area using the Digitizer.  Then open the Overlay Control Center, select your layer, and choose the Options... button.  The Raster Options window will be displayed.  On the Cropping tab, chose crop to currently selected Polygon(s) and click OK.  Once you save the workspace, that crop will automatically be applied when the workspace is loaded.
  • hennie
    hennie Global Mapper User Trusted User
    Yes, thanks Bob. I have been down that alley already. Just thought that there might be a simpler solution, because most of the tiffs that I am working with, have got different sizes, so a standard sized clipping box doesn't work. Thanks anyway - I will now move on to explore the exciting new stuff in GM 17.1.
  • hennie
    hennie Global Mapper User Trusted User
    Yes, thanks Bob. I have been down that alley already. Just thought that there might be a simpler solution, because most of the tiffs that I am working with, have got different sizes, so a standard sized clipping box doesn't work. Thanks anyway - I will now move on to explore the exciting new stuff in GM 17.1.