Test if Minimum valid Elevation is below 0
veddycent
Global Mapper User
Hi all,
I'm struggling with the scripting side of Global Mapper. I've gone through the sample scripts but they are very limited and the documentation doesn't offer many samples.
Here is what I'm trying to do:
1 - Loop through all layers open in Global Mapper
2 - Check if Minimum Valid Elevation in Options - Alter Elevation Values is > 0
3 - If it is make it 0, if its NOT them move to next layer
Here is what I have so far:
I'm struggling with the scripting side of Global Mapper. I've gone through the sample scripts but they are very limited and the documentation doesn't offer many samples.
Here is what I'm trying to do:
1 - Loop through all layers open in Global Mapper
2 - Check if Minimum Valid Elevation in Options - Alter Elevation Values is > 0
3 - If it is make it 0, if its NOT them move to next layer
Here is what I have so far:
LAYER_LOOP_START FILENAME="*"
DEFINE_VAR NAME="VARMinElev" VALUE=SET_LAYER_OPTIONS MIN_ELEV
IF COMPARE_STR="VARMinElev>0" COMPARE_NUM="YES"
SET_LAYER_OPTIONS MIN_ELEV = "0"
END_IF
LAYER_LOOP_END
Any help would be much appreciated
Any help would be much appreciated
Tagged:
Answers
-
I figured it out.
Here is the script in case its of any use to anyone:GLOBAL_MAPPER_SCRIPT VERSION="1.00"//LOOPS THROUGH ALL LOADED LAYERS AND SETS SEA LEVEL 0 IF ITS LESS THAN 0// Loop over the loaded layersLAYER_LOOP_START FILENAME="*"//Gets the Minimum Elevation from Metadata for the layerQUERY_LAYER_METADATA METADATA_LAYER="%LAYER_DESC%" METADATA_ATTR="MIN ELEVATION" RESULT_VAR="VARMinElev"//Display the Minimum ElevationLOG_MESSAGE Minimum Elevation %VARMinElev%//If the Minimum Elevation is LESS THAN 0IF COMPARE_STR="%VARMinElev%<0"//Set Minimum Elevation to 0SET_LAYER_OPTIONS FILENAME="%LAYER_DESC%" MIN_ELEV=0//Clamp to 0SET_LAYER_OPTIONS FILENAME="%LAYER_DESC%" CLAMP_ELEVS=1//Fill all the empty space with 0 elevation (Sea Level)SET_LAYER_OPTIONS FILENAME="%LAYER_DESC%" VOID_ELEV=0END_IFLAYER_LOOP_END
Categories
- 13K All Categories
- 5.8K Features Discussion
- 350 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 652 GM Script Language
- 56 User Scripts
- 115 GPS Features
- 421 Projection Questions
- 835 Raster Data
- 1.4K Vector Data
- 6.7K Support
- 181 Announcement and News
- 939 Bug Report
- 562 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 579 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 244 How I use Global Mapper
- 110 Global Mapper Forum Website
