How to force script to load tiff files as raster?
hennie
Global Mapper UserTrusted User
in User Scripts
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
-
What version of Global Mapper are you using?
Can you post a sample file here (zip file)? -
Hi Bob,
I am using GM v17.1.0(b020116). An example is attached. -
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". -
Thanks Bob!
Good suggestion to use the workspace file as for how to do stuff! -
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 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. -
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.
-
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.
Categories
- 12.9K All Categories
- 5.8K Features Discussion
- 349 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 651 GM Script Language
- 55 User Scripts
- 115 GPS Features
- 420 Projection Questions
- 835 Raster Data
- 1.4K Vector Data
- 6.7K Support
- 181 Announcement and News
- 937 Bug Report
- 561 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 578 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 244 How I use Global Mapper
- 109 Global Mapper Forum Website

