GlobalMapper ScriptingReference
GlobalMapper ScriptingReference
0
 Global Mapper Scripting Reference Section 1: General Overview
 Syntax
General Overview
Global Mapper script files allow the user to create custom batch processes that make use of the
functionality built in to Global Mapper. From a script, one can import data in any of the numer-
ous formats supported by the software, reproject that data if desired or perform analysis on it,
and export it to a new file. Scripts can be run from within the application interface using the
File> Run Script... option. They can also be automatically run in the background by double click-
ing the *.gms file or called from the command line on a machine with Global Mapper installed.
Syntax
Global Mapper script files consist of a series of command lines. Each command line begins with
a COMMAND. A series of parameter/value pairs should follow the command. These pairs
should be written as parameter=value. No spaces should exist before or after the equal sign.
Individual parameter/value pairs should be separated by spaces. If a pair requires spaces
internal to the value, quotes may be used around the entire value. For example, for a filename
with spaces, the pair could look like FILENAME="c:\\my documents\\test.tif". The string des-
ignation can be nested by combining single and double quote marks (" and '). For example
when specifying a variable inside a formula, like the formula in "Normalize a Loaded Terrain
Layer" on page 238 sample script.
Parameters and values are case-independent, but by convention, and in this guide, they are
written in all uppercase. Commands are uppercase.
Command lines typically consist of one line each. To extend a command to another line, use the
backslash character (\) at the end of the line. There are a few exceptions to this, including the
DEFINE_PROJ and DEFINE_SHAPE commands and the looping functionality provided by the
DIR_LOOP_START and DIR_LOOP_END commands.
Boolean Values
Many parameters in the scripting language are boolean, meaning that they have two states
only of either on or off.
The values listed through-out this guide are YES to enable the option and NO to disable it, but
there are a number of accepted values to specify the state:
 l YES can be represented by "YES", "Y", "TRUE", "T" , "1" , or no value (see below).
 l NO can be represented by "NO", "N", "FALSE", "F", or "0".
Parameters that expect a value of YES or NO to enable or disable functionality can (starting with
v13.1) be enabled with just the parameter name. So rather than saying FLAG_PARAM_NAME-
E=YES, you can just say FLAG_PARAM_NAME to get the same behavior as specifying yes.
 -2-
 Global Mapper Scripting Reference Section 1: General Overview
 Wildcards and variables
Parameters can also except variables as values or parts of values. Variables are delimited by
 %VARIABLE%. Some variables are built-in but they can also be defined within the script. Cus-
tom variables must be defined before they are used in a command (the script is run from top to
bottom sequentially). Typically variables are defined at the top of the script for ease of use. If a
variable is defined with the same name as a previously defined variable, it is replaced with the
new value for the rest of the script.
See DEFINE_VAR for more information.
 %DIR% 24
 %FNAME_W_DIR% 24
 %FNAME% 24
 %FNAME_WO_EXT% 24
 %PARENT_DIR% 24
 %PARENT_DIRN% 24
 %RECURSE_FOLDER% 24
 %LAYER_DIR% 27
 %LAYER_FNAME_W_DIR% 27
 %LAYER_FNAME% 27
 %LAYER_FNAME_WO_EXT% 27
 %LAYER_PARENT_DIR% 27
 %LAYER_DESC% 27
 %TIMESTAMP% 31
 %TIMESTAMP_MS% 31
 %DATE% 31
 %TIME% 31
 %TIME_SINCE_START% 31
 %TIME_SINCE_LAST_LOG% 31
 %SCRIPT_FILENAME% 31
 %SCRIPT_FOLDER% 31
 %GM_MAJOR_VER% 32
 %GM_FULL_VER_W_DATE% 32
 %GM_FULL_VER_NO_DATE% 32
 %SPLIT_ATTR% 215
 -3-
 Global Mapper Scripting Reference Section 1: General Overview
 Comments
 %left% 233
 %right% 233
 %top% 233
 %bottom% 233
 %TILE_DIR% 234
 %TILE_FNAME_W_DIR% 234
 %TILE_FNAME% 234
 %TILE_FNAME_WO_EXT% 234
Comments
Any lines that begin with the forward slash character (/) are considered comments and are
ignored by the script processing engine. This means that you can use C or C++ style comments
like // or /* at the start of your line.
 Note: For user-created syntax highlight for common text editors and shared example
 scripts from users see the Global Mapper User Forum
 -4-
 Global Mapper Scripting Reference Section 1: General Overview
 Comments
Contents
General Overview 2
 Syntax 2
 Boolean Values 2
 Wildcards and variables 3
 Predefined and Built-in Variables 3
 Comments 4
 Scripting Command Quick Reference 13
 Special Parameter Types 15
Common Scripting Tasks 16
 GLOBAL_MAPPER_SCRIPT 16
 SAVE_WORKSPACE 17
 EMBED_SCRIPT 17
 RUN_COMMAND 18
 SAMPLES 18
 PLAY_SOUND 19
 FORCE_EXIT 19
 LOG_MESSAGE 19
 SET_LOG_FILE 20
 EXAMPLE 20
 Conditional Execution in Global Mapper Scripts 20
 Logical Condition Commands 21
 IF 21
 ELSE_IF 22
 ELSE 22
 END_IF 22
 Operation conditional on layer presence 22
 IF EXISTS() 22
 HALT 22
Looping Operations 24
 DIR_LOOP_START 24
 Built-in Variables 24
 DIR_LOOP_END 25
 VAR_LOOP_START 25
 VAR_LOOP_END 26
 SAMPLE 26
 LAYER_LOOP_START 27
 Built-in Variables 27
 LAYER_LOOP_END 27
 SAMPLE 28
Define data 29
 DEFINE_SHAPE 29
 -5-
 Global Mapper Scripting Reference Section 1: General Overview
 Comments
 SAMPLE 29
 DEFINE_TEXT_FILE 30
 SAMPLE 30
 DEFINE_VAR 31
 Built-in Variables 31
 SAMPLE 34
 DEFINE_VAR_TABLE 35
 END_VAR_TABLE 36
 SAMPLES 36
Display 37
 DEFINE_PROJ 37
 SAMPLES 38
 LOAD_PROJECTION 38
 Projection Specification Values 39
 SAMPLES 40
 PRJ Filename 40
 Defined projection name 40
 EPSG Code 40
 WKT PRJ String 40
 Zoned Projection name - this will select the appropriate UTM zone for the data. 40
 SAVE_PROJECTION 41
 DEFINE_SHADER 41
 SAMPLE 41
 DEFINE_LAYER_STYLE 42
 SAMPLE 42
 LOAD_STYLE_FILE 43
 SET_OPT 43
 Specifying a Type/Lidar Filter/ shared Lidar Draw Mode 45
 SAMPLE 47
 LOAD_TYPE_FILTER 47
 SET_VERT_DISP_OPTS 47
 SET_VIEW 49
 SAVE_CURRENT_VIEW 50
 RESTORE_LAST_SAVED_VIEW 50
 SET_BG_COLOR 50
 SHOW_3D_VIEW 50
 VIEW_LAYOUT(Deprecated) 51
 MAP_LAYOUT 51
 END_MAP_LAYOUT 51
Import/ Open Data 52
 IMPORT 52
 TYPE 52
 Shared Import Parameters 56
 Elevation Parameters 59
 -6-
 Global Mapper Scripting Reference Section 1: General Overview
 Comments
 Raster Parameters 60
 Vector Parameters 65
 Vector Label Parameters 66
 Lidar Display Parameters 67
 Layer Rectification/ Control Points 68
 SAMPLES 70
 IMPORT_ARCHIVE 70
 IMPORT_ASCII 71
 Distance-Bearing Type Parameters 74
 SAMPLE 75
 IMPORT_CLOUD 75
 EXAMPLE 75
 IMPORT_DIR_TREE 75
 SAMPLE 75
 DEFINE_SDB_CONNECTION 76
 SAMPLE 76
 IMPORT_SPATIAL_DB 77
 SAMPLES 78
 IMPORT_OSM_TILE 78
 Specify Tiling Type 79
 Specify Bounds for Layer 79
 SAMPLE 80
 IMPORT_WMS 80
 SAMPLE 81
 IMPORT_REST_FEATURES 81
 SAMPLE 82
Layer Management 83
 COPY_LAYER_FILES 83
 SAMPLE 83
 GENERATE_LAYER_BOUNDS 84
 SET_LAYER_OPTIONS 84
 Shared Import Parameters 85
 Elevation Parameters 87
 Raster Parameters 89
 Vector Parameters 94
 Vector Label Parameters 94
 Lidar Display Parameters 95
 Layer Rectification/ Control Points 97
 SHIFT_LAYER 98
 Layer Rectification/ Control Points 99
 QUERY_LAYER_METADATA 100
 SAMPLE 101
 UNLOAD_ALL 101
 -7-
 Global Mapper Scripting Reference Section 1: General Overview
 Comments
 UNLOAD_LAYER 101
 SPLIT_LAYER 102
 SORT_LAYERS 102
 EDIT_MAP_CATALOG 103
 SAMPLES 104
Terrain and 3D Analysis 106
 CALC_VOLUMES 106
 SAMPLE 107
 CALC_VOLUME_BETWEEN_SURFACES 107
 Specify Bounds for Operation 107
 SAMPLE 108
 COMBINE_TERRAIN 108
 GENERATE_BREAKLINES 110
 GENERATE_CONTOURS 111
 Shared IMPORT SAMPLING_METHOD values 113
 GENERATE_WATERSHED and GENERATE_RIDGE_LINES 114
 Shared IMPORT SAMPLING_METHOD values 116
 GENERATE_WATER_RISE 117
 Shared Parameters 117
 Shared IMPORT SAMPLING_METHOD values 118
 SAMPLES 118
 GENERATE_VIEWSHED 119
 GENERATE_PATH_PROFILE 122
 GENERATE_ELEV_GRID 123
 Lidar Point Filter Parameters 126
 GENERATE_POINTS_FROM_ELEV_GRID 126
 Example: 126
Lidar Analysis 127
 EDIT_LIDAR 127
 Specify Bounding Box for Operation 128
 SAMPLE 128
 DEFINE_LIDAR_FILTER 128
 SAMPLE 130
 LIDAR_CLASSIFY 130
 Ground Point Classification Options 130
 Non-Ground (Building/Tree) Point Classification Options 131
 Powerline Point Classification Options 132
 Pole Point Classification 132
 Noise Point Classification Options 132
 Specify Bounding Box for Operation 133
 Lidar Advanced Filter Parameters 133
 LIDAR_CLASSIFY_GRAPH 134
 Specify Bounding Box for Operation 135
 -8-
 Global Mapper Scripting Reference Section 1: General Overview
 Comments
 -9-
 Global Mapper Scripting Reference Section 1: General Overview
 Comments
 TYPE 189
 Shared IMPORT SAMPLING_METHOD values 191
 BIL Grid Fields 191
 XYZ Grid Fields 192
 ERDAS Fields 193
 GeoTIFF Fields 194
 FLOAT_GRID Fields 195
 DTED Fields 195
 Lidar LAS/LAZ Fields 195
 Arc ASCII Grid Fields 197
 GWS Windsim Fields 197
 Other Format Specific Fields 198
 Tiling / Gridding Parameters 198
 SAMPLES 198
EXPORT_METADATA 199
EXPORT_PACKAGE 199
 Tiling/Gridding Export into Smaller Chunks 200
EXPORT_GEOPACKAGE 201
 Tiling/Gridding Export into Smaller Chunks 201
EXPORT_PDF 202
 Specify Bounding Box for Operation 203
 Tiling/Gridding Export into Smaller Chunks 203
EXPORT_PDF3D 203
EXPORT_RASTER 205
 TYPE 205
 Shared IMPORT SAMPLING_METHOD values 206
 PALETTE 206
 Projection Files 208
 GeoTIFF Fields 209
 KML/KMZ Fields 209
 BSB Fields 210
 RPF (CADRG/CIB) Fields 211
 ADRG/ASRP Fields 211
 Other Format Specific Parameters 212
 Tiling / Gridding 213
EXPORT_VECTOR 213
 TYPE 213
 Tiling/Gridding Export into Smaller Chunks 215
 Splitting Exports by Attribute Parameters 215
 Shapefile Parameters 216
 Simple ASCII/CSV/XYZI Parameters 217
 DXF/DWG Parameters 218
 Exporting Vector Files to a Spatial Database 219
 - 11 -
 Global Mapper Scripting Reference Section 1: General Overview
 Comments
 - 12 -
 Global Mapper Scripting Reference Section 1: General Overview
 Scripting Command Quick Reference
 - 13 -
 Global Mapper Scripting Reference Section 1: General Overview
 Scripting Command Quick Reference
 - 14 -
 Global Mapper Scripting Reference Section 1: General Overview
 Scripting Command Quick Reference
 - 15 -
 Global Mapper Scripting Reference Section 2: Common Scripting Tasks
 GLOBAL_MAPPER_SCRIPT
GLOBAL_MAPPER_SCRIPT
The GLOBAL_MAPPER_SCRIPT must be the first command in the file for scripts prior to v18. Typ-
ically, the entire command line will look like:
GLOBAL_MAPPER_SCRIPT VERSION=1.00
SAVE_WORKSPACE
The SAVE_WORKSPACE command saves any currently loaded layers to a workspace (GMW) file.
The following parameters are supported by the command.
 l FILENAME - full path to GMW file to save
EMBED_SCRIPT
The EMBED_SCRIPT command allows you to call another script from within a script or to load a
workspace file. This can be useful in many situations. For example, if you have a common set of
data files that you want to load for each script operation, you could simply create a script that
loaded those files, then embed that script within your other scripts.
The following parameters are supported by the command:
 l FILENAME - full path to script or workspace file to run
 l SKIP_UNLOAD_ALL - specifies whether or not the first UNLOAD_ALL or UNLOAD_LAYER
 command in the script file being run should be skipped. This is useful for embedding work-
 space files which typically unload everything to start with. Use SKIP_UNLOAD_ALL=YES to
 skip the first UNLOAD_ALL or UNLOAD_LAYER command.
 - 17 -
 Global Mapper Scripting Reference Section 2: Common Scripting Tasks
 RUN_COMMAND
RUN_COMMAND
The RUN_COMMAND command allows you to execute any program on Windows with a set of
parameters. The following parameters are supported by the command.
 This command may be disabled from within the application interface in the Con-
 figuration dialog in the General Advanced section for security. If it has been disabled,
 any scripts with RUN_COMMAND will not execute the command and will produce an
 error. It can not be re-enabled via scripting.
 l COMMAND_LINE - full command line to run. If you need to use quotation marks in your
 command line, instead use apostrophes (i.e. ' rather than ") and they will be converted to
 quotes prior to running the command. Note to run a DOS shell command like 'mkdir', you
 will need to run it via cmd.exe, like COMMAND_LINE="cmd /C mkdir 'C:\temp\export
 test\new folder'" (note use of apostrophes for quotes).
 l PRESERVE_APOSTROPHES - indicates whether or not apostrophes will be converted to
 double-quotes in the command string. Use PRESERVE_APOSTROPHES=YES to keep the
 apostrophes. The default is NO, so if you don't specify this parameter, the apostrophes in
 the command string will be converted to double-quote symbols.
 l WAIT_FOR_COMPLETE - specifies whether or not the script should wait for your com-
 mand line run to complete prior to continuing. The default is to wait for the command to
 complete (i.e. WAIT_FOR_COMPLETE=YES). If you just want the command line to run and
 then immediately let the script continue processing, use WAIT_FOR_COMPLETE=NO.
 l CAPTURE_RESULT - specifies the name of a variable where the result of the program will
 be stored. The variable does not have to be created via a DEFINE_VAR command before it
 is used here, although it is OK if it is. The result will only be stored if RUN_COMMAND
 waits for the program to complete (see WAIT_FOR_COMPLETE).
 l HIDE_WINDOW - specifies that any window launched by the command (like a command
 window) will initially be hidden. Add HIDE_WINDOW=YES to hide the window.
SAMPLES
Here is a sample that runs another instance of Global Mapper and loads a file:
RUN_COMMAND COMMAND_LINE="'c:\program files (x86)\GlobalMapper16\global_mapper.exe'
'c:\temp\export test\blue_springs.opt'" WAIT_FOR_COMPLETE=NO
Here is a sample that calls another .exe and stores the return code of the .exe to the variable
RESULT:
RUN_COMMAND COMMAND_LINE="'c:\temp\test1.exe'" CAPTURE_RESULT="RESULT"
 - 18 -
 Global Mapper Scripting Reference Section 2: Common Scripting Tasks
 PLAY_SOUND
PLAY_SOUND
The PLAY_SOUND command plays either the information sound for the system or a specified
sound file. This can be useful if you want audible confirmation when a script completes. The fol-
lowing parameters are supported by the command.
 l FILENAME - full path to sound file (like .wav) to play. If not specified the information
 beep will play.
FORCE_EXIT
The FORCE_EXIT command aborts the script and optionally immediately shuts down Global
Mapper without going through the normal shut-down process. This is useful if you are running
a Global Mapper script via a CreateProcess call and the Global Mapper process is not returning
when the script completes, or if you need a particular return code provided. The following para-
meters are supported by this command:
 l CLOSE_APP - specifies whether or not the Global Mapper application should be closed in
 addition to stopping the script. By default this is enabled, so add CLOSE_APP=NO to only
 abort the script and not the entire app.
 l RETURN_CODE - specifies the numeric return code to use. If not provided 0 is returned if
 the script did not encounter any errors or 1 if there were errors encountered.
LOG_MESSAGE
The LOG_MESSAGE command writes a string to the status window and any active log file. You
can use the SET_LOG_FILE command to set the log file to save message to. The USER_
FILENAME parameter of that command allows you to have LOG_MESSAGE text written to a dif-
ferent file than default script messages. You can include variables in the command string if you
want to log their values. Everything on the line after the LOG_MESSAGE will be written. For
example if you have a variable named WATER_LEVEL_FT, you could log its value and a
timestamp at the front as follows:
LOG_MESSAGE %TIMESTAMP%: The current value of WATER_LEVEL_FT is %WATER_LEVEL_FT%
If you would like to log messages to the command line (if running a script passed on the com-
mand line), make sure to include LOG_TO_COMMAND_PROMPT=YES in the GLOBAL_MAPPER_
SCRIPT header line at the start of the script.
Other built-in variables (see DEFINE_VAR) allow you to log the elapsed time (in seconds) for a
script. For example you can log the time for an import and export and total script time using the
following:
GLOBAL_MAPPER_SCRIPT VERSION=1.00
LOG_MESSAGE Script <%SCRIPT_FILENAME%> started at %DATE% %TIME%
 - 19 -
 Global Mapper Scripting Reference Section 2: Common Scripting Tasks
 SET_LOG_FILE
IMPORT FILENAME="test.tif"
LOG_MESSAGE Import took %TIME_SINCE_LAST_LOG%
EXPORT_RASTER TYPE=GEOTIFF FILENAME="output.tif"
LOG_MESSAGE Export took %TIME_SINCE_LAST_LOG%
LOG_MESSAGE Total Script Run Time: %TIME_SINCE_START%
SET_LOG_FILE
The SET_LOG_FILE command sets the name of the file to log status, warning, and error mes-
sages to. If the log file specified already exists, the messages will be appended to the end of it.
The following parameters are supported by the command.
 l FILENAME - full path to log file to write messages to
 l USER_FILENAME - full path to log file to write messages from the LOG_MESSAGE com-
 mand. Use this if you want your own messages to go to a different file than any auto-
 matically generated script messages. Pass in with an empty value to reset the LOG_
 MESSAGE messages to go back to the shared file.
 l APPEND_TO_FILE - This option controls whether to append log messages to an existing
 file or start a new log file.
 By default, log messages will be appended to an existing log file. Use APPEND_TO_FILE-
 E=NO to delete the existing log file and start a new one. The log file will be deleted when
 this command is processed, so it is a good idea to have the SET_LOG_FILE command at
 the beginning of a script.
EXAMPLE
SET_LOG_FILE FILENAME="C:\Temp\script_log.txt" APPEND_TO_FILE=NO
In this example, if the file C:\Temp\script_log.txt exists, it will be deleted and a new log file with
that name will be created.
When the script containing the sample is run, if the value of the variable %VAR1% is "val1", the
statements following the IF and before the END_IF will be executed. If the value of variable
%VAR1% is something other than "val1", then the statements following the IF will be skipped,
and script processing will continue with the first statement after the END_IF. If the user wants
to run a specific set of commands in the case where the condition specified on the IF is not
true, then he can use the ELSE command:
 - 20 -
 Global Mapper Scripting Reference Section 2: Common Scripting Tasks
 Conditional Execution in Global Mapper Scripts
IF COMPARE_STR="%VAR1%=val1"
// Script commands to be run when the IF condition is true.
ELSE
// Script commands to be run when the IF condition is false.
END_IF
Now, if the value of the variable %VAR1% is "val1", the statements following the IF and before
the ELSE will be executed, and the commands after the ELSE and before the END_IF will be
skipped. If the value of variable %VAR1% is something other than "val1", then the statements
following the IF and preceding the ELSE will be skipped, and the commands after the ELSE and
before the END_IF will be run.
If the user has several conditions that need to be tested, only one of which can be true, then
the ELSE_IF command can be used:
IF COMPARE_STR="%VAR1%=val1"
// Script commands to be run when the IF condition is true.
ELSE_IF COMPARE_STR="%VAR1%=val2"
// Script commands to be run when the ELSE_IF condition is true.
ELSE
// Script commands to be run when the all other conditions are false.
END_IF
The commands following the IF will be handled as described above, but now there is a second
condition being tested. When the value of variable %VAR1% is "val2", then the commands after
the ELSE_IF and before the ELSE will be run. In the case where there are multiple IF/ELSE_IF con-
ditions, the commands after the ELSE will be run when all of the other conditions are false.
IF
If the comparison condition is true, perform the subsequent commands. The if statement is a
code block that must be closed with an END_IF.
 l COMPARE_STR - The COMPARE_STR must consist of <value><operation><value>, where
 either value can be a constant or a variable name (enclosed in "%"). Both values must be
 specified. The operation is also required, and can be one of:
 l "=" - Equals
 - 21 -
 Global Mapper Scripting Reference Section 2: Common Scripting Tasks
 Conditional Execution in Global Mapper Scripts
ELSE_IF
Second comparison condition can be tested, and if it is true, the subsequent command will be
executed. The available parameters for are the same as IF, see above.
ELSE
All other cases that do not return true for the IF or ELSE_IF conditions will have the commands
following the else statement executed.
END_IF
IF commands can be nested, so the block of commands following an IF, ELSE_IF, or ELSE com-
mand can contain another IF command:
 IF COMPARE_STR="%VAR1%=val1"
 IF COMPARE_STR="%VAR2%>10"
 // Script commands to be run when the IF condition is true.
 END_IF
ELSE
 // Script commands to be run when the IF condition is false.
END_IF
HALT
The HALT command can be used to halt the script execution. The optional message can be a
single or double quote delimited string. It will be added to the script log. If not present, then
“Execution halted” is used.
Example:
 - 22 -
 Global Mapper Scripting Reference Section 2: Common Scripting Tasks
 Conditional Execution in Global Mapper Scripts
If the layer “somelayer.shp” exists in the current workspace, then we perform a ‘dissolve’ oper-
ation on it; otherwise, we halt the script, and add “Layer not found” to the script log.
 - 23 -
 Global Mapper Scripting Reference Section 3: Looping Operations
 DIR_LOOP_START
Looping Operations
 DIR_LOOP_START 24
 Built-in Variables 24
 DIR_LOOP_END 25
 VAR_LOOP_START 25
 VAR_LOOP_END 26
 SAMPLE 26
 LAYER_LOOP_START 27
 Built-in Variables 27
 LAYER_LOOP_END 27
 SAMPLE 28
DIR_LOOP_START
The DIR_LOOP_START command begins a loop of commands over all of the folders within a dir-
ectory (and optionally its subdirectories) that match one or more filename masks. This is a
powerful feature allowing you to do things like easily batch convert a collection of files or per-
form any other supported operation over a collection of files. You end a loop over the files in a
folder using the DIR_LOOP_END command. Note that it is also possible to nest loops.
Built-in Variables
For any commands found within a DIR_LOOP_START...DIR_LOOP_END pair defining a loop, the
following special character sequences can be used anywhere (examples of what the values will
be based on a current filename of 'C:\path\to\my\data\my_file.dem' are listed):
 l %DIR% - full path to current file (value is 'C:\path\to\my\data\')
 l %FNAME_W_DIR% - full path and filename of current file (value is
 'C:\path\to\my\data\my_file.dem')
 l %FNAME% - filename of current file (value is 'my_file.dem')
 l %FNAME_WO_EXT% - filename of current file without extension (value is 'my_file')
 l %PARENT_DIR% - name of parent directory of file (value is 'data')
 l %PARENT_DIRN% - name of some level of parent directory, where 'N' is level. For
 example, %PARENT_DIR1% value is 'my' and %PARENT_DIR2% is 'to'.
 l %RECURSE_FOLDER% - folder recursed into beyond original search folder. So if current
 filename was 'C:\path\to\my\data\sub\folder\my_file.dem' the value of this would be
 'sub\folder\'. Use this to rebuild a directory structure elsewhere when recursing.
For a sample of the DIR_LOOP_START command in use, see the example at the bottom of this
reference.
The following parameters are used by the DIR_LOOP_START command.
 - 24 -
 Global Mapper Scripting Reference Section 3: Looping Operations
 DIR_LOOP_END
 l DIRECTORY - specifies the directory to search for files in. If you leave this blank, the oper-
 ation will be based in the current folder.
 l FILENAME_MASKS - space-separated list of filename masks to match on. If no value is
 provided then all files will be used. If you provide ".." as the mask, you will enter the loop
 once for each folder that is matched, allowing you to perform one operation per folder
 on an enter directory tree. In addition to individual masks the following special values are
 also supported:
 l COMMON_ALL - a filter with all Commonly Supported Formats
DIR_LOOP_END
The DIR_LOOP_END command ends a loop of commands over all of the folders within a dir-
ectory. See the DIR_LOOP_START command for details.
VAR_LOOP_START
The VAR_LOOP_START command begins a loop of commands over a range of numeric values or
through a sequence of characters. This can be used as a simple counter or for more powerful
things like custom gridding using coordinate values and naming exported files using the coordin-
ates. Note that it is possible to nest loops and use different variable names for each loop to
build complex filenames.
For any commands found within a VAR_LOOP_START...VAR_LOOP_END pair defining a loop, the
current value of the loop variable will be available as a variable name. By default this will be
%COUNTER%, but you can use the VAR_NAME parameter (see below) to make it whatever
name that you want. By default some generic numeric formatting will be provided (i.e. whole
numbers won't have a decimal or any leading 0's), but you can also provide custom formatting
for the numeric value as a C-style format string like you would pass to a print command using
the VAL_FORMAT parameter (see below for details).
The following parameters are used by the VAR_LOOP_START command.
 - 25 -
 Global Mapper Scripting Reference Section 3: Looping Operations
 VAR_LOOP_END
 l VAR_NAME - specifies the name of the variable that will be used to store the current
 loop value. By default this will be %COUNTER%, but you can use anything you want. See
 the example below for usage.
 l VAL_START - specifies the value to start the loop out. This would be something like 1 for
 just a simple counter loop, but can be any number, or a single letter, like A.
 l VAL_STOP - specifies the value to stop the loop out. When the current loop value goes
 past this value the loop will stop, but it will run at this value. So to do a loop from 1 to 10,
 including 10, use VAL_START=1, VAL_STOP=10, and VAL_STEP=1. To loop through the let-
 ters A through J, use VAL_START=A, VAL_STOP=J, and VAL_STEP=1.
 l VAL_STEP - specifies the value to increment the loop variable by each time the com-
 mands are run through. If you don't provide this it will increment by 1 if the VAL_STOP is
 greater than VAL_START and -1 if they are reversed.
 l VAL_FORMAT - specifies a C-style print format string for formatting the numeric loop vari-
 able as a string. For example to format as a 3-digit number with 0's filling in for values
 less than 100, use VAL_FORMAT="%03d". If you provide a custom format, it should
 always include exactly one % and end with a 'd' (for integer values) or a 'f' (for floating
 point). If you don't provide a format string a good default numeric representation will be
 used.
 l VALUE_TABLE - specifies the name of a previously defined table of values from a DEFINE_
 VAR_TABLE command to loop over a list of values from. If the table contains multiple
 columns of data, use VALUE_COLUMN to specify the name of the column of data to use
 for this variable if you just want to loop over a single column.
 If you would like to access any column of the table from within the loop, use a variable
 name of the format %VAR_NAME:COLUMN_NAME% within the loop.
 For example, if you use VAR_NAME="settings" and your VALUE_TABLE has
 columns named "height" and "width", you can use %settings:height% to access the
 height column from the current row of the settings table.
 l VALUE_COLUMN - specifies the name of a the column from the VALUE_TABLE to loop
 over. Only required for tables with multiple columns of data.
VAR_LOOP_END
The VAR_LOOP_END command ends a loop of commands over a range of numeric values. See
the VAR_LOOP_START command for details.
SAMPLE
Here is a simple example for looping over some rows and columns:
GLOBAL_MAPPER_SCRIPT VERSION=1.00
// Loop over rows 1-10 with leading zeroes in the format
VAR_LOOP_START VAL_START=1 VAL_STOP=10 VAL_STEP=1 VAL_FORMAT="%02d" VAR_NAME="%ROW%"
 // Loop over colums 5-15 in this row, use default formatting
 VAR_LOOP_START VAL_START=5 VAL_STOP=15 VAL_STEP=1 VAR_NAME="%COL%"
 // Import a file with the row and column in the filename
 IMPORT FILENAME="c:\path_to_file\base_filename_%ROW%_%COL%.jpg"
 - 26 -
 Global Mapper Scripting Reference Section 3: Looping Operations
 LAYER_LOOP_START
 VAR_LOOP_END
VAR_LOOP_END
LAYER_LOOP_START
The LAYER_LOOP_START command begins a loop of commands over load layers. You can loop
over all layers or just those matching a particular filename mask. You end a loop over the files in
a folder using the LAYER_LOOP_END command. Note that it is also possible to nest loops.
Built-in Variables
For any commands found within a LAYER_LOOP_START...LAYER_LOOP_END pair defining a
loop, the following special character sequences (the LAYER part can be changed using the VAR_
NAME_PREFIX parameter) can be used anywhere (examples of what the values will be based on
a current layer filename of 'C:\data\my_file.dem' are listed):
 l %LAYER_DIR% - full path to current file (value is 'C:\data\')
 l %LAYER_FNAME_W_DIR% - full path and filename of current file (value is 'C:\data\my_
 file.dem')
 l %LAYER_FNAME% - filename of current file (value is 'my_file.dem')
 l %LAYER_FNAME_WO_EXT% - filename of current file without extension (value is 'my_
 file')
 l %LAYER_PARENT_DIR% - name of parent directory of file (value is 'data')
 l %LAYER_DESC% - description of current layer
LAYER_LOOP_END
The LAYER_LOOP_END command ends a loop of commands over loaded layers. See the LAYER_
LOOP_START command for details.
 - 27 -
 Global Mapper Scripting Reference Section 3: Looping Operations
 LAYER_LOOP_END
SAMPLE
GLOBAL_MAPPER_SCRIPT VERSION="1.00"
// Hide all layers
LAYER_LOOP_START FILENAME="*" VAR_NAME_PREFIX="HIDE"
 SET_LAYER_OPTIONS FILENAME="%HIDE_FNAME_W_DIR%" HIDDEN=YES
LAYER_LOOP_END
// Loop over the loaded layers, doing a separate export for each
LAYER_LOOP_START FILENAME="*"
 // Enable the current layer since we hid it above
 SET_LAYER_OPTIONS FILENAME="%LAYER_FNAME_W_DIR%" HIDDEN=NO
 // Export
 EXPORT_RASTER FILENAME="%LAYER_DIR%%LAYER_FNAME_WO_EXT%_loop.tif" TYPE=GEOTIFF
 - 28 -
 Global Mapper Scripting Reference Section 4: Define data
 DEFINE_SHAPE
Define data
 DEFINE_SHAPE 29
 SAMPLE 29
 DEFINE_TEXT_FILE 30
 SAMPLE 30
 DEFINE_VAR 31
 Built-in Variables 31
 SAMPLE 34
 DEFINE_VAR_TABLE 35
 END_VAR_TABLE 36
 SAMPLES 36
DEFINE_SHAPE
The DEFINE_SHAPE command allows a multi-point shape (like a polygon) to be associated with
a name. The shape name can then be used in later commands for things like cropping and feath-
ering to polygonal boundaries.
The DEFINE_SHAPE command consists of a single command line followed by a series of lines
describing the series of XY coordinate pairs that define the shape. Each line should have a single
coordinate value with the X and Y coordinates separated by a comma. If you need your shape
to contain multiple boundaries, insert BREAK_SHAPE on a line to stop the current sequence
and start a new one.
The DEFINE_SHAPE command is terminated with a single line containing only the text END_
DEFINE_SHAPE.
The following parameters are required by the DEFINE_SHAPE command.
 l SHAPE_NAME - specifies the name to associate with the shape
SAMPLE
Here is an example of a DEFINE_SHAPE command used to define a feather polygon with a name
of 'FEATHER_POLY'
DEFINE_SHAPE SHAPE_NAME="FEATHER_POLY"
377493.234,4323974.016
375343.359,4318676.109
381101.953,4314414.750
387014.109,4317178.875
386975.719,4322400.000
381869.766,4324588.266
377493.234,4323974.016
END_DEFINE_SHAPE
Here is an example of a DEFINE_SHAPE command used to define a feather polygon with 2 sep-
arate boundaries with a name of 'FEATHER_POLY'
 - 29 -
 Global Mapper Scripting Reference Section 4: Define data
 DEFINE_TEXT_FILE
DEFINE_SHAPE SHAPE_NAME="FEATHER_POLY"
377493.234,4323974.016
375343.359,4318676.109
381101.953,4314414.750
387014.109,4317178.875
377493.234,4323974.016
 BREAK_SHAPE
386975.719,4322400.000
381869.766,4324588.266
377493.234,4323974.016
386975.719,4322400.000
END_DEFINE_SHAPE
DEFINE_TEXT_FILE
The DEFINE_TEXT_FILE command allows an ASCII text file containing the definition of vector fea-
tures to be associated with a name. You can then use the associated name in the FILENAME
parameter of the IMPORT_ASCII command to load the file contents as if they were an external
file. This is a powerful command allowing you to embed the definition of vector features dir-
ectly within a script.
The associated name can also be used with the DIR_LOOP_START command where the defin-
ition includes a list of filepaths.
The DEFINE_TEXT_FILE command consists of a single command line followed by a series of lines
with the contents of the text "file". The DEFINE_TEXT_FILE command is terminated with a single
line containing only the text END_DEFINE_TEXT_FILE.
The following parameters are required by the DEFINE_TEXT_FILE command.
 l FILENAME - specifies the name to associate with this text file contents. Provide this value
 in the FILENAME parameter for the IMPORT_ASCII command.
SAMPLE
Here is an example of a DEFINE_TEXT_FILE command used to define a couple of feature shapes.
DEFINE_TEXT_FILE FILENAME="Test Features"
GM_TYPE=Lake, < 0.5 sq. mi.
DESCRIPTION=LAKE OR POND
BORDER_COLOR=RGB(0,0,0)
BORDER_STYLE=Null
FILL_COLOR=RGB(0,0,211)
FILL_STYLE=Solid Fill
CLOSED=YES
LABEL_POS=382285.8,4331317.0
DLGMAJ_0=50
DLGMIN_0=421
382277.3,4331322.5
382297.4,4331322.5
382297.4,4331322.5
382290.6,4331312.0
382277.7,4331311.0
382277.7,4331311.0
382277.3,4331322.5
GM_TYPE=Minor River
DESCRIPTION=STREAM
BORDER_COLOR=RGB(0,0,0)
 - 30 -
 Global Mapper Scripting Reference Section 4: Define data
 DEFINE_VAR
BORDER_STYLE=Null
FILL_COLOR=RGB(0,0,211)
FILL_STYLE=Solid Fill
CLOSED=YES
LABEL_POS=381081.4,4319924.0
DLGMAJ_0=50
DLGMIN_0=412
381269.3,4320021.0
381288.4,4320030.0
381298.8,4320037.0
381330.0,4320081.5
381359.7,4320117.0
381380.0,4320130.0
381397.2,4320136.0
381419.2,4320136.5
381460.5,4320125.5
381517.1,4320120.5
381554.9,4320121.5
381627.6,4320133.0
381665.4,4320135.5
381684.3,4320131.5
381707.9,4320122.0
381725.6,4320118.5
381733.4,4320112.5
END_DEFINE_TEXT_FILE
DEFINE_VAR
The DEFINE_VAR command allows you to define a variable and an associated value. You can
then use the defined variable name later wrapped in percent signs to have the defined value
replaced in the script. This is useful for things like defining a path or something at the top of a
script that you can easily change in just one place later. You can also pass variables on the com-
mand line for truly power batch-mode operation.
Built-in Variables
There are several built-in variable names that you can use to easily insert things like the current
date and time. The following variable strings can be used without having to define them:
 l %TIMESTAMP% - inserts current date and time in system format
 l %TIMESTAMP_MS% - inserts current date and time to millisecond resolution in the
 format 'YYYYMMDD_HHMMSSsss'
 l %DATE% - inserts current date in system format
 l %TIME% - inserts current time in system format
 l %TIME_SINCE_START% - inserts the number of seconds since the script starting running
 l %TIME_SINCE_LAST_LOG% - inserts the number of seconds since the last use of this vari-
 able
 l %SCRIPT_FILENAME% - inserts the full path and filename of the running script
 l %SCRIPT_FOLDER% - inserts the full path of the running script/workspace file. This will
 include a trailing slash. So a script 'C:\path\my_script.gms' would get 'C:\path\' inserted
 - 31 -
 Global Mapper Scripting Reference Section 4: Define data
 DEFINE_VAR
 l %GM_MAJOR_VER% - inserts the major version of Global Mapper. For example, any
 Global Mapper v17 build would insert '17'
 l %GM_FULL_VER_W_DATE% - inserts the full version of Global Mapper, including the
 build date. For v17.0.0 built on Sep 22, 2015, this would be 'v17.0.0 (b092215)'
 l %GM_FULL_VER_NO_DATE% - inserts the full version of Global Mapper. For v17.0.0 this
 would be 'v17.0.0'
 l %SCRIPT_FILENAME_W_EXT% - the script file name with the extension
 l %SCRIPT_FILENAME_WO_EXT% - the script file name without the extension
 rather than
 DEFINE_VAR NAME="TIMEDATE" FORMULA="match(%TIME%, '\d+:\d+')"
 However, you do need the '%' characters if using a variable inside a string parameter. For
 example,
 DEFINE_VAR name=FNAME_WO_EXT VALUE=4007925_nw_a_naip
 - 32 -
 Global Mapper Scripting Reference Section 4: Define data
 DEFINE_VAR
 l YES - Display prompt with OK and Cancel buttons and a box to enter the value.
 l YES_NO - Display prompt with Yes and No buttons. The value is set to YES or NO
l FILE - Prompts the user for a filename. The PROMPT text will be the title of the file
 open dialog. The VALUE (if any) will be the default filename selection (can be full
 path to provide a default folder too). You can use the VALUE parameter to provide
 several defaults, including default folder, default filename, and/or default file exten-
 sion. If you just want to provide a default folder, use VALUE="C:\PATH_HERE\."
 where the filename is just a dot.
 l DIR - Prompts the user for a directory/ folder. The PROMPT text will be the title of
 the folder selection dialog. The VALUE (if any) will be the default folder selection.
l PROMPT_TEXT - specifies the text to show if a PROMPT parameter is provided
l ABORT_ON_CANCEL - specifies that if a prompt is cancelled (like for a file) that the entire
 script should be aborted. Defaults to YES if a cancellable prompt is provided. Use ABORT_
 ON_CANCEL=NO to not cancel the whole script on cancel of prompt.
l FILE_MUST_EXIST - specifies that if PROMPT=FILE is specified, the selected file can be a
 new one and doesn't have to already exists.
 l FILE_MUST_EXIST=YES will pop up a File Open dialog, and the user must select an
 existing file.
 l FILE_MUST_EXIST=NO will pop up an File Save dialog, and the user can choose an
l FILENAME - filename of the layer to get the attribute value from if you use VALUE_ATTR.
 If an empty value is passed in, all loaded vector layers will be checked. When running the
 script in the context of the main map view (including loading a workspace) you can also
 pass in the value 'USER CREATED FEATURES' to have the 'User Created Features' layer
 updated or 'SELECTED LAYERS' to have any layers selected in the Control Center updated.
 - 33 -
 Global Mapper Scripting Reference Section 4: Define data
 DEFINE_VAR
 l FILENAME_PIECE - specifies that only a piece of the specified value should be used. Used
 if the value specifies a full path and filename and you want to define the variable to just a
 piece of that. So you might use one DEFINE_VAR with a PROMPT=FILE to select a file-
 name, then another DEFINE_VAR with that previous variable value as the value and
 FILENAME_PIECE added requesting one of the pieces listed below (samples based on
 'C:\path\to\my\data\my_file.dem'):
 l DIR - full path to current file (value is 'C:\path\to\my\data\')
l PARENT_DIRN - name of some level of parent directory, where 'N' is level. For
SAMPLE
Here is an example of a DEFINE_VAR command used to define a directory path for later use and
then its subsequent use:
DEFINE_VAR NAME="DATA_DIR" VALUE="c:\temp\export test"
IMPORT FILENAME="%DATA_DIR%\blue_springs.opt"
For example you could use the following inside a directory loop to change the output path:
DEFINE_VAR NAME="OUT_FNAME" VALUE="%FNAME_W_DIR%" REPLACE_STR="OLD_PATH\=NEW_PATH\SUB_FOLDER\"
Example to define a variable based on the F_CODE attribute of a loaded layer and then use that
in the layer description of the layer.
DEFINE_VAR NAME="LAYER_F_CODE" VALUE_ATTR="F_CODE" \
FILENAME="c:\path_to_layer\my_data.shp"
SET_LAYER_OPTIONS FILENAME="c:\path_to_layer\my_data.shp" \
LAYER_DESC="%LAYER_F_CODE%"
Example to prompt the user for a folder and then a .zip file in that folder (you could have just
prompted for the file all at once, but this is for- 34
 demonstration),
 - then loads it.
 Global Mapper Scripting Reference Section 4: Define data
 DEFINE_VAR_TABLE
Example to prompt the user for a filename, then define new variables that hold pieces of the
selected filename.
// Prompt use for file. Script aborts on cancel
DEFINE_VAR NAME="FULL_FNAME" PROMPT=FILE ABORT_ON_CANCEL=YES
// Define a variable with just the filename, another with parent folder
DEFINE_VAR NAME="FNAME_ONLY" VALUE="%FULL_FNAME%" FILENAME_PIECE="FNAME_WO_EXT"
DEFINE_VAR NAME="FNAME_PARENT_DIR" VALUE="%FULL_FNAME%" FILENAME_PIECE="PARENT_DIR"
DEFINE_VAR NAME="FNAME_PARENT_DIR1" VALUE="%FULL_FNAME%" FILENAME_PIECE="PARENT_DIR1"
DEFINE_VAR_TABLE
The command can be used to set up a look-up table in the script. Once the table is set up, you
can use a DEFINE_VAR command to set up a script variable by looking up a value in the table. It
can also be used in a variable loop with VAR_LOOP_START...VAR_LOOP_END. The data that
makes up the table can be specified inline, or read from a CSV file. Global Mapper assumes that
the first line of the data contains the column names for the table. This is true regardless of
whether the data is inline or in a file.
The following parameters are required by the DEFINE_VAR_TABLE command.
 l NAME - Defines the name of the table
 l FILENAME - (optional) Provides the full path to the CSV file that contains the table data. If
 both a file name and inline data are provided, only the data from the file is used; the
 inline data will be ignored.
 l HAS_COL_NAMES - specifies whether or not the first line of data contains column names.
 Enabled by default, use HAS_COL_NAMES=NO to specify that there are no column
 names. This is typically used for a simple list of values to loop over using VAR_LOOP_
 START...VAR_LOOP_END.
 l PROMPT - allows defining the values in the table by prompting the user to select a list of
 multiple items. The following values are supported:
 l FILE - Prompts the user to select one or more files that will be used as the values in
 the table with a column name of FILENAME. If you wish to instead use the contents
 of a prompted-for file, use a DEFINE_VAR command prior to the DEFINE_VAR_
 TABLE to prompt the user for the filename, then pass that in directly as the
 FILENAME parameter with no PROMPT=FILE. The PROMPT_TEXT value will be the
 title of the file open dialog. The FILENAME value (if any) will be the default file-
 name selection (can be full path to provide a default folder too). You can use the
 FILENAME parameter to provide several defaults, including default folder, default
 filename, and/or default file extension. If you just want to provide a default folder,
 use FILENAME="C:\PATH_HERE\." where the filename is just a dot.
 - 35 -
 Global Mapper Scripting Reference Section 4: Define data
 END_VAR_TABLE
END_VAR_TABLE
- Indicates the end of the DEFINE_VAR_TABLE command. This is always required, whether the
data is specified inline or in a file.
SAMPLES
Example (data specified inline):
DEFINE_VAR_TABLE NAME="state_codes"
 st_code,st_abb,st_name
 06,ca,"california,xyz"
 08,co,colorado
END_VAR_TABLE
DEFINE_VAR NAME="st_abb1" VALUE_TABLE="state_codes" VALUE_COLUMN="st_abb" \
COMPARE_STR="st_code=06"
DEFINE_VAR NAME="st_name1" VALUE_TABLE="state_codes" VALUE_COLUMN="st_name" \
COMPARE_STR="st_code=06"
 st_code,st_abb,st_name
 06,ca,"california,xyz"
 08,co,colorado
 09,me,maine
For an example that specifies a table of settings to use in a tool see Sample Script: Loop Over
Settings
 - 36 -
 Global Mapper Scripting Reference Section 5: Display
 DEFINE_PROJ
Display
 DEFINE_PROJ 37
 SAMPLES 38
 LOAD_PROJECTION 38
 Projection Specification Values 39
 SAVE_PROJECTION 41
 DEFINE_SHADER 41
 SAMPLE 41
 DEFINE_LAYER_STYLE 42
 SAMPLE 42
 LOAD_STYLE_FILE 43
 SET_OPT 43
 Specifying a Type/Lidar Filter/ shared Lidar Draw Mode 45
 SAMPLE 47
 LOAD_TYPE_FILTER 47
 SET_VERT_DISP_OPTS 47
 SET_VIEW 49
 SAVE_CURRENT_VIEW 50
 RESTORE_LAST_SAVED_VIEW 50
 SET_BG_COLOR 50
 SHOW_3D_VIEW 50
 VIEW_LAYOUT(Deprecated) 51
 MAP_LAYOUT 51
 END_MAP_LAYOUT 51
DEFINE_PROJ
The DEFINE_PROJ command allows a projection (including datum) to be associated with a
name. The projection name can then be used in later IMPORT, IMPORT_ARCHIVE, IMPORT_
ASCII, and LOAD_PROJECTION commands to specify a projection as needed.
The DEFINE_PROJ command consists of a single command line followed by a series of lines
describing the projection in the format of an ESRI PRJ file. The easiest way to determine the
text for a projection is to setup a projection on the Projection tab of the Tools->Configuration
and then use the Save to File button to create a new .prj file. Then just open the .prj file up in
Notepad and copy the contents to the lines following the DEFINE_PROJ command line.
The DEFINE_PROJ command is terminated with a single line containing only the text END_
DEFINE_PROJ.
For a sample of the DEFINE_PROJ command in use, load some data and then save a Global Map-
per workspace file from the File->Save Workspace menu command. Open the resulting .gmw
file in an editor and you can see how the DEFINE_PROJ command is used to define a view pro-
jection and the set it.
 - 37 -
 Global Mapper Scripting Reference Section 5: Display
 LOAD_PROJECTION
SAMPLES
DEFINE_PROJ PROJ_NAME="UTM_ZONE30_WGS84"
Projection UTM
Datum WGS84
Zunits NO
Units METERS
Zone 30
Xshift 0.000000
Yshift 0.000000
Parameters
END_DEFINE_PROJ
DEFINE_PROJ PROJ_NAME="SPCS_ZONE502_NAD83"
Projection STATE_PLANE
Datum NAD83
Zunits NO
Units INTERNATIONAL FEET
Zone 502
Xshift 0.000000
Yshift 0.000000
Parameters
END_DEFINE_PROJ
DEFINE_PROJ PROJ_NAME="EQUIDC_WGS84"
Projection EQUIDISTANT_CONIC
Datum WGS84
Zunits NO
Units METERS
Xshift 0.000000
Yshift 0.000000
Parameters
40 0 0.00000 /* latitude of the standard parallel
-80 0 0.00000 /* central meridian
0 0 0.00000 /* latitude of the origin
0.0000 /* false easting (meters)
0.0000 /* false northing (meters)
END_DEFINE_PROJ
LOAD_PROJECTION
The LOAD_PROJECTION command imports a projection from a PRJ file and makes it the current
global projection. This projection will be used for all exports after this command until another
LOAD_PROJECTION command is encountered to change the global projection. The following
parameters are supported by the command (you would just use one of the below):
 l PROJ - special Projection Specification type of parameter that specifies the projection to
 use for the file. This will override any projection information stored in the file.
 l FILENAME (DEPRECATED use PROJ) - full path to PRJ file to load the projection from
 l PROJ_NAME (DEPRECATED use PROJ) - specifies the name of the projection to use. This
 name must have been defined with a prior DEFINE_PROJ command.
 - 38 -
 Global Mapper Scripting Reference Section 5: Display
 Projection Specification Values
 l PROJ_EPSG_CODE (DEPRECATED use PROJ) - specifies the numeric EPSG projection code
 that defines the projection. For example, use PROJ_EPSG_CODE=26715 to define a
 UTM zone 15 projection with NAD27 as the datum and meters as the units.
 - 39 -
 Global Mapper Scripting Reference Section 5: Display
 Projection Specification Values
SAMPLES
PRJ Filename
DEFINE_PROJ PROJ_NAME="TM_NAD83"
Projection TRANSVERSE
Datum NAD83
Zunits NO
Units INTERNATIONAL FEET
Xshift 0.000000
Yshift 0.000000
Parameters
1.000000000 /* scale factor at central meridian
-105 30 0.00000 /* central meridian
37 49 59.99999 /* latitude of the origin
914401.8290 /* false easting (meters)
304800.6100 /* false northing (meters)
0 0 0.00000 /* xy_plane_rotation
END_DEFINE_PROJ
IMPORT FILENAME="\countries.geojson" TYPE="GEOJSON" \
PROJ="TM_WGS84"
LOAD_PROJECTION PROJ="TM_WGS84"
EPSG Code
Zoned Projection name - this will select the appropriate UTM zone for the data.
 - 40 -
 Global Mapper Scripting Reference Section 5: Display
 SAVE_PROJECTION
SAVE_PROJECTION
The SAVE_PROJECTION command saves the current global projection to a PRJ file. The following
parameters are supported by the command.
 l FILENAME - full path to PRJ file to save the projection to
DEFINE_SHADER
The DEFINE_SHADER command allows a custom elevation / slope shader to be defined to be
used when rendering gridded elevation data. The shader will then be available for any other
operations and later Global Mapper runs. If there is an existing custom shader with the same
name it will be replaced.
The DEFINE_SHADER command consists of a single command line followed by a series of lines
describing the series of elevation / slope and color pairs that define the shader. Each line should
have a single elevation / slope value and a color value separated by a comma.
The DEFINE_SHADER command is terminated with a single line containing only the text END_
DEFINE_SHADER.
The following parameters are required by the DEFINE_SHADER command.
 l SHADER_NAME - specifies the name to associate with the shader
 l BLEND_COLORS - specifies whether or not colors should smoothly blend between values.
 Use BLEND_COLORS=NO to disable blending beween colors so you only get exactly the
 specified color.
 l STRETCH_TO_RANGE - specifies whether or not the specified elevation values for the
 shader should stretch to the range of the loaded data. Use STRETCH_TO_RANGE=YES to
 enable.
 l SHADE_SLOPES - specifies whether the elevation/slope values are slopes in degrees or
 elevation values. Use SHADE_SLOPES=YES to indicate the specified values are slopes.
 l SLOPES_PERCENT - specifies whether the slope values that are specified. Add SLOPES_
 PERCENT=YES to indicate that slopes are in percent, otherwise they will be in degrees.
 l OVERWRITE_EXISTING - specifies what to do if there is already a custom shader with the
 given name If OVERWRITE_EXISTING=YES is specified the existing custom shader will be
 overwritten. Otherwise it would be ignored.
 l SAVE_SHADER - specifies whether or not the shader should be saved between runs via
 the custom_shaders.txt file. This is enabled by default, so add SAVE_SHADER=NO to
 cause your shader to NOT be remembered.
SAMPLE
Here is an example of a DEFINE_SHADER command used to define a sample 3-color blended
shader.
 - 41 -
 Global Mapper Scripting Reference Section 5: Display
 DEFINE_LAYER_STYLE
DEFINE_LAYER_STYLE
The DEFINE_LAYER_STYLE command allows you to define a layer style for the area, line, or
point features in a vector layer. You can then apply this with the IMPORT or SET_LAYER_
OPTIONS command later.
The DEFINE_LAYER_STYLE command consists of a single command line followed by a series of
lines with the contents of a .gm_layer_style file, like you would save from the Area Styles, Line
Styles, or Point Styles tab of the Options dialog for a vector layer. You can also provide a .gm_
layer_style in the FILENAME parameter to just reference an external file rather than embedding
the layer style directly in the script file.
The DEFINE_LAYER_STYLE command is terminated with a single line containing only the text
END_DEFINE_LAYER_STYLE.
For a sample of the DEFINE_LAYER_STYLE command in use, load some data and set up some
attribute-based or other custom styling on the Styles tabs of the Options dialog, then save a
Global Mapper workspace file from the File->Save Workspace menu command. Open the res-
ulting .gmw file in an editor and you can see how the DEFINE_LAYER_STYLE command is used to
define a layer style and then use it in the IMPORT command.
The following parameters are required by the DEFINE_LAYER_STYLE command.
 l NAME - specifies the name to associate with the style. Use this value in an IMPORT com-
 mand with the AREA_STYLE_NAME, LINE_STYLE_NAME, or POINT_STYLE_NAME para-
 meters.
 l TYPE - type of style being specified, allowed values are AREA, LINE, and POINT.
 l FILENAME - specifies the name of a .gm_layer_style file to use for the style rather than
 embedding it.
 l LAYERSTYLE - number indicating the type of styling used. Save a workspace with a styled
 layer to check these values.
Various other parameters define the layer style. Load data in Global Mapper and style using the
layer options, then save a style file or save the workspace to see the style definition.
SAMPLE
This sample defines a quiver plot style. The best way to set up a Quiver Plot point style is to cre-
ate a Quiver Plot in Global Mapper, then save a workspace. Open the workspace in a text editor
to see the Quiver Plot layer style definition.
DEFINE_LAYER_STYLE NAME="POINT_STYLE" TYPE="POINT"
LayerStyle=4
Type=2
 - 42 -
 Global Mapper Scripting Reference Section 5: Display
 LOAD_STYLE_FILE
QuiverPlotAttrType=1
QuiverPlotArrowSymbol=413
QuiverPlotAttrName1=U
QuiverPlotAttrName2=V
END_DEFINE_LAYER_STYLE
LOAD_STYLE_FILE
The LOAD_STYLE_FILE command load a Global Mapper Style (.gm_style) file containing style
definitions for a list of types. You can optionally choose to have any types specified in the style
file that aren't present in the running instance of Global Mapper to be added, providing a script
way to add new custom types. The following parameters are supported by the command:
 l FILENAME - full path to style (.gm_style) file to load
 l ADD_UNKNOWN_TYPES - specifies that any types found in the style file that aren't
 present will be added as custom types. Use ADD_UNKNOWN_TYPES=NO to disable
 adding missing types, or ADD_UNKNOWN_TYPES=YES to enable it (this is the default).
SET_OPT
The SET_OPT command provides a place to set general options that aren't layer-specific, like
the Position Display Format (see POS_DISP_FORMAT below). Use the SET_VERT_DISP_OPTS
command for options related to the display of terrain data. The functionality that used to be in
the LOAD_TYPE_FILTER command is now found here as well. The following parameters are sup-
ported by the command:
 l POS_DISP_FORMAT - specifies the Position Display Format to use. This is the same as the
 setting on the General tab of the Configuration dialog. This setting is used for things like
 CSV export with EXPORT_VECTOR and with the ADD_COORD_ATTRS parameter to the
 EDIT_VECTOR command. The following values are supported:
 l DECIMAL - Lat/lon Degrees formatted as DD.DDDDDD N/S/E/W
 l AREA_UNITS - specifies the units to use when storing area measurements. The following
 values are supported:
 l ACRES
l HECTARES
l SQUARE FEET
l SQUARE KILOMETERS
l SQUARE METERS
l SQUARE MILES
 - 43 -
 Global Mapper Scripting Reference Section 5: Display
 SET_OPT
l DISTANCE_UNITS - specifies the units to use when storing linear distance measurements.
 The following values are supported:
 l METRIC - meters for shorter distances, kilometers for longer
 meters for distance. Use this if you want to numerically compare values
l DRAW_AREAS - specifies whether or not area features are drawn. Use DRAW_
 AREAS=YES to enable.
l DRAW_LINES - specifies whether or not line features are drawn. Use DRAW_LINES=YES
 to enable.
l DRAW_POINTS - specifies whether or not point features are drawn. Use DRAW_
 POINTS=YES to enable.
l DRAW_LABELS - specifies whether or not feature labels are drawn. Use DRAW_
 LABELS=YES to enable.
l DRAW_ORDER - specifies the order in which layers are drawn, in particular vector layers.
 This corresponds to the Vector Layer Order During Draw setting on the Vectory Display
 tab of the Configuration dialog.
 l BY_TYPE - Layers are ordered by type. Any raster/elevation grid layers are drawn
 first in whatever order they are organized in the Control Center (default is load
 order). After that, vector features are sorted together with areas drawing first (sor-
 ted by type/style/layer within areas), then line, and finally point features.
 l BY_LAYER - Layers are drawn in the order they are shown in the Control Center (i.e.
 default is load order). Within a single vector layer, areas are drawn first, then lines,
 and finally points.
l MISC_OPT - specifies an advanced option to set the value of. There are a number of
 named options listed below. In addition to those, any numeric value from the GM_Mis-
 cOpt_t32 type defined in the GlobalMapperInterface.h of the SDK are available to be
 passed in. Use the MISC_OPT_VALUE to set the value for the option.
 l MAINTAIN_EXPORT_BOUNDS - controls whether or not when providing a bound-
 ing box and resolution for an export, the bounds will be exactly maintained and the
 sample spacing slightly shrunk if necessary to make the bounds an even multiple of
 the spacing. Use a value of 1 to enable maintaing the bounds, or 0 to use the
 default of keeping the spacing the same and growing the bounds slightly if needed.
 - 44 -
 Global Mapper Scripting Reference Section 5: Display
 SET_OPT
 an export bounds will be snapped to align with the closest sample spacing bound-
 ary. Use MISC_OPT_VALUE="1" to enable this snapping, or MISC_OPT_VALUE="0"
 to disable (the default).
 l TEMP_FOLDER - specifies the base temp folder to use. Pass an empty string to
 range from 0 for only critical errors to 4 to log everything, including debug mes-
 sages. The default is 1 which logs errors and critical errors.
 l LOG_FILENAME - specifies the name of the file to log errors and warnings to (based
 on LOG_LEVEL).
 l MISC_OPT_VALUE - specifies the value to set for the MISC_OPT option. For most options
 this will be 1 to enable or 0 to disable, but some of the options for the GM_MiscOpt type
 can take other numbers (i.e. unit settings) or even a string value (i.e. filenames for timing
 or log filename).
 l MISC_OPT_OLD_VALUE_VAR - specifies the name of a variable to store the previous
 MISC_OPT value in. This is useful to later restore a changed value in a script. See example
 below.
 l DETAIL_OFFSET - specifies the detail offset to use when determining which vector fea-
 ture types to display based on zoom level. The valid range is -150 to +150. Values less
 than zero mean to draw feature types sooner than you normally would based on clas-
 sification. Values larger than 0 mean to require zooming in further than normal to see a
 given feature type. This reflects the value of the detail slider on the Vector Display tab of
 the Configuration dialog. The default value of that slider is -150 which will always display
 all enabled vector types.
 l MAX_THREAD_COUNT - defines the maximum number of threads to use for any given
 multi-threaded process. The default value of 0 means to use all available cores except for
 1 (to keep the UI responsive). If you want to reduce the number of processor cores used
 you can customize a value here. This will slow processes that use multiple cores, but
 allow other applications to work more quickly. For example, using MAX_THREAD_
 COUNT=1 makes every Global Mapper process use only a single thread/core.
 starts off with the current filter settings, but you can add ALL to enable everything or
 NONE to clear the filter, then add or remove stuff after that. For example, to specify a
 class filter with only types 2 and 3 enabled, use LIDAR_FILTER="NONE,2,3". To get
 one with everything but classes 2 and 3, use LIDAR_FILTER="ALL,-2,-3".
l LIDAR_RETURN_FILTER - specifies a comma-separated list of Lidar return types to enable
 or disable. Provide a minus sign (-)to remove the type from the filter rather than add it.
 The filter starts off with the current filter settings, but you can add ALL to enable
 everything or NONE to clear the filter, then add or remove stuff after that. For example,
 to specify a return filter with only unknown and first returns, use LIDAR_RETURN_
 FILTER="NONE,0,1". To get one with everything but the first return, use LIDAR_
 RETURN_FILTER="ALL,-1". The numeric values have the following meanings:
 l 0 - Unknown Returns
l 1 - First Return
l 2 - Second Return
l 3 - Last Return
l 4 - Single Return
l LIDAR_DRAW_MODE - specifies the shared Lidar draw mode to use for any loaded layers
 that are set to use the shared global draw mode option if Global Mapper Pro is active.
 The following values are supported:
 l COLOR - if the points have an associated RGB color, use that. Otherwise color by
 elevation.
 l ELEV - color by elevation of the point using the current elevation shader.
 ity value when using the INTENSITY draw mode option. If this parameter is
 provided with an empty value the terrain shader selected on the main tool-
 bar will be used.
 l CLASS - color by the point classification
 use when using the BY_LAYER draw mode option. If not specified, automatic
 color assignment will be used when coloring by source layer.
 l POINT_INDEX - color by the point index (i.e. order of points in file)
 - 46 -
 Global Mapper Scripting Reference Section 5: Display
 SET_VERT_DISP_OPTS
 l NDVI - color by calculated NDVI value (requires Lidar to have RGB + NIR)
 l NDWI - color by calculated NDWI value (requires Lidar to have RGB + NIR)
 l DENSITY - color by point density
 l WITHHELD - color withheld points
 l KEY_POINT - color model key points
 l OVERLAP - color overlap points
SAMPLE
Example: Set an export option to snap to spacing, do an export, then restore the previous value
 // Enable the option to snap to a spacing interval and save old value
SET_OPT MISC_OPT="EXPORT_BOUNDS_SNAP_SPACING" MISC_OPT_VALUE="1" MISC_OPT_OLD_VALUE_VAR="PREV_
VAL_SPACING"
// Do the export
EXPORT_RASTER FILENAME="out.tif" TYPE=GEOTIFF
// Restore the old setting
SET_OPT MISC_OPT="EXPORT_BOUNDS_SNAP_SPACING" MISC_OPT_VALUE="%PREV_VAL_SPACING%"
LOAD_TYPE_FILTER
The LOAD_TYPE_FILTER command is deprecated as of Global Mapper v16.0.5. The SET_OPT
command now handles both loading type filters and other generic global options. See that com-
mand for the list of parameters. The LOAD_TYPE_FILTER command will still work, but you
should switch over to SET_OPT.
SET_VERT_DISP_OPTS
The SET_VERT_DISP_OPTS command allows you to modify the options used when rendering
elevation layers, such as the shader to use, if any, as well as the lighting and water setup. The
following parameters are supported by this command:
 l ENABLE_HILL_SHADING - this setting controls whether or not hill shading (i.e. lighting,
 shadowing) will be done. Use YES to enable hill shading, and NO to disable hill shading.
 l SHADER_NAME - this sets the name of the shader to use when rendering elevation
 data. This must be one of the names displayed in the shader drop down in Global Map-
 per, such as "Atlas Shader" or "Global Shader" or the name of a custom shader.
 l AMBIENT_LIGHT_LEVEL - this sets the ambient lighting level. The valid range of values is
 [0.0, 1.0], with smaller numbers meaning completely black (i.e. no light) and 1.0 being full
 lighting.
 l VERT_EXAG - this sets the vertical exaggeration to use when rendering elevation over-
 lays. This effects the hill shading. The valid range of values is (0.0, 100.0].
 l LIGHT_ALTITUDE - this sets the altitude angle of the light source that creates shadows on
 elevation data. The valid range of values is [0.0, 90.0], with 0.0 meaning a light source at
 the horizon and 90.0 meaning a light source directly overhead.
 - 47 -
 Global Mapper Scripting Reference Section 5: Display
 SET_VERT_DISP_OPTS
l LIGHT_AZIMUTH - this sets the direction angle of the light source that creates shadows
 on elevation data. The valid range of values is [0.0, 360.0), with 0.0 meaning a light
 source from the top of the screen (i.e. north), 90.0 meaning from the right (i.e. east), etc.
l LIGHT_NUM_SOURCES - this setting controls how many different directions of light the
 shading for terrain is computed from. By default you just get a light from the direction
 specified by LIGHT_AZIMUTH and LIGHT_ALTITUE, but if you specify a value for this para-
 meter greater than 1 you get extra lights spacing around the circle. For example, using
 LIGHT_NUM_SOURCES=4 gives you a light source at the LIGHT_AZIMUTH direction as
 well as 3 other sources 90, 180, and 270 degrees from that direction.
l LIGHT_BLENDING_ALGORITHM - this setting controls how the shading for terrain is com-
 puted by blending light sources from multiple directions (as specified by LIGHT_NUM_
 SOURCES). The following values are supported:
 l 0 - Average shadow from each light
l 3 - Weighted average shadow from each light, with specified light azimuth getting
 highest weight
l SHADE_DARKNESS - this sets the minimum black level that a shadow can create. The
 valid range of values is [0,255], with 0 allowing complete blackness from a shadow, and
 255 allowing no shadow at all.
l SHADE_HIGHLIGHT - this sets the level of white highlight applied to terrain areas directly
 facing the sun/light angle. The valid range of values is [0,255], with 0 applying no high-
 light and 255 making the direct areas always brightened completely to white.
l ENABLE_WATER - this setting controls whether or not water will be displayed on top of
 elevation values at or below the currently configured water level. Use YES to enable
 water display, and NO to disable water display.
l WATER_COLOR - this setting controls the color that water drawn on top of elevation data
 is rendered in. The format of this value is RGB(<red>,<green>,<blue>). For example, to
 use a water color of blue, use WATER_COLOR=RGB(0,0,255).
l WATER_LEVEL - this setting specifies the height (in meters) below which water should be
 displayed if enabled.
l WATER_ALPHA - this setting controls how "see through" the water is when displayed.
 The valid range of values is [0,255], with 0 meaning the water is completely "see
 through", i.e. invisible, and 255 meaning that the water color is completely opaque such
 that you can't see any of the shaded relief below it.
l SLOPE_ALGORITHM - this setting controls how the slope at a given location in a layer is
 calculated. The following values are supported:
 l 0 - (Default) Average Maximum of Slope to 4 Non-Diagonal Adjacent Samples - This
 method computes the slope from the cell center to the left and right, and top and
 bottom samples, then combines those to get a single slope value.
 - 48 -
 Global Mapper Scripting Reference Section 5: Display
 SET_VIEW
 the slope from the cell center to the left, right, top, and bottom samples, then uses
 the maximum of those 4 slope values.
 l 3 - Maximum Slope to All 8 Adjacent Samples - This method computes the slope
 from the cell center to each of the 8 adjacent cell centers, then uses the maximum
 of those 4 slope values.
 l DAYLIGHT_SHADER_COLOR - this setting controls the color that is used when rendering
 terrain using the Daylight Shader. The format of this value is RGB(<red>,<green>,<blue>).
 For example, to use a color of red, use WATER_COLOR=RGB(255,0,0).
SET_VIEW
The SET_VIEW command sets the current view bounds. Use this in workspace files that run in
the context of the main map view.
The following parameters are supported by the command:
 l GLOBAL_BOUNDS - specifies the combine bounds in units of the current global pro-
 jection. There should be 4 values in a comma-delimited list following the parameter
 name. The values should be in order of minimum x, minimum y, maximum x, maximum y.
 l GLOBAL_BOUNDS_SIZE - specifies the combine bounds in units of the current global pro-
 jection. There should be 4 values in a comma-delimited list following the parameter
 name. The values should be in order of minimum x, minimum y, width in x, width in y.
 l LAT_LON_BOUNDS - specifies the combine bounds in latitude/longitude degrees. There
 should be 4 values in a comma-delimited list following the parameter name. The values
 should be in order of west-most longitude, southern-most latitude, eastern-most lon-
 gitude, northern-most latitude.
 l LAYER_BOUNDS - specifies that the operation should use the bounds of the loaded layer
 (s) with the given filename. For example, to export to the bounds of the file "c:\test.tif",
 you would use LAYER_BOUNDS="c:\test.tif". Keep in mind that the file must be
 currently loaded.
 l LAYER_BOUNDS_EXPAND - specifies that the operation should expand the used LAYER_
 BOUNDS bounding box by some amount. The amount to expand the bounding rectangle
 by should be specified in the current global projection. For example, if you have a UTM/-
 meters projection active and want to expand the bounds retrieved from the LAYER_
 BOUNDS parameter by 100 meters on the left and right, and 50 meters on the top and
 bottom, you could use LAYER_BOUNDS_EXPAND="100.0,50.0". You can also spe-
 cify a single value to apply to all 4 sides, or supply 4 separate values in the order
 left,top,right,bottom.
 l SNAP_BOUNDS_TO_MULTIPLE - specifies that the top-left corner of the bounding box
 for the operation should be snapped to a multiple of the given value. For example, using
 - 49 -
 Global Mapper Scripting Reference Section 5: Display
 SAVE_CURRENT_VIEW
SAVE_CURRENT_VIEW
The SAVE_CURRENT_VIEW command saves the current view window for later restoration using
the RESTORE_LAST_SAVED_VIEW command. This command does not take any parameters.
RESTORE_LAST_SAVED_VIEW
The RESTORE_LAST_SAVED_VIEW command restores the last view saved with the SAVE_
CURRENT_VIEW command (or the last view saved with the View->Save Current View menu com-
mand in the Global Mapper user interface). This command does not take any parameters.
SET_BG_COLOR
The SET_BG_COLOR command sets the color to use for any background pixels when rendering
layers. The following parameters are supported by the command.
 l COLOR - specifies the background color to use. The color should be specified as RGB
 (<red>,<green>,<blue>). For example, to make white the background color, use COLOR-
 R=RGB(255,255,255).
SHOW_3D_VIEW
The SHOW_3D_VIEW command displays the 3D view window with the loaded data.
The following parameters are supported by the command:
 l MAXIMIZE - specifies whether or not the 3D view window should be maximized or not.
 Use MAXIMIZE=YES to force the window to be maximized when displayed.
 - 50 -
 Global Mapper Scripting Reference Section 5: Display
 VIEW_LAYOUT(Deprecated)
VIEW_LAYOUT(Deprecated)
The VIEW_LAYOUT command allows defines a multi-view layout where various map views are
placed in the user interface. This has been replaced by the PANE_LAYOUT command, which
defines dockable panes. The older VIEW_LAYOUT definition will be converted to the newer
PANE_LAYOUT when imported into Global Mapper v19 and later.
The VIEW_LAYOUT command consists of a single command line followed by a series of lines
with the contents of a .gm_views file, like you would save from the Map View Manager dialog.
You can also provide a .gm_views in the FILENAME parameter to just reference an external file
rather than embedding the map view layout definition directly in the script file.
The VIEW_LAYOUT command is terminated with a single line containing only the text END_
VIEW_LAYOUT.
For a sample of the VIEW_LAYOUT command in use, set up the view layout you want using the
Map View Manager, then save a Global Mapper workspace file from the File->Save Workspace
menu command. Open the resulting .gmw file in an editor and you can see how the VIEW_
LAYOUT command is used at the bottom of the file to define the map layout so long as you
haven't disabled the save/restore of the multi-view layout to workspace files in the Advanced
section of the General tab of the Configuration dialog.
The following parameters are required by the VIEW_LAYOUT command.
 l FILENAME - specifies the name of a .gm_views file to use rather than embedding it.
MAP_LAYOUT
The MAP_LAYOUT command defines onscreen map elements, including margins, scale bar,
legend, etc.
The MAP_LAYOUT command consists of a single command line followed by a series of lines
with the contents of a .gm_layout file. This is what is saved in a workspace that defines on
screen map elements. You can also provide a .gm_layout in the FILENAME parameter to just ref-
erence an external file rather than embedding the map layout directly in the script file.
The following parameters are used by the MAP_LAYOUT command.
 l FILENAME - specifies the name of a .gm_layout file to use rather than embedding it.
END_MAP_LAYOUT
The MAP_LAYOUT command is terminated with a single line containing only the text END_
MAP_LAYOUT.
For a sample of the MAP_LAYOUT command in use, load some data, then save a Global Mapper
workspace file from the File->Save Workspace menu command. Open the resulting .gmw file in
an editor and you can see how the MAP_LAYOUT command is used at the bottom of the file to
define the onscreen map elements.
 - 51 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
IMPORT
The IMPORT command imports a data file for later use. To determine the proper import para-
meters, one option is to load the file via the interface and save a workspace. The
IMPORT command and parameters will be listed in the workspace file. The following para-
meters are supported by the command.
 l FILENAME - full path to file to load the data from. This can also be the URL (http: or ftp:)
 for a file on a web site that you want Global Mapper to download and load. You can
 include wildcards ('*' or '?') in the FILENAME (v16.0.5. or later) to load all files matching a
 particular mask. In v17.0.4 or later you can provide workspace or script files (.gmw and
 .gms) via an IMPORT command rather than using EMBED_SCRIPT.
 l TYPE
 The following import formats may be specified:
 l AUTO - automatically determine the type (default).
 - 52 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
 - 53 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
 - 54 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
l LULC - USGS Land Use and Land Cover vector data file.
l MAPINFO - a MapInfo MIF/MID of TAB/MAP vector data collection.
l MAPMAKERTERRAIN - a MapMaker terrain file
l MAPTECH - a MapTech BSB, Topo, or Aerial format file.
l MARPLOT_MIE - a MarPlot MIE format file.
l MBTILES - MapBox MBTiles Format (raster).
l MICROPATH_3CD - a Micropath 3CD grid file.
l MICRODEM_DEM - a MicroDEM-created DEM file.
l MPR - MPR/MPH (German Topo Map) file.
l MRSID - a LizardTech MrSID image file.
l MRSID_LIDAR - LizardTech MrSID MG4 Lidar.
l MSACCESS - Microsoft Access Database.
l MSI_PLANET - MSI Planet Format.
l NetCDF - a NetCDF format file.
l NIMA_GNS - a NIMA GNS format file.
l NITF - NITF format imagery
l NOS_GEO - a NOS/GEO format chart file.
l NTF_GRID - a NTF grid format file.
l OCAD - OCAD .OCD file.
l OPENAIR - OpenAir Airspace format.
l OPTIMI_GRID - an Optimi terrain or clutter grid format file.
l OTF_MAP_CATALOG - OTF (Objective Terrain Format).
l OZI - an OziExplorer format waypoint (WPT) or track (PLT) file.
l P689 - UKOOA P6/98 Seismic Binning Grid.
l PCI_PIX - PCI Geomatics PIX file.
l PCX - a PC Paintbrush PCX format file.
l PCX5 - a Garmin PCX5 format waypoint (WPT) or track (TRK) file.
l PRESAGIS_OPENFLIGHT - Openflight (FLT) format
l PDF - PDF file.
l RCS - Autodesk ReCap RCS file.
l RIK - RIK (Swedish Topo Map) file.
l RMAPS - RMaps SQLite Format.
l ROCKWORKS_GRID - a RockWorks Grid format file.
l ROCKWORKS_XML_GRID - Rockworks XML Grid.
l RPF - Raster Product Format database, like CADRG.
l RPF_FRAME - single frame from a Raster Product Format database, like CADRG ,
 RDTED, or CIB.
l S57 - a S-57 chart file
l SDTS - a SDTS transfer
l SEGP1 - a SEGP1 seismic shotpoint file.
l SHAPEFILE - an ESRI Shapefile.
l SPS - SPS (Shell Processing Support).
l SURFERGRID - a Surfer grid format file.
 - 55 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
 If there is a file type missing from this list that Global Mapper imports, save a
 workspace file with the loaded data, and view it in a text editor to see the import
 parameters. The AUTO value will work with most files
 l PROMPT_IF_TYPE_UNKNOWN - set to NO if you don't want the user to be prompted to
 select a file type if the type cannot automatically be determined (useful when looping).
 l SOURCE_URL - specified the URL of the file on the server. If the file specified by
 FILENAME is not found and there is a SOURCE_URL, the file is downloaded from the URL
 and saved to the FILENAME location.
l 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 elev-
 ation 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.
l METADATA_FILENAME - specifies full path and filename of a file to display the contents
 of on the Metadata dialog for a layer. The file can be any simple displayable text format,
 including text and XML.
l METADATA_URL - specifies a URL to a displayable web file (including HTML web page or
 XML document) to show on the Metadata dialog for a layer.
l CODE_PAGE- specifies the code page to use when interpreting text from this layer. By
 default if the file doesn't specify a code page the current system code page will be used.
 Use the code page number, or the text UTF-8 (number 65001).
l ALT_MODE (vector only) - altitude mode specifies how the 3D viewer should interpret z-
 values in the vector features of an layer, relative to terrain. Altitude mode may also be
 set in an individual feature, in which case it overrides the layer setting. The following val-
 ues are supported:
 l UNSPECIFIED - Altitude mode is determined by either the setting in the feature, or
l CLAMP_TO_SEA_FLOOR - ignore z-values, and clamp the feature to the sea floor
l ZOOM_DISPLAY - specifies when the map should be displayed and when it should be hid-
 den based on the display zoom scale. This command will be formatted as a name from
 the list, below followed by 2 numeric paramters. For example, use ZOOM_DISPLAY-
 Y="SCALE,25000,0" to have a map display only when zoomed in below 1:25000
 scale.
 l ALWAYS - always display the map. The numeric parameters are ignored.
l PERCENT - display the map when the map bounding box is a certain percentage of
 - 57 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
 l SCALE - display the map when the current display is at or below a certain scale. For
 example, use ZOOM_DISPLAY="SCALE,25000,0" to display the map when
 the current draw scale is at or below 1:25000.
 l SCALE_RANGE - display the map when the current display is below a range of scale
 - 58 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
 the value at 30N 95W with the projection set as PROJ_EPSG_CODE=4326 you can use
 PICTURE_POS="-95.0,30.0".
 l LOAD_HIDDEN_PDF_LAYERS - for PDF import, specifies that if no layer prompt is
 provided that hidden layers should be loaded automatically. Use LOAD_HIDDEN_PDF_
 LAYERS=YES to enable.
Elevation Parameters
Parameters for display and interpretation of elevation values in terrain layers. See also Raster
Parameters below for additional shared parameters.
 l ELEV_FIELD - specifies the name of the attribute field to use as the elevation value for the
 vector features in a file
 l ELEV_UNITS - specify elevation units to use for this file if it contains gridded elevation
 data and also for vector feature elevations that don't have a unit embedded in the elev-
 ation value. Valid values are as follows:
 l FEET - elevations in US feet
 l ELEV_OFFSET (elevation only) - specifies the offset in meters to apply to each elevation
 value in the layer. This allows you to vertically shift a layer to match other layers.
 l ELEV_POWER (elevation only) - specifies the power value to apply to each elevation value
 in the layer. For example a value of 2.0 would square each elevation value before apply-
 ing a scale and adding the offset. Default to 1.0 (no power).
 l ELEV_SCALE (elevation only) - specifies the scale value to apply to each elevation value in
 the layer. This allows you to vertically scale a layer to match other layers. Default to 1.0
 (no scaling).
 l MIN_ELEV (elevation only) - specifies the minimum elevation (meters) to treat as valid
 when rendering this layer. Any elevations below this value will be treated as invalid and
 not be drawn or exported.
 l MAX_ELEV (elevation only) - specifies the maximum elevation (meters) to treat as valid
 when rendering this layer. Any elevations above this value will be treated as invalid and
 not be drawn or exported.
 l CLAMP_ELEVS (elevation only) - if a MIN_ELEV and /or MAX_ELEV value is specified, set-
 ting this to YES will make any valid elevation values outside of the specified range be
 clamped to the new range value rather than treated as invalid.
 l VOID_ELEV (elevation only) - specifies the elevation (meters) to replace any void areas in
 the layer with. If not specified, the void areas will be transparent.
 l SHADER_NAME (elevation only) - this sets the name of the shader to use when rendering
 the gridded elevation data for this layer. Use this to override use of the shared default
 shader just for this layer. This must be one of the names displayed in the shader drop
 - 59 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
 down in Global Mapper, such as "Atlas Shader" or "Global Shader" or the name of a cus-
 tom shader.
 l BAND_RANGE - specifies the range of valid values found in a gridded layer. It can option-
 ally also specify how and how to determine what values are no-data values. If not spe-
 cified, these values will be automatically determined from the data. The format is a
 comma-delimited list of values like BAND_RANGE="min_valid,max_valid,band_validity_
 type,check_invalid_float,band_valid_val_1,band_valid_val_2". The _band_valid_val_1_
 and _band_valid_val_2_ values are optional and depend on the _band_validity_type_
 value. The individual values are:
 l min_valid - minimum valid value for grid cell samples
 are valid
 l RANGE_CLOSED - values in closed range [_band_valid_val_1, band_valid_val_
Raster Parameters
Parameters for display of imagery. Some of the below parameters are also supported for elev-
ation layers.
 l SAMPLING_METHOD (elevation and raster only) - specifies the sampling method to use
 when resampling this layer.
 The following values are supported
 l NEAREST_NEIGHBOR - use the nearest neighbor sampling method
 - 60 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
 - 61 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
l MULTIPLY
l SCREEN
l OVERLAY
l HARD_LIGHT
l COLOR_BURN
l COLOR_DODGE
l DARKEN
l LIGHTEN
l DIFFERENCE
l EXCLUSION
l APPLY_COLOR
l APPLY_COLOR_REVERSE
l KEEP_RED
l KEEP_GREEN
l KEEP_BLUE
l SPOT_NATURAL_COLOR_SPOT_TO_NATURAL
l PSEUDO_NATURAL_COLOR_CIR_TO_NATURAL
l COLOR_TO_GRAYSCALE
 - 62 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
 SIZE parameter can be used to override the number of standard deviations from
 the mean to stretch to.
 l MIN_MAX - apply a min/max contrast stretch, stretching the available range of val-
 ues in each color band to the full range of 0-255. For imagery which contains both
 black and white, this will have no affect.
l CONTRAST_SHARED (raster only) - specifies whether or not the contrast adjustment for
 this layer will share the adjustment with other contrast-adjusted layers in order to ensure
 a consistent modification across layers. Use CONTRAST_SHARED=YES to enable contrast
 sharing.
l CONTRAST_STRETCH_SIZE (raster only) - specifies the number of standard deviations
 from the mean to use in a PERCENTAGE contrast adjustment. The default is 2.0.
l AUTO_CONTRAST (raster only) - DEPRECATED, use CONTRAST_MODE instead - specifies
 whether to automatically calculate and apply a 2 standard deviation contrast adjustment
 to the image. Use AUTO_CONTRAST=YES to turn on. Anything else turns it off.
l COLOR_INTENSITY(DEPRECATED use COLOR_INTENSITY_FULL parameter) (elevation and
 raster only). - specifies the color intensity to use when adjusting the brightness of pixels
 in the overlay. Valid values range from 0 to 20, with 0 being completely black, 10 being
 - 63 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
 no alteration, and 20 being completely white. For example, to make an image slightly
 darker, you could use COLOR_INTENSITY=7.
l COLOR_INTENSITY_FULL (elevation and raster only) - specifies the color intensity to use
 when adjusting the brightness of pixels in the overlay. Valid values range from 0 to 512,
 with 0 being completely white, 256 being no alteration, and 512 being completely black.
 For example, to make an image slightly darker, you could use COLOR_
 INTENSITY=300. (NOTE: This parameter replaces the COLOR_INTENSITY parameter).
l TEXTURE_MAP (raster only) - specifies that this image should be draped over any elev-
 ation data loaded before it. Use TEXTURE_MAP=YES to turn on. Anything else turns it off.
l PALETTE_NAME (palette-based raster only) - specifies the filename of a recognized
 palette file to override the default colors in this layers palette or a palette previously
 defined with the DEFINE_PALETTE command. Use this to change the color interpretation
 of palette indices.
l TRANSPARENT_COLOR (elevation and raster only) - specifies the color to make trans-
 parent when rendering this overlay. The color should be specified as RGB(<red>,<-
 green>,<blue>). For example, to make white the transparent color, use TRANSPARENT_
 COLOR=RGB(255,255,255). If you do not wish any color to be transparent, do not
 use this parameter. Optionally, if the image that you are making transparent uses a
 palette for the colors, you can specify a palette index in the following format: INDEX(<0-
 based palette index>). For example, to make the second color in the palette transparent,
 use TRANSPARENT_COLOR=INDEX(1).
l TRANSPARENT_COLOR_DIST - for layers that have specified a color to make transparent,
 this parameter allows you to specify how far a color in the layer has to be from the spe-
 cified TRANSPARENT_COLOR value to be treated as transparent as well. The default value
 of 0 means that the colors have to exactly match for the pixel to be treated as trans-
 parent. Larger values (up to 256) allow larger distances between the layer color and the
 transparent color. This is useful for lossy formats, like JPEG.
l COLOR_GRADE (raster only) - specifies the color grading values to use for this layer (as
 configured on the Color Grade options dialog tab). This should be a comma-delimited list
 with the saturation value (from 0-1) first, then the input and output range for the red,
 green, and blue color channels, as follows: COLOR_GRADE=saturation,red_in_start,red_
 in_end,red_out_start,red_out_end,...,blue_out_end
l CLIP_COLLAR (raster only) - specifies whether to clip the collar off of the image. The fol-
 lowing values are supported for cropping:
 l NONE - no collar cropping is performed.
l LAT_LON - crop the collar to a a specified set of bounds specified in arc degrees in
 the native datum of the layer. The bounds should be specified using the CLIP_
 COLLAR_BOUNDS parameter.
 l NATIVE - crop the collar to a specified set of bounds specified in the native pro-
 jection system and datum of the layer. The bounds should be specified using the
 CLIP_COLLAR_BOUNDS parameter.
 - 64 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
 l PIXELS - crop a given number of pixels off of each side of the layer. The number of
 pixels to remove from each side should be specified using the CLIP_COLLAR_
 BOUNDS parameter.
 l SNAP_DEGREES - crop the collar by snapping each edge to a specified degree
 boundary specified in arc degrees in the native datum of the layer. The bounds
 should be specified using the CLIP_COLLAR_BOUNDS parameter. For example to
 crop the west and east edges to a half degree boundary and the north and south
 edges to a one degree boundary, use the following: CLIP_COLLAR_BOUNDS-
 S=0.5,1.0,0.5,1.0.
 l POLY - crop to a polygon provided with the CLIP_COLLAR_POLY parameter.
 l CLIP_COLLAR_BOUNDS (raster only) - specifies the bounds of the collar to be clipped off
 when the CLIP_COLLAR parameter is enabled. The coordinates should be specified in arc
 degrees, native layer coordinates, or pixel counts as a comma-delimited list going west-
 ,south,east,north. For example, CLIP_COLLAR_BOUNDS=34.25,-
 109.0,34.375,-108.875.
 l CLIP_COLLAR_POLY (raster only) - specifies the name of the previously defined shape
 (with the DEFINE_SHAPE command) to crop the layer to when the CLIP_COLLAR=POLY
 parameter is used. The coordinates in the shape must have been defined in the native
 projection system of the layer being loaded. Unless you provide CLIP_COLLAR_POLY_
 SIMPLIFY=NO, the clip polygon will be simplified to 1/10th of a pixel resolution to reduce
 the size of the crop polygon for faster cropping without noticeably changing the shape.
 l CLIP_COLLAR_POLY_EXCLUDE (raster only) - specifies that the crop to the polygon spe-
 cified with CLIP_COLLAR_POLY should keep all parts of the layer outside the crop polygon
 (s) rather than what is inside the polygon(s). Add CLIP_COLLAR_POLY_EXCLUDE=YES to
 enable this behavior.
 l CLIP_COLLAR_POLY_SIMPLIFY - specifies that the clip polygon will be simplified to 1/10th
 of a pixel resolution to reduce the size of the crop polygon for faster cropping without
 noticeably changing the shape. Enabled by default, use CLIP_COLLAR_POLY_
 SIMPLIFY=NO to disable.
 l CLIP_COLLAR_POLY_PIXEL (raster only) - specifies that the coordinates in the crop poly-
 gon from the CLIP_COLLAR_POLY parameter are in pixel relative coordinates for the layer
 rather than in the native system of the layer. Use this if you need to crop a layer to a par-
 ticular boundary in known pixel coordinates. The coordinates will convert to native layer
 coordinates on load.
Vector Parameters
 l VIDEO_FILENAME - specifies the full path and filename or URL for a video file to associate
 with the layer. This video can then be displayed for selected point or line features with a
 video timestamp.
 l LAYER_FLAGS - specifies various options for the layer (like mesh/3D model display
 options). This is a bit-mask field that can be specified as an integer or hex number (i.e.
 0x3). To build the value, simply add each of the numeric options for the flags you want
 - 65 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
 and then store that number (or convert to hex notation - 0xXXX):
 l 1 - Mesh Display - Wireframe Only - If 1 is added to the value, display textured or
 colored mesh (3D model) features only using a wireframe (i.e. do not fill them).
 l 2 - Mesh Display - No Wireframe on Zoom - If 2 is added to the value, tex-
 tured/filled mesh (3D model) features will NOT display a wireframe over the color
 display when zoomed in far enough that the triangles are large.
 l 4 - Mesh Display - Don't Interpolate Textures - If 4 is added to the value, nearest
 neighbor rather than bilinear interpolation will be used when sampling the texture
 for a mesh (3D model). This is slightly faster, but will result in pixelated display
 when zoomed in.
 l USE_LEGACY_IMPORTER - For TYPE=DXF files only. If USE_LEGACY_IMPORTER=YES is spe-
 cified the DXF file will be loaded using the legacy import method.
 - 66 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
 elevation.
 l ELEV - color by elevation of the point using the current elevation shader.
 ity value when using the INTENSITY draw mode option. If this parameter is
 provided with an empty value the terrain shader selected on the main tool-
 bar will be used.
 l CLASS - color by the point classification
 use when using the BY_LAYER draw mode option. If not specified, automatic
 color assignment will be used when coloring by source layer.
 l POINT_INDEX - color by the index of the point in the cloud
 return
 l CIR - color as color infrared if NIR band present
l SORT_LIDAR - specifies if a Lidar point cloud format should spatially sort the data
 on load for better performance. This will override any sort settings from the LOAD_
 FLAGS parameter. The following values are supported
 l AUTO - spatially sorts the point cloud data only if it is determined to be
 poorly sorted
 l YES - always spatially sort the point cloud data.
 - 67 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
 l LIDAR_POINT_SIZE - specifies how large the points in a Lidar point cloud are drawn. The
 default value of 0 will automatically scale the points to be larger as you zoom in on them.
 Specify a fixed number to always draw them at a particular size in pixels.
 l LIDAR_DRAW_QUALITY - specifies the quality setting (0-100) for drawing the Lidar point
 cloud. Larger values draw a larger fraction of the points when zoomed out, but the draw
 will take longer to complete.
 l LIDAR_FILTER - specifies a comma-separated list of Lidar class numbers to enable or dis-
 able for load. Provide a minus sign (-) to remove the type from the filter rather than add
 it. The filter starts off with nothing in it if you provide a LIDAR_FILTER string, but you can
 add ALL to enable everything or NONE to clear the filter, then add or remove stuff after
 that. For example, to specify a class filter with only types 2 and 3 enabled, use LIDAR_
 FILTER="NONE,2,3". To get one with everything but classes 2 and 3, use LIDAR_
 FILTER="ALL,-2,-3".
 l LIDAR_RETURN_FILTER - specifies a comma-separated list of Lidar return types to enable
 or disable for load. Provide a minus sign (-) to remove the type from the filter rather than
 add it. The filter starts off with loading everything, but you can add ALL to enable
 everything or NONE to clear the filter, then add or remove stuff after that. For example,
 to specify a return filter with only unknown and first returns, use LIDAR_RETURN_
 FILTER="NONE,0,1". To get one with everything but the first return, use LIDAR_
 RETURN_FILTER="ALL,-1". The numeric values have the following meanings:
 l 0 - Unknown Returns
l 1 - First Return
l 2 - Second Return
l 3 - Last Return
l 4 - Single Return
 - 68 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT
 - 69 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT_ARCHIVE
SAMPLES
IMPORT FILENAME="P:\21989\input.tif" TYPE="GEOTIFF" \
FEATHER_BLEND_EDGES="64" \
FEATHER_BLEND_POLY_FILE="P:\21989\test.shp" \
FEATHER_BLEND_SIZE="4" \
POLYGON_CROP_USE_ALL=YES
IMPORT FILENAME="C:\data\Gardiner\LiDAR_Elevation.dem" \
TYPE="USGS_DEM" BAND_RANGE="38.700000763,113.900001526,ALL,0" \
SAMPLING_METHOD="BILINEAR" ELEV_UNITS="METERS"
IMPORT_ARCHIVE
The IMPORT_ARCHIVE command imports a data file from a .tar.gz archive for later use. The
only time you should ever need to use the IMPORT_ARCHIVE command is when you only want
to load some of the data inside a .tar.gz archive. For the typical case of just loading everything
in an archive, use the IMPORT command with AUTO as the value for the TYPE parameter. The
following parameters are supported by the command:
 l ARCHIVE_FILENAME - full path to the archive file to load the data from
 l FILENAME - filename to load from the archive. You can include wildcard characters like '*'
 and '?' in the value to match on multiple files.
 NOTE: All other parameters that are supported by the IMPORT command are also sup-
 ported by this command.
 - 70 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT_ASCII
IMPORT_ASCII
The IMPORT_ASCII command imports data from a generic ASCII text file for later use. The fol-
lowing parameters are supported by the command. In addition, all of the option parameters for
the IMPORT command are also supported for this command.
 l FILENAME - full path to file to load the data from. This can also be the URL (http: or ftp
 for a file on a web site that you want Global Mapper to download and load). Wildcards
 ('*' or '?')can be included to load all files matching a particular mask.The name of a pre-
 viously defined file from DEFINE_TEXT_FILE can also be used.
 l SOURCE_URL - specifies the URL of the file on the server. If the file specified by
 FILENAME is not found and there is a SOURCE_URL, the file is downloaded from the URL
 and saved to the FILENAME location.
 l TYPE - type of import that we're doing
 l POINT_ONLY - all lines with coordinate data will result in a new point object begin
 created
 l POINT_AND_LINE - both point and line features (and optionally areas) will be cre-
 ated from coordinate data in the file. Line features will be created when coordinate
 data lines are back to back in the file. All individual coordinate lines will result in a
 point object being created
 l AREA_ONLY - only closed area features will be created from the sequences of
 coordinates.
 l ELEVATION - all lines in the file with 3 coordinate values (x,y, and elevation) will be
 used to create an elevation grid. The data will be triangulated and gridded auto-
 matically, resulting in a fully usable elevation grid that can be exported to any of
 the supported elevation data formats.
 l LIDAR - all 3D points in the file are added to a Lidar point cloud. You can load a .xyzi
 file to also add the intensity. Use the LIDAR_CLASS parameter to specify a numeric
 classification to apply to all points, like LIDAR_CLASS=2 to assign as ground shot
 points.
 l DIST_BEARING - all lines contain a distance and bearing from some other point loc-
 ation provided using the START_POS parameter. This will create point features. You
 should also provide a COORD_ORDER parameter with a custom definition for the
 column locations. The distances should be in meters and the bearings in degrees
 relative to north.
 l DIST_BEARING_LINE - all lines contain a distance and bearing for a segment of a
 line. The line starts at the point location provided using the START_POS parameter.
 This will create a single line feature. You should also provide a COORD_ORDER para-
 meter with a custom definition for the column locations. The distances should be in
 meters and the bearings in degrees relative to north.
 l DIST_BEARING_SEGS - all lines contain a distance and bearing for a segment of a
 line. For each line in the file, a line will be created that starts at the point location
 provided using the START_POS parameter. You should also provide a COORD_
 - 71 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT_ASCII
 ORDER parameter with a custom definition for the column locations. The distances
 should be in meters and the bearings in degrees relative to north.
l COORD_DELIM - specifies the delimiter between coordinates in coordinate lines
 l AUTO - automatically detect the delimiter type (default)
l WHITESPACE - coordinates are separated with one or more space and/ or tab char-
 acters
 l COMMA - coordinates are separated by commas
l COORD_FORMAT - specifies the format of the coordinate values. The default is DECIMAL.
 l DECIMAL - standard numerical value. No extra values are packed into one.
l DDMMSS - degree coordinates are stored as the number of degrees times 10,000
 plus the minutes times 100 plus the seconds. So for example 35 deg 15 min and
 12.3 seconds would look like 351512.3.
 l DDMM - degree coordinates are stored as the number of degrees times 100 plus
 the minutes. So for example 35 deg 15.2 min would look like 3515.2.
 l DD_MMSS - degree coordinates are stored as DD.MMSS (i.e. degrees + ( minutes /
 100 ) + ( seconds / 10000 ). So for example 35 deg 15 min and 12.3 seconds would
 look like 35.15123.
 l ECEF - the XYZ coordinates represent ECEF (Earth-Centered Earth-Fixed) coordin-
 ates. They actual values are the same as the DECIMAL format. The ECEF coordin-
 ates will be converted to lat/lon degrees using the ellipsoid implied by the
 projection datum, then converted to whatever projection is specified.
l COORD_ORDER specifies the order of the coordinates in coordinate lines
 l X_FIRST - x coordinates (i.e. easting or longitude) come first, followed by y coordin-
l CUSTOM - specifies a custom column layer. The columns are specified as 1-based
 numbers (i.e. first column is 1, not 0). The values should be specified as
 "CUSTOM,x_col,y_col[,z_col][,time_col]", or for DIST_BEARING as "CUSTOM,dist_
 col,bearing_col[,z_col]". So for example if the X/longitude is in column 3, the Y/lat-
 itude in column 4, and the Z in the first column, use "CUSTOM,3,4,1". If you
 need to specify that an optional colulmn isn't present, use -1 for that column. For
 example if you have an X,Y,time file, use "CUSTOM,1,2,-1,3".
l COORD_PREFIX - if present, this line is used to specify what special character sequence
 coordinate lines start with. For example, if the coordinate lines in the file started with the
 character sequence "XY,", you should use COORD_PREF="XY,". By default no coordin-
 ate prefix is assumed.
 - 72 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT_ASCII
l INC_COORD_LINE_ATTRS - set the value of this parameter to YES if you wish to use any
 leftover text at the end of coordinate lines as attributes for the feature the coordinates
 are in. This could be useful if elevation data is present at the end of the lines. By default,
 the value of this attribute is NO.
l INC_ELEV_COORDS - this parameter controls whether or not the value right after the 2nd
 coordinate column (if there is one) will be treated as an elevation value. Use INC_ELEV_
 COORDS=YES or INC_ELEV_COORDS=NO to enable (the default) or disable this behavior.
l NO_DATA_VAL - specifies what Z value to treat as 'no data' when loading and gridding
 data with a Z component. If not specified, a default of -999999 will be used. This value
 should be specified in the native units of the file.
l VOID_ELEV - specifies a value to replace any void / no data pixels with when loading as a
 grid. This will give no data values the specified numeric value, instead of treating them as
 null. For example VOID_ELEV=0 will replace no data values (default value of -999999, or
 otherwise specified with NO_DATA_VAL parameter) with a pixel value of 0.
l COL_HEADERS - controls whether or not the first line of the file should be used as column
 headers for coordinate line attributes later in the file. Setting this to YES is useful for
 things like CSV files with column headers in the first row, otherwise set it to NO (the
 default).
l SKIP_COLUMNS - specifies the number of columns (fields) to skip at the start of a coordin-
 ate line before trying to read the coordinates. For example, if the X and Y coordinates of a
 line were in the 3rd and 4th columns of the coordinate line, you'd use a value of SKIP_
 COLUMNS=2. The default value is 0, meaning that coordinates must be in the first two
 columns.
l SKIP_ROWS - specifies the number of rows to skip at the start of a file before trying to
 read any data. For example, if your file has a fixed header of 20 lines, you would use
 SKIP_ROWS=20 to skip those header rows.
l COORD_PAIRS_PER_ROW - specifies the number of coordinate pairs (XY + optional Z and
 time) that are on each line of the file. If specified the value must be at least 1. Use this to
 load line or area features from files that have 2 or more coordinate pairs on each line of
 the file. The pairs are assumed to be sequential, so if you have 3 XYZ coordinate pairs on
 a line and the first 2 fields are attributes, use SKIP_COLUMNS=2 COORD_PAIRS_
 PER_ROW=3 to get a triangle from each line in the format attr1,at-
 tr2,x1,y1,z1,x2,y2,z2,x3,y3,z3.
l BREAK_COL_IDX - specifies the 1-based index of the column to break features at if the
 value in that column changes.
l BREAK_COL_PEN_UP - specifies that the "break on change column" from the BREAK_
 COL_IDX parameter is actually a pen up/down field and new features should be started
 when a 1 is encountered in the field. Use BREAK_COL_PEN_UP=YES to enable.
l CREATE_AREAS_FROM_LINES - controls whether or not area features will be created
 from closed line features (first and last point the same) if no CLOSED attribute was spe-
 cifically provided for the feature.
 - 73 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT_ASCII
 l COORD_OFFSET - specifies the offset to apply to any coordinates read in from the file.
 This offset will be added to each coordinate read in from the file. The offset should be
 specified as a comma-delimited list of the X, Y, and Z offsets, such as COORD_OFFSET-
 T=100000.0,200000.0,0.0
 l COORD_SCALE - specifies the scale factor to apply to any coordinates read in from the
 file. Each coordinate will be multiplied by these scale factor after being read in from the
 file. The scale factors should be specified as a comma-delimited list of the X, Y, and Z
 scale factors, such as COORD_SCALE=0.1,0.1,1.0
 l NO_DATA_DIST_MULT - specifies how far from an actual data point a grid cell has to be
 before it is treated as a no data value. This number is given as a multiple of the diagonal
 size of a single grid cell as nominally determined by the gridding algorithm or specified
 with the SPATIAL_RES parameter. A value of 0 means that all points should be considered
 as valid.
 l SPATIAL_RES - specifies spatial resolution to use when generating an elevation grid from
 the data. Defaults to a good value for maintaining the full spatial resolution of the
 provided point data if not specified. Should be formatted as x_resolution,y_resolution.
 The units are the units of the projection specified for the file. For example, if UTM with
 meter units was the file projection and you wanted to export at 30 meter spacing, the
 parameter/value pair would look like SPATIAL_RES=30.0,30.0.
 l SPATIAL_RES_METERS - specifies spatial resolution to use in meters. The value in meters
 will automatically be converted to the curent view/export projection units. For example,
 to do an export at 2.0 meter spacing (or as close as you can get to that in the current
 units), use SPATIAL_RES_METERS=2.0, or to do an export at 1.0 meters in X by 1.5
 meters in Y, use SPATIAL_RES_METERS="1.0,1.5".
 l SHEET_NAME - when loading an Excel format file, specifies the name of the sheet to
 load. If not provided, the first sheet in the file will be loaded
 - 74 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT_CLOUD
SAMPLE
IMPORT_ASCII FILENAME="C:\data\ASCII Files\usvi_landmark.asc" \
 TYPE=POINT_AND_LINE COORD_DELIM=AUTO COORD_ORDER=X_FIRST \
 COORD_PREFIX="XY,"INC_COORD_LINE_ATTRS=NO PROJ=
IMPORT_CLOUD
The IMPORT_CLOUD command imports data from a cloud dataset, including Amazon S3
account. The following parameters are supported by the command.
 l FILENAME - Name of the file when it is downloaded
 l CLOUD_TYPE - Cloud type, currently only AWS is supported "Amazon's AWS S3"
 l CLOUD_KEY1 - first access key, for AWS S3 this is the Public Key
 l CLOUD_KEY2 - second access key, for AWS S3 this is the Private Key
 l CLOUD_FOLDER - folder where file exists in the cloud, for AWS S3 this is the bucket
 l CLOUD_LOCATION - location where folder exists, for AWS S3 this is region
 l CLOUD_FILE - the name of the file as it exists in the cloud.
EXAMPLE
IMPORT_CLOUD FILENAME="C:\data\bilbo.shp" TYPE="SHAPEFILE" \
ELEV_UNITS="METERS" LABEL_FIELD_FORCE_OVERWRITE="YES" LABEL_FIELD_SEP="0x20" LABEL_FIELD="NAME"
\
CODE_PAGE="0" CLOUD_TYPE="Amazon's AWS S3" CLOUD_KEY1="AAAAAAAAAAAAAAAAAAAA" \
CLOUD_KEY2="AAAA+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" \
CLOUD_FOLDER="bmg-billingbucket" CLOUD_LOCATION="us-east-1" CLOUD_FILE="bilbo.shp"
IMPORT_DIR_TREE
The IMPORT_DIR_TREE command imports all of the data files in a given directory tree that
match a list of filename masks. The following parameters are supported by the command. In
addition, all of the option parameters for the IMPORT command are also supported for this
command.
 l DIRECTORY - full path to root of directory tree to import files from.
 l FILENAME_MASKS - space-separated list of filename masks to import. If no value is
 provided then all files which are of recognized types will be imported.
 l RECURSE_DIR - specifies whether the search for matching files will recurse in to sub-
 folders. The default is RECURSE_DIR=YES. Use RECURSE_DIR=NO to only search in the spe-
 cified folder.
SAMPLE
 IMPORT_DIR_TREE DIRECTORY="C:\TEMP\EXPORT TEST" FILENAME_MASKS="*.OPT *.GMP"
 - 75 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 DEFINE_SDB_CONNECTION
DEFINE_SDB_CONNECTION
The DEFINE_SDB_CONNECTION allows the user to define a connection and use that definition
in the script. This is required for enterprise spatial databases that require a defined connection,
but is not needed for exporting to a file-based spatial database such as Esri Personal Geodata-
base or Spatialite/SQLite.
Using the SAVE_CONNECTION parameter will cause this definintion to be stored with the con-
nections defined using the Connection Manager.
 l SDB_CONNECTION_NAME - The name of the connection. This is used to identify the con-
 nection in a subsequent EXPORT_VECTOR or IMPORT_SPATIAL_DB command.
 l TYPE - Spatial DB Type Name, one of:
 l ESRI_ARCSDE - Esri ArcSDE Geodatabase
l POSTGIS - PostGIS/PostgreSQL
SAMPLE
DEFINE_SDB_CONNECTION TYPE="POSTGIS" SDB_CONNECTION_NAME="PostGIS" \
 SDB_SERVER="myserver" SDB_PORT="5432" SDB_DATABASE_NAME="mydb" \
 SDB_SAVE_USER_AND_PASSWORD="YES" SDB_USER_NAME="pguser" \
 SDB_PASSWORD="pgpassword" SAVE_CONNECTION=YES
 - 76 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT_SPATIAL_DB
IMPORT_SPATIAL_DB
The IMPORT_SPATIAL_DB command allows the user to import spatial data from a spatial data-
base. The database can be either a file-based spatial database or a connection-based spatial
database.:
 l TYPE - File-Based Spatial Databases (Using these TYPE values requires that the SDB_
 CONNECTION_FILE parameter also be specified to identify the spatial database to be
 used.)
 l SPATIALITE - Spatialite/SQLite
 l TYPE - Connection-Based Spatial Databases (Using these type values requires that the
 SDB_CONNECTION_NAME parameter also be specified to identify the connection to be
 used.)
 l ESRI_ARCSDE - Esri ArcSDE Geodatabase
l POSTGIS - PostGIS/PostgreSQL
 l LAYER_BOUNDS_EXPAND - specifies that the operation should expand the used LAYER_
 BOUNDS bounding box by some amount. The amount to expand the bounding rectangle
 by should be specified in the current global projection. For example, if you have a UTM/-
 meters projection active and want to expand the bounds retrieved from the LAYER_
 BOUNDS parameter by 100 meters on the left and right, and 50 meters on the top and
 bottom, you could use LAYER_BOUNDS_EXPAND="100.0,50.0". You can also spe-
 cify a single value to apply to all 4 sides, or supply 4 separate values in the order
 left,top,right,bottom.
SAMPLES
IMPORT_SPATIAL_DB TYPE="POSTGIS" SDB_CONNECTION_NAME="PostGIS" \
 SDB_TABLE_NAME="public.canada" SDB_IMPORT_BOUNDS="-126.821609,26.773888,-106.597575,50.302504"
IMPORT_OSM_TILE
The IMPORT_OSM_TILE command imports a tiled online layer using the OSM, TMS, Google
Maps, or Bing Maps tile schema. The following parameters are supported by the command:
 l NOTE: All style parameters that are supported by the IMPORT command are also sup-
 ported by this command.
 l OSM_BASE_URL - URL to base of tile source. Can include custom URL variables like %z,
 %x, %y, or %quad (for Bing-style naming) for defining exactly how the request URL
 should look. See the add online source dialog for more information and a sample of a cus-
 tom URL.
 l OSM_DESC - description to use for the source
 l OSM_FILE_EXT - file extension for tiles, like PNG, JPG, or GMG (for terrain).
 l OSM_NUM_ZOOM_LEVELS - specifies the number of the maximum zoom level for the
 source. Note if this is a built-in source you don't need to provide this, just leave it off and
 the default will be used.
 l TILE_SIZE - specifies the size in pixels of each tile. For example if the source uses 512x512
 tiles, add TILE_SIZE=512. The default is 256.
 l DETAIL_MULT - specifies the detail scale to use when deciding while zoom level to get for
 the source. The calculated draw/export resolution is divided by this value to get the res-
 olution to access the data at. For example, a value of DETAIL_MULT=0.5 means the
 source will be displayed from twice the detail it normally would, while DETAIL_MULT=2
 would pull at half the resolution (i.e. much faster access).
 l LEVEL0_TILECOLS - Number of tile columns across the lowest zoom level. By default this
 is 1 for a single tile covering the entire world.
 - 78 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT_OSM_TILE
 l LEVEL0_TILEROWS - Number of tile rows at the lowest zoom level. By default this is 1 for
 a single tile covering the entire world.
 l SAMPLE_TYPE - Specifies the format of samples in BIL files for a terrain-based layer. Typ-
 ical values will be F32 for 32-bit floats, S32 for 32-bit signed integer, or S16 for 16-bit
 signed integer.
l VWORLD_DEM - VWorld DEM terrain in BIL tiles, tiles increase from bottom up
 - 79 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT_WMS
 cify a single value to apply to all 4 sides, or supply 4 separate values in the order
 left,top,right,bottom.
SAMPLE
Here is an example of an IMPORT_OSM_TILE command that pulls in MapQuest OpenStreetMap
data within 5 km of Blue Marble's headquarters:
 IMPORT_OSM_TILE OSM_BASE_URL="http://otile1.mqcdn.com/tiles/1.0.0/osm/" OSM_DESC="MapQuest
OpenStreetMap Worldwide Street Maps" \ \
 OSM_FILE_EXT="png" OSM_NUM_ZOOM_LEVELS="19" ADDRESS="77 Water St, HALLOWELL, ME" RADIUS="5" \
 CENTER_LABEL="Blue Marble Geographics" CENTER_LABEL_POS="-69.7908786,44.2859022"
IMPORT_WMS
The IMPORT_WMS command imports a chunk of WMS or WMTS (tiled WMS) data, such as
satellite imagery or topographic maps. The following parameters are supported by the com-
mand:
 l SOURCE_DESC - text description of source. Should match name from the online source
 dialog. Used to match to a source in the source list if no match based on URL could be
 found.
 l WMS_SERVER_URL - URL to WMS server GetCapabilites
 l WMS_SERVICE - service name to use, typically WMS
 l WMS_LAYER - name of WMS layer to load
 l WMS_IS_TILED - specifies that the server is a WMTS (tiled WMS) service. Use WMS_IS_
 TILED=YES to enable.
 l WMTS_DIM_VAL - specifies the value to use for a dimension parameter on the WMTS
 source, like a 'Time' parameter. The format of the parameter is WMTS_DIM_VAL-
 L="param=value", like WMTS_DIM_VAL="Time=2020-11-15" so specify the value of the
 'Time' dimension. If the source has multiple dimension parameters, you can use multiple
 WMTS_DIM_VAL parameters with a single IMPORT_WMS command.
 l ADDRESS - address to download data near. Use along with RADIUS to specify the bounds
 with an address and radius rather than a specific bounding box.
 l RADIUS - radius in kilometers around ADDRESS to search.
 l LAT_LON_BOUNDS - specifies the bounds to import in latitude/longitude degrees. There
 should be 4 values in a comma-delimited list following the parameter name. The values
 should be in order of west-most longitude, southern-most latitude, eastern-most lon-
 gitude, northern-most latitude.
 l LAYER_BOUNDS - specifies that the import should use the bounds of the loaded layer(s)
 with the given filename. For example, to import to the bounds of the file "c:\test.tif", you
 would use LAYER_BOUNDS="c:\test.tif". Keep in mind that the file must be cur-
 rently loaded.
 l LAYER_BOUNDS_EXPAND - specifies that the operation should expand the used LAYER_
 BOUNDS bounding box by some amount. The amount to expand the bounding rectangle
 - 80 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT_REST_FEATURES
 by should be specified in the current global projection. For example, if you have a UTM/-
 meters projection active and want to expand the bounds retrieved from the LAYER_
 BOUNDS parameter by 100 meters on the left and right, and 50 meters on the top and
 bottom, you could use LAYER_BOUNDS_EXPAND="100.0,50.0". You can also spe-
 cify a single value to apply to all 4 sides, or supply 4 separate values in the order
 left,top,right,bottom.
 l DETAIL_MULT - specifies the detail scale to use when deciding while zoom level to get for
 the source. The calculated draw/export resolution is divided by this value to get the res-
 olution to access the data at. For example, a value of DETAIL_MULT=0.5 means the
 source will be displayed from twice the detail it normally would, while DETAIL_MULT=2
 would pull at half the resolution (i.e. much faster access).
 l NOTE: All style parameters that are supported by the IMPORT command are also sup-
 ported by this command.
SAMPLE
Here is an example of an IMPORT_WMS command that pulls in NAIP imagery within 5 km of
Blue Marble's headquarters:
 IMPORT_WMS WMS_SERVER_URL="http://isse.cr.usgs.gov/arcgis/services/Combined/USGS_EDC_Ortho_
NAIP/MapServer/WMSServer"\ \
 WMS_SERVICE="WMS" WMS_LAYER="0" ADDRESS="397 WATER ST, GARDINER, ME" RADIUS="5" \
 LAYER_DESC="NAIP Color Imagery for US (1m Resolution)"
IMPORT_REST_FEATURES
The IMPORT_REST_FEATURES command is used to import vector features from a REST data
source. Since it is an import command, it uses the common labeling and style parameters. The
following required parameters are specific to the IMPORT_REST_FEATURES command:
 l SOURCE_DESC - text description of source. Should match name from the online source
 dialog. Used to match to a source in the source list if no match based on URL could be
 found.
 l SOURCE_TYPE - indicates the type of data being downloaded. This parameters must be
 SOURCE_TYPE="REST_Features"
 l BASE_URL - the URL for the REST data source. This is the same URL that would be used to
 create a new online data source in the Connect to Online Sources dialog.
 l NAME - the layer description of the layer for the downloaded features.
 l ADDRESS - address to download data near. Use along with RADIUS to specify the bounds
 with an address and radius rather than a specific bounding box.
 l RADIUS - radius in kilometers around ADDRESS to search.
 l LAT_LON_BOUNDS - specifies the bounds to import in latitude/longitude degrees. There
 should be 4 values in a comma-delimited list following the parameter name. The values
 - 81 -
 Global Mapper Scripting Reference Section 6: Import/ Open Data
 IMPORT_REST_FEATURES
SAMPLE
Here is an example of an IMPORT_REST_FEATURES command that pulls in TIGERLine spatial
census data:
IMPORT_REST_FEATURES CLAMP_TO_BOUNDS="YES" LAT_LON_BOUNDS="-70.055,43.872,-69.850,44.019" \
SOURCE_TYPE="REST_Features" BASE_
URL="https://tigerweb.geo.census.gov/arcgis/rest/services/Basemaps/CommunityTIGER/MapServer/24"
\
NAME="Counties
 - 82 -
 Global Mapper Scripting Reference Section 7: Layer Management
 COPY_LAYER_FILES
Layer Management
 COPY_LAYER_FILES 83
 GENERATE_LAYER_BOUNDS 84
 SET_LAYER_OPTIONS 84
 SHIFT_LAYER 98
 QUERY_LAYER_METADATA 100
 UNLOAD_ALL 101
 UNLOAD_LAYER 101
 SPLIT_LAYER 102
 SORT_LAYERS 102
 EDIT_MAP_CATALOG 103
COPY_LAYER_FILES
The COPY_LAYER_FILES command copies the base files for one or more layers to a new folder
on disk. Support is included for maintaining folder structures if a BASE_DIR parameter is
provided. If you specify layers that were loaded from .zip or .tar.gz archives, the archive file
itself will be copied and not the individual extracted files. If you specify a file with supporting
files with the same base name (i.e foo.tfw and foo.prj with foo.tif loaded) they will also be
copied.
The following parameters are used by the COPY_LAYER_FILES command.
 l FILENAME - filename or description of layer(s) to copy the files for. This can include * and
 ? wildcard characters. If you leave the FILENAME parameter off then all loaded layers will
 have their files copied, which is the same behavior as using FILENAME="*". This para-
 meter can be listed more than once to specify multiple input files, like FILENAME-
 E="FILENAME_1" FILENAME="FILENAME_2".
 l TARGET_DIR - specifies the folder where the files will be copied to. If no BASE_DIR para-
 meter is provided, the files will all be copied directly to the specified folder.
 l BASE_DIR - specifies a starting string for the layer files being copied beyond which
 everything should be treated as relative. For exampling if copying a file at "c:\data\my_
 dems\colorado\denver.dem" to a TARGET_DIR of "c:\new_dems" with a BASE_DIR value
 of "c:\data\my_dems" you would get "c:\new_dems\colorado\denver.dem" as the new
 filename.
 l OVERWRITE_EXISTING - specifies that existing files should be overwritten. The default is
 OVERWRITE_EXISTING=YES, so use OVERWRITE_EXISTING=NO to skip files that already
 exist in the destination location.
SAMPLE
GLOBAL_MAPPER_SCRIPT VERSION="1.00"
/* Copy all loaded layer files to a new folder */
 - 83 -
 Global Mapper Scripting Reference Section 7: Layer Management
 GENERATE_LAYER_BOUNDS
GENERATE_LAYER_BOUNDS
The GENERATE_LAYER_BOUNDS command create a new layer with a single bounding box area
created from the bounding box of each loaded layer or a polygonal coverage of the valid data in
the layer if specified by the BOUNDS_TYPE parameter:
 l LAYER_DESC - specifies the description to use the for created layer
 l FILENAME - filename of the layer to generate bounds for. If an empty value is passed in,
 all layers that were created by the script, such as those from a GENERATE_CONTOURS
 command, will have bounds created for. This parameter can be listed more than once to
 specify multiple input files, like FILENAME="FILENAME_1" FILENAME-
 E="FILENAME_2". When running the script in the context of the main map view
 (including loading a workspace) you can also pass in the value 'USER CREATED
 FEATURES' to have the 'User Created Features' layers unloaded or 'SELECTED LAYERS' to
 have any layers selected in the Control Center unloaded. You can also pass in the full
 description of the loaded layer to use in case you want to process a layer not loaded
 from a file. If you do not provide a FILENAME parameter then all loaded layers will have
 their bounds generated.
 l BOUNDS_TYPE - specifies whether to create bounding box or polygon coverages. The
 following values are supported:
 l BOUNDS - (default) A bounding box in the native projection of the layer is cre-
 ated.
 l POLYGON - A coverage polygon is calculated covering the features/valid data in
 the layer
 l RECT_ONLY - This is the same as the BOUNDS value, except the bounding box is in
SET_LAYER_OPTIONS
The SET_LAYER_OPTIONS command sets the display options for one of more loaded layers.
These are the options that you would normally supply when importing a layer. The following
parameters are supported by the command. In addition, all of the option parameters for the
IMPORT command are also supported for this command.
 - 84 -
 Global Mapper Scripting Reference Section 7: Layer Management
 SET_LAYER_OPTIONS
 l FILENAME - full path or description of loaded layer to set the options for. This can include
 wildcard characters like '*'. If you specify an empty filename then all layers that have no
 filename, like generated contours, will be matched. If you leave of the FILENAME para-
 meter entirely or use a '*' wildcard (like FILENAME="*") then all loaded layers will be
 updated. If you want layers only in some groups, you can add <sub> to the FILENAME. For
 example, to match all layers in the layer group 'Line Group', use FILENAME="Line
 Group<sub>*". When running the script in the context of the main map view (including
 loading a workspace) you can also pass in the value 'USER CREATED FEATURES' to have
 the 'User Created Features' layer updated or 'SELECTED LAYERS' to have any layers selec-
 ted in the Control Center.
 - 85 -
 Global Mapper Scripting Reference Section 7: Layer Management
 SET_LAYER_OPTIONS
 set in an individual feature, in which case it overrides the layer setting. The following val-
 ues are supported:
 l UNSPECIFIED - Altitude mode is determined by either the setting in the feature, or
l CLAMP_TO_SEA_FLOOR - ignore z-values, and clamp the feature to the sea floor
l ZOOM_DISPLAY - specifies when the map should be displayed and when it should be hid-
 den based on the display zoom scale. This command will be formatted as a name from
 the list, below followed by 2 numeric paramters. For example, use ZOOM_DISPLAY-
 Y="SCALE,25000,0" to have a map display only when zoomed in below 1:25000
 scale.
 l ALWAYS - always display the map. The numeric parameters are ignored.
l PERCENT - display the map when the map bounding box is a certain percentage of
 - 86 -
 Global Mapper Scripting Reference Section 7: Layer Management
 SET_LAYER_OPTIONS
Elevation Parameters
Parameters for display and interpretation of elevation values in terrain layers. See also Raster
Parameters below for additional shared parameters.
 l ELEV_FIELD - specifies the name of the attribute field to use as the elevation value for the
 vector features in a file
 l ELEV_UNITS - specify elevation units to use for this file if it contains gridded elevation
 data and also for vector feature elevations that don't have a unit embedded in the elev-
 ation value. Valid values are as follows:
 l FEET - elevations in US feet
 - 87 -
 Global Mapper Scripting Reference Section 7: Layer Management
 SET_LAYER_OPTIONS
l ELEV_OFFSET (elevation only) - specifies the offset in meters to apply to each elevation
 value in the layer. This allows you to vertically shift a layer to match other layers.
l ELEV_POWER (elevation only) - specifies the power value to apply to each elevation value
 in the layer. For example a value of 2.0 would square each elevation value before apply-
 ing a scale and adding the offset. Default to 1.0 (no power).
l ELEV_SCALE (elevation only) - specifies the scale value to apply to each elevation value in
 the layer. This allows you to vertically scale a layer to match other layers. Default to 1.0
 (no scaling).
l MIN_ELEV (elevation only) - specifies the minimum elevation (meters) to treat as valid
 when rendering this layer. Any elevations below this value will be treated as invalid and
 not be drawn or exported.
l MAX_ELEV (elevation only) - specifies the maximum elevation (meters) to treat as valid
 when rendering this layer. Any elevations above this value will be treated as invalid and
 not be drawn or exported.
l CLAMP_ELEVS (elevation only) - if a MIN_ELEV and /or MAX_ELEV value is specified, set-
 ting this to YES will make any valid elevation values outside of the specified range be
 clamped to the new range value rather than treated as invalid.
l VOID_ELEV (elevation only) - specifies the elevation (meters) to replace any void areas in
 the layer with. If not specified, the void areas will be transparent.
l SHADER_NAME (elevation only) - this sets the name of the shader to use when rendering
 the gridded elevation data for this layer. Use this to override use of the shared default
 shader just for this layer. This must be one of the names displayed in the shader drop
 down in Global Mapper, such as "Atlas Shader" or "Global Shader" or the name of a cus-
 tom shader.
l BAND_RANGE - specifies the range of valid values found in a gridded layer. It can option-
 ally also specify how and how to determine what values are no-data values. If not spe-
 cified, these values will be automatically determined from the data. The format is a
 comma-delimited list of values like BAND_RANGE="min_valid,max_valid,band_validity_
 type,check_invalid_float,band_valid_val_1,band_valid_val_2". The _band_valid_val_1_
 and _band_valid_val_2_ values are optional and depend on the _band_validity_type_
 value. The individual values are:
 l min_valid - minimum valid value for grid cell samples
 - 88 -
 Global Mapper Scripting Reference Section 7: Layer Management
 SET_LAYER_OPTIONS
Raster Parameters
Parameters for display of imagery. Some of the below parameters are also supported for elev-
ation layers.
 l SAMPLING_METHOD (elevation and raster only) - specifies the sampling method to use
 when resampling this layer.
 The following values are supported
 l NEAREST_NEIGHBOR - use the nearest neighbor sampling method
l MAX_2X2 - use maximum value found in 2x2 box (for image layers, use brightest
 color)
 l MAX_3X3 - use maximum value found in 3x3 box (for image layers, use brightest
 color)
 l MAX_4X4 - use maximum value found in 4x4 box (for image layers, use brightest
 color)
 l MAX_5X5 - use maximum value found in 5x5 box (for image layers, use brightest
 color)
 l MAX_6X6 - use maximum value found in 6x6 box (for image layers, use brightest
 color)
 l MAX_7X7 - use maximum value found in 7x7 box (for image layers, use brightest
 color)
 l MAX_8X8 - use maximum value found in 8x8 box (for image layers, use brightest
 color)
 l MAX_9X9 - use maximum value found in 9x9 box(for image layers, use brightest
color)
 - 89 -
 Global Mapper Scripting Reference Section 7: Layer Management
 SET_LAYER_OPTIONS
l MIN_2X2 - use minimum value found in 2x2 box (for image layers, use darkest
 color)
 l MIN_3X3 - use minimum value found in 3x3 box (for image layers, use darkest
 color)
 l MIN_4X4 - use minimum value found in 4x4 box (for image layers, use darkest
 color)
 l MIN_5X5 - use minimum value found in 5x5 box (for image layers, use darkest
 color)
 l MIN_6X6 - use minimum value found in 6x6 box (for image layers, use darkest
 color)
 l MIN_7X7 - use minimum value found in 7x7 box (for image layers, use darkest
 color)
 l MIN_8X8 - use minimum value found in 8x8 box (for image layers, use darkest
 color)
 l MIN_9X9 - use minimum value found in 9x9 box (for image layers, use darkest
 color)
 l BLUR_3X3 - perform a Gaussian Blur using 3x3 kernel
l MULTIPLY
 - 90 -
 Global Mapper Scripting Reference Section 7: Layer Management
 SET_LAYER_OPTIONS
 l SCREEN
 l OVERLAY
l HARD_LIGHT
l COLOR_BURN
l COLOR_DODGE
l DARKEN
l LIGHTEN
l DIFFERENCE
l EXCLUSION
l APPLY_COLOR
l APPLY_COLOR_REVERSE
l KEEP_RED
l KEEP_GREEN
l KEEP_BLUE
l SPOT_NATURAL_COLOR_SPOT_TO_NATURAL
l PSEUDO_NATURAL_COLOR_CIR_TO_NATURAL
l COLOR_TO_GRAYSCALE
 - 91 -
 Global Mapper Scripting Reference Section 7: Layer Management
 SET_LAYER_OPTIONS
 SETUP="0,1,2". Note that not all raster formats support specifying a non-default band
 setup.
l CONTRAST_MODE (raster only) - specifies the type of contrast adjustment to apply to the
 data.
 l NONE - no contrast adjustment applied (this is the default)
 SIZE parameter can be used to override the number of standard deviations from
 the mean to stretch to.
 l MIN_MAX - apply a min/max contrast stretch, stretching the available range of val-
 ues in each color band to the full range of 0-255. For imagery which contains both
 black and white, this will have no affect.
l CONTRAST_SHARED (raster only) - specifies whether or not the contrast adjustment for
 this layer will share the adjustment with other contrast-adjusted layers in order to ensure
 a consistent modification across layers. Use CONTRAST_SHARED=YES to enable contrast
 sharing.
l CONTRAST_STRETCH_SIZE (raster only) - specifies the number of standard deviations
 from the mean to use in a PERCENTAGE contrast adjustment. The default is 2.0.
l AUTO_CONTRAST (raster only) - DEPRECATED, use CONTRAST_MODE instead - specifies
 whether to automatically calculate and apply a 2 standard deviation contrast adjustment
 to the image. Use AUTO_CONTRAST=YES to turn on. Anything else turns it off.
l COLOR_INTENSITY(DEPRECATED use COLOR_INTENSITY_FULL parameter) (elevation and
 raster only). - specifies the color intensity to use when adjusting the brightness of pixels
 in the overlay. Valid values range from 0 to 20, with 0 being completely black, 10 being
 no alteration, and 20 being completely white. For example, to make an image slightly
 darker, you could use COLOR_INTENSITY=7.
l COLOR_INTENSITY_FULL (elevation and raster only) - specifies the color intensity to use
 when adjusting the brightness of pixels in the overlay. Valid values range from 0 to 512,
 with 0 being completely white, 256 being no alteration, and 512 being completely black.
 For example, to make an image slightly darker, you could use COLOR_
 INTENSITY=300. (NOTE: This parameter replaces the COLOR_INTENSITY parameter).
l TEXTURE_MAP (raster only) - specifies that this image should be draped over any elev-
 ation data loaded before it. Use TEXTURE_MAP=YES to turn on. Anything else turns it off.
l PALETTE_NAME (palette-based raster only) - specifies the filename of a recognized
 palette file to override the default colors in this layers palette or a palette previously
 defined with the DEFINE_PALETTE command. Use this to change the color interpretation
 of palette indices.
l TRANSPARENT_COLOR (elevation and raster only) - specifies the color to make trans-
 parent when rendering this overlay. The color should be specified as RGB(<red>,<-
 green>,<blue>). For example, to make white the transparent color, use TRANSPARENT_
 COLOR=RGB(255,255,255). If you do not wish any color to be transparent, do not
 use this parameter. Optionally, if the image that you are making transparent uses a
 palette for the colors, you can specify a palette index in the following format: INDEX(<0-
 - 92 -
 Global Mapper Scripting Reference Section 7: Layer Management
 SET_LAYER_OPTIONS
 based palette index>). For example, to make the second color in the palette transparent,
 use TRANSPARENT_COLOR=INDEX(1).
l TRANSPARENT_COLOR_DIST - for layers that have specified a color to make transparent,
 this parameter allows you to specify how far a color in the layer has to be from the spe-
 cified TRANSPARENT_COLOR value to be treated as transparent as well. The default value
 of 0 means that the colors have to exactly match for the pixel to be treated as trans-
 parent. Larger values (up to 256) allow larger distances between the layer color and the
 transparent color. This is useful for lossy formats, like JPEG.
l COLOR_GRADE (raster only) - specifies the color grading values to use for this layer (as
 configured on the Color Grade options dialog tab). This should be a comma-delimited list
 with the saturation value (from 0-1) first, then the input and output range for the red,
 green, and blue color channels, as follows: COLOR_GRADE=saturation,red_in_start,red_
 in_end,red_out_start,red_out_end,...,blue_out_end
l CLIP_COLLAR (raster only) - specifies whether to clip the collar off of the image. The fol-
 lowing values are supported for cropping:
 l NONE - no collar cropping is performed.
l LAT_LON - crop the collar to a a specified set of bounds specified in arc degrees in
 the native datum of the layer. The bounds should be specified using the CLIP_
 COLLAR_BOUNDS parameter.
 l NATIVE - crop the collar to a specified set of bounds specified in the native pro-
 jection system and datum of the layer. The bounds should be specified using the
 CLIP_COLLAR_BOUNDS parameter.
 l PIXELS - crop a given number of pixels off of each side of the layer. The number of
 pixels to remove from each side should be specified using the CLIP_COLLAR_
 BOUNDS parameter.
 l SNAP_DEGREES - crop the collar by snapping each edge to a specified degree
 boundary specified in arc degrees in the native datum of the layer. The bounds
 should be specified using the CLIP_COLLAR_BOUNDS parameter. For example to
 crop the west and east edges to a half degree boundary and the north and south
 edges to a one degree boundary, use the following: CLIP_COLLAR_BOUNDS-
 S=0.5,1.0,0.5,1.0.
 l POLY - crop to a polygon provided with the CLIP_COLLAR_POLY parameter.
l CLIP_COLLAR_BOUNDS (raster only) - specifies the bounds of the collar to be clipped off
 when the CLIP_COLLAR parameter is enabled. The coordinates should be specified in arc
 degrees, native layer coordinates, or pixel counts as a comma-delimited list going west-
 ,south,east,north. For example, CLIP_COLLAR_BOUNDS=34.25,-
 109.0,34.375,-108.875.
l CLIP_COLLAR_POLY (raster only) - specifies the name of the previously defined shape
 (with the DEFINE_SHAPE command) to crop the layer to when the CLIP_COLLAR=POLY
 parameter is used. The coordinates in the shape must have been defined in the native
 projection system of the layer being loaded. Unless you provide CLIP_COLLAR_POLY_
 - 93 -
 Global Mapper Scripting Reference Section 7: Layer Management
 SET_LAYER_OPTIONS
 SIMPLIFY=NO, the clip polygon will be simplified to 1/10th of a pixel resolution to reduce
 the size of the crop polygon for faster cropping without noticeably changing the shape.
 l CLIP_COLLAR_POLY_EXCLUDE (raster only) - specifies that the crop to the polygon spe-
 cified with CLIP_COLLAR_POLY should keep all parts of the layer outside the crop polygon
 (s) rather than what is inside the polygon(s). Add CLIP_COLLAR_POLY_EXCLUDE=YES to
 enable this behavior.
 l CLIP_COLLAR_POLY_SIMPLIFY - specifies that the clip polygon will be simplified to 1/10th
 of a pixel resolution to reduce the size of the crop polygon for faster cropping without
 noticeably changing the shape. Enabled by default, use CLIP_COLLAR_POLY_
 SIMPLIFY=NO to disable.
 l CLIP_COLLAR_POLY_PIXEL (raster only) - specifies that the coordinates in the crop poly-
 gon from the CLIP_COLLAR_POLY parameter are in pixel relative coordinates for the layer
 rather than in the native system of the layer. Use this if you need to crop a layer to a par-
 ticular boundary in known pixel coordinates. The coordinates will convert to native layer
 coordinates on load.
Vector Parameters
 l VIDEO_FILENAME - specifies the full path and filename or URL for a video file to associate
 with the layer. This video can then be displayed for selected point or line features with a
 video timestamp.
 l LAYER_FLAGS - specifies various options for the layer (like mesh/3D model display
 options). This is a bit-mask field that can be specified as an integer or hex number (i.e.
 0x3). To build the value, simply add each of the numeric options for the flags you want
 and then store that number (or convert to hex notation - 0xXXX):
 l 1 - Mesh Display - Wireframe Only - If 1 is added to the value, display textured or
 colored mesh (3D model) features only using a wireframe (i.e. do not fill them).
 l 2 - Mesh Display - No Wireframe on Zoom - If 2 is added to the value, tex-
 tured/filled mesh (3D model) features will NOT display a wireframe over the color
 display when zoomed in far enough that the triangles are large.
 l 4 - Mesh Display - Don't Interpolate Textures - If 4 is added to the value, nearest
 neighbor rather than bilinear interpolation will be used when sampling the texture
 for a mesh (3D model). This is slightly faster, but will result in pixelated display
 when zoomed in.
 l USE_LEGACY_IMPORTER - For TYPE=DXF files only. If USE_LEGACY_IMPORTER=YES is spe-
 cified the DXF file will be loaded using the legacy import method.
 - 94 -
 Global Mapper Scripting Reference Section 7: Layer Management
 SET_LAYER_OPTIONS
 the label from multiple attributes, separate them with '>+<' in the file, like LABEL_
 FIELD='RD_PREFIX>+<RD_NAME>+<RD_SUFFIX'.
 l LABEL_FIELD_SEP - specifies the attribute separator to use when building a label from
 multiple attributes. This can be any character(s). For example LABEL_FIELD_SEP='-
 ' will insert a dash between each attribute. Use hex codes to add any non-printable char-
 acters, such as LABEL_FIELD_SEP='0x20' to add a space.
 l LABEL_CUSTOM_DEF - specifies a custom free-form string describing how to form the dis-
 play labels for this layer. This can include embedded attribute values as %ATTR_NAME%.
 l LABEL_FIELD_FORCE_OVERWRITE - specifies that the LABEL_FIELD or LABEL_CUSTOM_
 DEF attribute value should be applied to all feature labels, not just those that don't
 already have labels. Use LABEL_FIELD_FORCE_OVERWRITE=YES to enable.
 l SHOW_LABELS - specifies whether or not labels are shown for features in this layer,
 assuming they would be otherwise shown. The default is SHOW_LABELS=YES. Use
 SHOW_LABELS=NO to disable the display of labels for this layer regardless of other set-
 tings.
 l LABEL_PREFIX - specifies the prefix to prepend to attribute-based labels
 l LABEL_SUFFIX - specifies the suffix to append to attribute-based labels
 l LABEL_FORMAT_NUMBERS - specifies whether or not numeric attribute values should
 automatically have formatting applied to them. This is enabled by default. Use LABEL_
 FORMAT_NUMBERS=NO to disable numeric formatting and keep numeric values exactly
 as they are in the attribute list.
 l LABEL_PRECISION - value is an integer indicating the number of decimal digits to use.
 This applies to numeric labels.
 l LABEL_REMOVE_TRAILING_ZEROS - This removes the trailing zeros to the right of the
 decimal place in numeric labels. This can be specified by listing the parameter alone, or
 accepts boolean values.
 l LABEL_USE_SCIENTIFIC_NOTATION - Display the number in scientific notation. This
 accepts boolean values, or can be called by listing the parameter alone.
 elevation.
 l ELEV - color by elevation of the point using the current elevation shader.
 ity value when using the INTENSITY draw mode option. If this parameter is
 provided with an empty value the terrain shader selected on the main tool-
 bar will be used.
 l CLASS - color by the point classification
 - 95 -
 Global Mapper Scripting Reference Section 7: Layer Management
 SET_LAYER_OPTIONS
 use when using the BY_LAYER draw mode option. If not specified, automatic
 color assignment will be used when coloring by source layer.
 l POINT_INDEX - color by the index of the point in the cloud
 return
 l CIR - color as color infrared if NIR band present
l SORT_LIDAR - specifies if a Lidar point cloud format should spatially sort the data
 on load for better performance. This will override any sort settings from the LOAD_
 FLAGS parameter. The following values are supported
 l AUTO - spatially sorts the point cloud data only if it is determined to be
 poorly sorted
 l YES - always spatially sort the point cloud data.
l LIDAR_POINT_SIZE - specifies how large the points in a Lidar point cloud are drawn. The
 default value of 0 will automatically scale the points to be larger as you zoom in on them.
 Specify a fixed number to always draw them at a particular size in pixels.
l LIDAR_DRAW_QUALITY - specifies the quality setting (0-100) for drawing the Lidar point
 cloud. Larger values draw a larger fraction of the points when zoomed out, but the draw
 will take longer to complete.
l LIDAR_FILTER - specifies a comma-separated list of Lidar class numbers to enable or dis-
 able for load. Provide a minus sign (-) to remove the type from the filter rather than add
 it. The filter starts off with nothing in it if you provide a LIDAR_FILTER string, but you can
 add ALL to enable everything or NONE to clear the filter, then add or remove stuff after
 that. For example, to specify a class filter with only types 2 and 3 enabled, use LIDAR_
 FILTER="NONE,2,3". To get one with everything but classes 2 and 3, use LIDAR_
 FILTER="ALL,-2,-3".
l LIDAR_RETURN_FILTER - specifies a comma-separated list of Lidar return types to enable
 or disable for load. Provide a minus sign (-) to remove the type from the filter rather than
 add it. The filter starts off with loading everything, but you can add ALL to enable
 everything or NONE to clear the filter, then add or remove stuff after that. For example,
 to specify a return filter with only unknown and first returns, use LIDAR_RETURN_
 FILTER="NONE,0,1". To get one with everything but the first return, use LIDAR_
 RETURN_FILTER="ALL,-1". The numeric values have the following meanings:
 - 96 -
 Global Mapper Scripting Reference Section 7: Layer Management
 SET_LAYER_OPTIONS
 l 0 - Unknown Returns
 l 1 - First Return
l 2 - Second Return
l 3 - Last Return
l 4 - Single Return
 - 97 -
 Global Mapper Scripting Reference Section 7: Layer Management
 SHIFT_LAYER
 l TRANSFORM_FILENAME - specifies the name of a control point file used to transform the
 coordinates of the imported file. This is different than the GCP_FILENAME in that the file
 defines a mapping of world coordinates to a new set of world coordinates rather than
 pixel coordinates to world coordinates. Each line should be of the format: x_orig,y_
 orig,x_new_y_new
 l GCP_PROJ_FILENAME - specifies the name of the projection (.prj) file that contains the
 projection definition for the projection that the ground control points are provided in.
 Use this if you want to specify control points in a projection other than what you want to
 define as the native projection for the file. Note that you must also explicitly specify the
 name projection of the file using either the PROJ, PROJ_NAME, PROJ_EPSG_CODE or
 PROJ_FILENAME parameters.
 l GCP_PROJ_EPSG_CODE - specifies the EPSG code of the projection that the ground con-
 trol points are provided in. Use this if you want to specify control points in a projection
 other than what you want to define as the native projection for the file. Note that you
 must also explicitly specify the name projection of the file using either the PROJ, PROJ_
 NAME, PROJ_EPSG_CODE or PROJ_FILENAME parameters.
 l RECTIFY - specifies the rectification method to use for rectifying this file. Valid value are
 LINEAR, HELMERT, AFFINE, POLYNOMIAL, and TRIANGULATION. If you do not specify a
 rectification type but do provide at least two ground control points, the best rectification
 method will automatically be chosen based on the number of control points specified.
 l RECTIFY_4_POINT_POLY_ONLY - specifies that if RECTIFY=POLYNOMIAL is used to specify
 the rectification method, the polynomial will always be a 1st degree polynomial and
 won't switch automatically to a 2nd degree polynomial at 6 or more points. By default,
 the 2nd degree polynomial will automatically be used
SHIFT_LAYER
The SHIFT_LAYER command moves a layer by the specified offset.
The following parameters are supported by the command:
 l FILENAME - filename of the layer to split. If an empty value is passed in, all loaded vector
 layers will be split. This parameter can be listed more than once to specify multiple input
 files, like FILENAME="FILENAME_1" FILENAME="FILENAME_2". When running
 the script in the context of the main map view (including loading a workspace) you can
 also pass in the value 'USER CREATED FEATURES' to have the 'User Created Features'
 layer split or 'SELECTED LAYERS' to have any layers selected in the Control Center split. If
 you don't pass anything in all loaded layers will be operated on.
 l COORD_OFFSET - specifies the offset to apply to any coordinates for the features that
 match the specified criteria. The offset should be specified as a comma-delimited list of
 the X and Y offsets (and optionally Z), such as COORD_OFFSET="100000.0,200000.0". If
 you just want to shift in the Z direction, specify 0 for the X and Y shifts. For example, to
 shift by 5 units in the Z direction, use COORD_OFFSET="0,0,5".
 - 98 -
 Global Mapper Scripting Reference Section 7: Layer Management
 SHIFT_LAYER
 a Z component after each XY value. If 3D control points are provided, they will shift
 Lidar, 3D vectors or 3D model layers using the best-fit 3D transform.
 l GCP - specifies a single ground control point for use in rectifying a file. The GCP
 record consists of 5 comma-delimited fields, the control point name, the pixel X and
 Y coordinates, and the corresponding ground X and Y coordinates. A separate GCP
 parameter and value should be used for each control point used in the rec-
 tification. As an alternative, the GCP_FILENAME parameter (see below) can be used
 instead.
 When HAS_3D_POINTS is used the expected values are like GCP="name,x_
 from,y_from,z_from,x_to,y_to,z_to"
 l GCP_FILENAME - specifies the name of a control point file used to rectify the file
 being imported. the expected format in the file when HAS_3D_POINTS is provided
 is: x_from,y_from,z_from,x_to,y_to,z_to,name. Note the name is optional.
 l GCP_PROJ_NAME - specifies the name of the projection that the ground control
 points are provided in. This name must have been defined with a prior DEFINE_
 PROJ command. Use this if you want to specify control points in a projection other
 than what you want to define as the native projection for the file. Note that you
 must also explicitly specify the name projection of the file using either the PROJ,
 PROJ_NAME, PROJ_EPSG_CODE or PROJ_FILENAME parameters.
 l TRANSFORM_FILENAME - specifies the name of a control point file used to trans-
 form the coordinates of the imported file. This is different than the GCP_FILENAME
 in that the file defines a mapping of world coordinates to a new set of world
 coordinates rather than pixel coordinates to world coordinates. Each line should be
 of the format: x_orig,y_orig,x_new_y_new
 - 99 -
 Global Mapper Scripting Reference Section 7: Layer Management
 QUERY_LAYER_METADATA
 l GCP_PROJ_FILENAME - specifies the name of the projection (.prj) file that contains
 the projection definition for the projection that the ground control points are
 provided in. Use this if you want to specify control points in a projection other than
 what you want to define as the native projection for the file. Note that you must
 also explicitly specify the name projection of the file using either the PROJ, PROJ_
 NAME, PROJ_EPSG_CODE or PROJ_FILENAME parameters.
 l GCP_PROJ_EPSG_CODE - specifies the EPSG code of the projection that the ground
 control points are provided in. Use this if you want to specify control points in a pro-
 jection other than what you want to define as the native projection for the file.
 Note that you must also explicitly specify the name projection of the file using
 either the PROJ, PROJ_NAME, PROJ_EPSG_CODE or PROJ_FILENAME parameters.
 l RECTIFY - specifies the rectification method to use for rectifying this file. Valid
 value are LINEAR, HELMERT, AFFINE, POLYNOMIAL, and TRIANGULATION. If you
 do not specify a rectification type but do provide at least two ground control
 points, the best rectification method will automatically be chosen based on the
 number of control points specified.
 l RECTIFY_4_POINT_POLY_ONLY - specifies that if RECTIFY=POLYNOMIAL is used to
 specify the rectification method, the polynomial will always be a 1st degree poly-
 nomial and won't switch automatically to a 2nd degree polynomial at 6 or more
 points. By default, the 2nd degree polynomial will automatically be used
Example: Shift a layer by 500 meters in the X direction and 300 meters in the Y direction.
SHIFT_LAYER FILENAME="BackCove_base.tif" COORD_OFFSET="500,300" COORD_OFFSET_UNITS="M"
Here are 2 sample SHIFT_LAYER script commands to shift an already loaded Lidar GMP file
using a 3D shift:
// Shift layer by the control point file
SHIFT_LAYER GCP_FILENAME="augusta_xform_3d.txt" HAS_3D_POINTS=YES
QUERY_LAYER_METADATA
The QUERY_LAYER_METDATA command allows a layer metadata value to be stored in a script
variable. The user needs to identify the layer based on its file name (or layer description) and
the metadata attribute based on the name it has when displayed via the Control Center. The fol-
lowing parameters are supported by this command:
 l RESULT_VAR - specifies the name of the script variable where the metadata will be
 stored.
 - 100 -
 Global Mapper Scripting Reference Section 7: Layer Management
 UNLOAD_ALL
 l METADATA_LAYER - identifies the layer from which the metadata will be copied. This is
 the same value that would be passed to the FILENAME parameter on the IMPORT com-
 mand used to load the layer.
 l METADATA_ATTR - This is the string used to identify the metadata from which the value
 will be copied. The complete list of metadata attribute names for a layer can be seen by
 clicking the Metadata... button on the Control Center, or by running the EXPORT_
 METADATA command and looking at the result file. Some example metadata attributes
 are "UPPER LEFT X", "AREA COUNT", "PROJ_DESC", etc.
SAMPLE
Example: Stores the layer's DESCRIPTION metadata in a variable called %DESC%:
DEFINE_VAR NAME="LAYER" VALUE="P:\Data\Areas.shp"
IMPORT FILENAME="%LAYER%" TYPE="SHAPEFILE"
QUERY_LAYER_METADATA METADATA_LAYER="%LAYER%" METADATA_ATTR="DESCRIPTION" RESULT_VAR="DESC"
UNLOAD_ALL
The UNLOAD_ALL command unloads all currently loaded data. This command may be called
with no parameters.
The following parameters are supported by the command:
 l VECTOR_ONLY - specifies that only layers containing vector data shall be unloaded. All
 raster and gridded elevation layers will remain loaded. Use VECTOR_ONLY=YES to enable
 unloading just the vector layers.
UNLOAD_LAYER
The UNLOAD_LAYER command allows you to unload all previous loaded layers with a given file-
name. This is useful if you don't want to unload all previously loaded layers just to get rid of a
few of them.
The following parameters are supported by the command:
 l FILENAME - filename of the layer to unload. If an empty value is passed in, all layers that
 were created by the script, such as those from a GENERATE_CONTOURS command, will
 be unloaded. This parameter can be listed more than once to specify multiple input files,
 like FILENAME="FILENAME_1" FILENAME="FILENAME_2". When running the
 script in the context of the main map view (including loading a workspace) you can also
 pass in the value 'USER CREATED FEATURES' to have the 'User Created Features' layer
 updated or 'SELECTED LAYERS' to have any layers selected in the Control Center
 unloaded. You can also pass in the full description of the loaded layer to use in case you
 want to unload a layer not loaded from a file.
 - 101 -
 Global Mapper Scripting Reference Section 7: Layer Management
 SPLIT_LAYER
SPLIT_LAYER
The SPLIT_LAYER command allows you to split a layer into multiple layers based on some attrib-
ute value. The original layer is closed if there was any split that happened.
The following parameters are supported by the command:
 l FILENAME - filename of the layer to split. If an empty value is passed in, all loaded vector
 layers will be split. This parameter can be listed more than once to specify multiple input
 files, like FILENAME="FILENAME_1" FILENAME="FILENAME_2". When running
 the script in the context of the main map view (including loading a workspace) you can
 also pass in the value 'USER CREATED FEATURES' to have the 'User Created Features'
 layer split or 'SELECTED LAYERS' to have any layers selected in the Control Center split. If
 you don't pass anything in all vector layers will be operated on.
 l SPLIT_BY_ATTR - specifies the attribute to split on. A new layer will be generated for
 each set of attributes values in the input data. This can be a normal attribute name or a
 special one. See special Attribute Name parameter details.
 l SPLIT_ATTR_SEP - specifies a separator to check for in the split attribute. If multiple val-
 ues are in the split attribute a separate layer will be created for each. You can use special
 values like COMMA, TAB, SPACE, and SEMICOLON in addition to just specifying the sep-
 arator string directly. For example if you use SPLIT_BY_ATTR="PROPERTY_ID" and a fea-
 ture has a PROPERTY_ID attribute with the value "A,B,C" and you add SPLIT_ATTR_
 SEP=COMMA, you will get 3 copies of the feature, one in layer A, one in layer B, and one
 in layer C.
 l LAYER_DESC_ATTR_ONLY - specifies that the description assigned to newly created lay-
 ers will just consist of the attribute value rather than the original layer description with
 the attribute value appended.
 l CLOSE_ORIG_LAYER - specifies that the layer that was split into new sub-layers should be
 closed when the operation completes. This is done by default, so add CLOSE_ORIG_
 LAYER=NO to keep the original layer open.
SORT_LAYERS
The SORT_LAYERS command allows you to sort the loaded layers based on some criteria, like
name, resolution, type, etc. The following parameters are supported by the command:
 l FILENAME - filename of the layers to sort. If you leave this off all layers will be sorted.
 You can use wild-cards to match on multiple loaded files. This parameter can be listed
 more than once to specify multiple input files, like FILENAME="FILENAME_1"
 FILENAME="FILENAME_2".
 l LAYER_GROUP - specifies the layer group to match on. Only loaded layers in the specified
 group will be matched on. You can use wildcards (like '*' or '?') to match multiple groups.
 - 102 -
 Global Mapper Scripting Reference Section 7: Layer Management
 EDIT_MAP_CATALOG
 If you don't provide this parameter any group is ok. If you want only those layers not in a
 group, add LAYER_GROUP="" for none.
 l MAP_ORDER - specifies how to sort the maps. The following values are recognized:
 l LAYER_DESC_ASC - ascending order by layer description
l RESOLUTION - sort in order of increasing resolution (i.e. less detailed drawn first)
l MOVE_FRONT - move the matching layers to the front of the draw order
l MOVE_FRONT_GROUP - move the matching layers to the front of the group spe-
l MOVE_END_GROUP - move the matching layers to the end of the group specified
 with LAYER_GROUP
 l NSWE - sort by map box, north to south, west to east in row
l SNWE
l SNEW
l WENS
l WESN
l EWNS
l EWSN
EDIT_MAP_CATALOG
The EDIT_MAP_CATALOG command allows you to work with map catalogs (managed col-
lections of map files), including create new map catalogs, adding maps to existing map catalogs,
and removing maps from existing map catalogs.
The following parameters are supported by the command:
 l FILENAME - filename of the map catalog to create/update.
 l CREATE_IF_EMPTY - specifies whether or not the map catalog (.gmc) file should be cre-
 ated if it doesn't already exist. The default is YES. If you specify the FILENAME of a map
 catalog file that doesn't exist and have CREATE_IS_EMPTY=NO provided, nothing will be
 done and an error will be logged.
 l ZOOM_DISPLAY - specifies when the maps in the map catalog should be displayed and
 when it should be hidden based on the display zoom scale. This command will be format-
 ted as a name from the list, below followed by 2 numeric parameters. For example, use
 ZOOM_DISPLAY="SCALE,25000,0" to have a map display only when zoomed in
 below 1:25000 scale.
 l ALWAYS - always display the map. The numeric parameters are ignored.
l PERCENT - display the map when the map bounding box is a certain per-
 l PIXEL_SIZE - display the map when each display pixel is less than some
 number of meters in size. For example, use PIXEL_SIZE-
 E="SCALE,10,0" to display the map when the current display res-
 olution is 10 meters per pixel (or less/higher resolution).
 l SCALE - display the map when the current display is at or below a certain
SAMPLES
Here is a sample showing how to create a map catalog and then load it:
// Create the map catalog. Maps should show when they take up at least 10% of display.
EDIT_MAP_CATALOG FILENAME="C:\TEMP\EXPORT TEST\script_catalog.gmc" CREATE_IF_EMPTY=YES \
 ADD_FILE="c:\temp\export test\*.tif" ADD_FILE="c:\temp\export test\*.dem" \
 ZOOM_DISPLAY="PERCENT,0.10,0"
// Load the map catalog
IMPORT FILENAME="c:\temp\export test\script_catalog.gmc"
 - 104 -
 Global Mapper Scripting Reference Section 7: Layer Management
 EDIT_MAP_CATALOG
 - 105 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 CALC_VOLUMES
CALC_VOLUMES
The CALC_VOLUMES command allows you to calculate the volume for each area in the spe-
cified layer using the currently loaded terrain data.
The following parameters are supported by the command:
 l FILENAME - filename of the layer containing the areas to be used in the calculations. This
 parameter can be listed more than once to specify multiple input files, like FILENAME-
 E="FILENAME_1" FILENAME="FILENAME_2".
 l OUTPUT_FILENAME - specifies the path and file name of the output file for volume stat-
 istics. At least one of this and the ADD_VOLUME_ATTRS parameter is required. Using
 both is valid also.
 l ADD_VOLUME_ATTRS - indicates whether or not to add the volume measurements to
 the area features as attributes. Use ADD_VOLUME_ATTRS=YES to add the volume data to
 the feature attribute list. At least one of this and the OUTPUT_FILENAME parameter is
 required. Using both is valid also.
 l BASE_ELEVATION - specifies the base elevation in meters for volume calculations. This
 parameter is optional. The default is 0.
 l BASE_ELEVATION_ABOVE_SEA_LEVEL- Use BASE_ELEVATION_ABOVE_SEA_LEVEL=YES
 (or don't specify any value) to indicate that the BASE_ELEVATION parameter represents
 units above sea level. Use BASE_ELEVATION_ABOVE_SEA_LEVEL=NO to indicate that the
 base elevation is relative to ground. The default is NO, base elevation is relative to
 ground.
 l VOLUME_UNIT - specifies the unit to be used for the volume calculations. This parameter
 is optional, and the default is CUBIC_METERS. Valid values are:
 l ACRE_FEET
l ACRE_INCHES
l BARRELS
 - 106 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 CALC_VOLUME_BETWEEN_SURFACES
 l BARRELS_OIL
 l CUBIC_FEET
 l CUBIC_METERS
 l CUBIC_YARDS
 l GALLONS
SAMPLE
Here is a sample of calculating volumes in cubic feet, adding the results to the features as attrib-
utes.
 GLOBAL_MAPPER_SCRIPT VERSION=1.00
CALC_VOLUMES FILENAME="boundaries 2.dxf" ADD_VOLUME_ATTRS=YES
CALC_VOLUME_BETWEEN_SURFACES
Calculates the volume between two elevation grids. If you specify an area layer, the volume will
be calculated for each feature, and volume attributes will be added to the feature. The fol-
lowing parameters are supported by the command:
 l LAYER1_FILENAME - specifies the base elevation grid. Elevations in LAYER2_FILENAME
 will will be subtracted from elevations in this layer during the volume calculations.
 l LAYER2_FILENAME - specifies the elevation grid with values that will be subtracted from
 LAYER1_FILENAME.
 l AREA_FILENAME - An optional layer that contains area features. If it is specified, the
 volume will be calculated for each area, and the volume attributes will be added to the
 feature.
 l VOLUME_UNIT - specifies the unit to be used for the volume calculations. This para-
 meter is optional, and the default is CUBIC_METERS. Valid values are:
 l ACRE_FEET
l ACRE_INCHES
l BARRELS
l BARRELS_OIL
l CUBIC_FEET
l CUBIC_METERS
l CUBIC_YARDS
l GALLONS
 l OUTPUT_FILENAME - specifies the path and file name of the output file for volume stat-
 istics.
 - 107 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 COMBINE_TERRAIN
SAMPLE
CALC_VOLUME_BETWEEN_SURFACES LAYER1_FILENAME="P:\Data\baseGrid.tif" \
LAYER2_FILENAME="P:\Data\lidarGrid2.dem" \
AREA_FILENAME="P:\Data\ClipAreas.shp" \
VOLUME_UNIT="CUBIC_FEET" \
OUTPUT_FILENAME="%OUTDIR%\fromScript_wClip.csv"
COMBINE_TERRAIN
The COMBINE_TERRAIN command generates a new terrain (gridded elevation) layer by com-
bining two loaded terrain layers through some operation, like addition, subtraction (difference),
average, min/max, etc. The new terrain layer can then be operated on just like any other ter-
rain layer.
The following parameters are used by the COMBINE_TERRAIN command:
 l LAYER1_FILENAME - full path and filename of the first loaded terrain layer to use. You
 can also pass in the full description of the loaded layer to use in case you want to use a
 layer not loaded from a file. If you are using one of the combine operations that works on
 multiple layers in a single list, like ADD, AVERAGE, MINIMUM, MAXIMUM, or COUNT_
 VALID, you can leave this blank and have all loaded layers examined.
 l LAYER2_FILENAME - full path and filename of the second loaded terrain layer to use. You
 can also pass in the full description of the loaded layer to use in case you want to use a
 layer not loaded from a file. You do not have to provide this for those operations that
 work on multiple layers in a single list, like ADD, AVERAGE, MINIMUM, MAXIMUM, or
 COUNT_VALID.
 l COMBINE_OP - defines the operation to perform when combining the layers. The fol-
 lowing operations are supported:
 l ADD - adds the values from the first layer to the second
l SUBTRACT_SIGNED - subtracts the values of the second layer from the first and
l MINIMUM - saves the smaller of the values from the first and second layers.
l MAXIMUM - saves the larger of the values from the first and second layers.
l MULTIPLY - multiplies the values from the first and second layers. If one or both of
 one or both of the values is missing or if the second value is 0, the sample is
 marked as invalid.
 l FILTER_KEEP_FIRST - saves the first layer value if the second layer value is valid.
 - 108 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 COMBINE_TERRAIN
 value is valid and the first layer value is less than the second layer value.
 l FILTER_KEEP_FIRST_IF_SECOND_GT_VAL - saves the first layer value if the second
 layer value is valid and the second layer value is greater than the value provided
 with the COMPARE_VAL parameter
 l FILTER_KEEP_FIRST_IF_SECOND_LT_VAL - saves the first layer value if the second
 layer value is valid and the second layer value is less than the value provided with
 the COMPARE_VAL parameter
 l COUNT_VALID - counts the number of layers that have a valid sample at each grid
 - 109 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 GENERATE_BREAKLINES
 l Cropping to Polygons/Areas
 See also "Cropping Operations to Polygons/Areas" on page 230
GENERATE_BREAKLINES
The GENERATE_BREAKLINES command allows for the generation of breaklines from any or all
currently loaded elevation data. The following parameters are supported by the command.
 l FILENAME - filename of the loaded terrain layer(s) to find breaklines in. If an empty value
 is passed in, all loaded terrain data will be used. This parameter can be listed more than
 once to specify multiple input files, like FILENAME="FILENAME_1" FILENAME-
 E="FILENAME_2".
 l LAYER_DESC - specifies the name to assign to the generated breakline layer. If no layer
 description is provided, a default name will be used based on what was last used on the
 Breakline dialog
 l METHOD – specifies the method/algorithm used to find the breaklines. Supported
 values are:
 l SLOPE_EDGES – find breaklines at the edge of flat regions. Use the MAX_FLAT_
l METERS - meters
 l GAP_FILL_SIZE – specifies how large of a gap in the slope / curvature data that will be
 filled. The default value is GAP_FILL_SIZE=2. Use GAP_FILL_SIZE=0 to disable gap filling.
 l MIN_FLAT_CELL_COUNT – specifies the minimum number of cells that must be con-
 nected in a ‘flat’ area to treat the edge as a breakline. Applies when using METHOD-
 D=CURVATURE_EDGES. Any connected flat regions with less than this value will be
 ignored.
 l CURVATURE_TYPE – specifies the curvature algorithm to use for the CURVATURE_EDGES
 and CANNY_EDGES methods. The default is CURVATURE_TYPE=STANDARD. The following
 values are supported:
 l PROFILE
l PLANFORM
l STANDARD
l LONGITUDINAL
l CROSS-SECTIONAL
l SLOPE – edges will be found in a slope grid rather than a curvature grid
 l EDGE_THRESHOLDS – specifies the edge thresholds for the CANNY_EDGES method. This
 value consists of 2 comma-separated numbers, in the format EDGE_THRESHOLDS-
 S=”detect_threshold,connect_threshold”. The detect_threshold controls how significant
 an edge needs to be in order to be treated as an edge. Smaller numbers mean more less
 significant edges will be found. The connect_threshold specifies how significant non-edge
 pixels need to be in order to connect pixels that are >= the detect_threshold. The default
 value is EDGE_THRESHOLDS=”250,100”
GENERATE_CONTOURS
The GENERATE_CONTOURS command allows for the generation of contour lines (isolines of
equal elevation) from any or all currently loaded elevation data or point cloud data. To gen-
erate contours directly from point cloud data, a Global Mapper Pro license is required. The fol-
lowing parameters are supported by the command.
 l FILENAME - filename of the layer(s) to contour. If an empty value is passed in, all loaded
 terrain data will be used. This parameter can be listed more than once to specify multiple
 input files, like FILENAME="FILENAME_1" FILENAME="FILENAME_2".
 l ELEV_UNITS - specify elevation units to use in export
 l FEET - export in US feet
 l INTERVAL - specifies the contour interval to use, or the single contour level if SINGLE_
 LEVEL_ONLY=YES is provided. If a contour interval, this must be a number greater than 0.
 The units are specified with the ELEV_UNITS parameter described above. If you wanted
 to generate a contour file with an interval of 20 feet, you would use INTERVAL=20
 ELEV_UNITS=FEET in the parameter list. If no interval is provided, a default one is
 guessed based on the elevation range of the loaded elevation data.
 - 111 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 GENERATE_CONTOURS
l SINGLE_LEVEL_ONLY - specifies that the INTERVAL value is actually a value indicating the
 only height that a contour should be generated at. Use a value of YES to turn this func-
 tionality on.
l GEN_FROM_TIN_AREAS - specifies that the contours should be generated from any
 loaded TIN (3D triangle) areas rather than from loaded terrain data. Add GEN_FROM_
 TIN_AREAS=YES to command to use TINs.
l MULT_MINOR - specifies how many contours apart every intermediate contour is. For
 example, use MULT_MINOR=5 to make every 5th contour an intermediate contour. So
 using INTERVAL=10 and MULT_MINOR=5 creates intermediate contours every 50
 meters.
l MULT_MAJOR - specifies how many contours apart every major contour is. For example,
 use MULT_MAJOR=10 to make every 10th contour an intermediate contour. So using
 INTERVAL=10 and MULT_MINOR=10 creates major contours every 100 meters.
l MIN_ELEV - minimum elevation to consider for contours. Must be specified in con-
 junction with MAX_ELEV in order to restrict the range of contour generation to anything
 other than the full range of loaded elevation values. Units are specified by ELEV_UNITS
 parameter.
l MAX_ELEV - maximum elevation to consider for contours. Must be specified in con-
 junction with MIN_ELEV in order to restrict the range of contour generation to anything
 other than the full range of loaded elevation values. Units are specified by ELEV_UNITS
 parameter.
l SPATIAL_RES - specifies spacing of grid points used to determine contour position. A smal-
 ler grid spacing results in higher fidelity, but larger, contours. Typically you'll want to use
 the default value which is the minimum spatial resolution of all loaded data. Should be
 formatted as x_resolution,y_resolution. The units are the units of the current global pro-
 jection. For example, if UTM was the current global projection and you wanted to use a
 grid with a 30 meter spacing, the parameter/value pair would look like SPATIAL_RES-
 S=30.0,30.0. You can also specify as a percentage of the default resolution by adding
 a percentage. For example to get half the detail, double the spatial resolution value, so
 you would use SPATIAL_RES="200%,200%".
l SPATIAL_RES_METERS - specifies spatial resolution to use in meters. The value in meters
 will automatically be converted to the current view/export projection units. For example,
 to do an export at 2.0 meter spacing (or as close as you can get to that in the current
 units), use SPATIAL_RES_METERS=2.0, or to do an export at 1.0 meters in X by 1.5
 meters in Y, use SPATIAL_RES_METERS="1.0,1.5".
l SIMPLIFICATION - specifies the simplification threshold to use when generating the con-
 tours. This specifies how far off a straight line (in the units of the current projection) that
 a point has to be before it is kept. Generally you should not specify a simplification value
 as the default value of one tenth of the sample spacing works quite well. This is an option
 for advanced users only.
l SAMPLING_METHOD (elevation and raster only) - specifies the sampling method to use
 when resampling this layer. The following values are supported:
 - 112 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 GENERATE_CONTOURS
 olution and bounds compare to the original layout for a layer. For example if you
 export to a lower resolution a box averager of appropriate size may be used auto-
 matically
 l LAYER - Use the sampling method set for each layer
l The list of SAMPLING_METHOD values for the IMPORT command can also be spe-
 cified to use a particular sampling method for all layers being exported.
 l Shared IMPORT SAMPLING_METHOD values
 G=YES will ensure the generated areas do not overlap. NON_OVERLAPPING=NO will
 create areas that overlap.
l GEN_SPOT_ELEVATIONS - generate spot elevations at min/max elevations. Use a value of
 YES to enable the generate of min/max spot elevation points.
l FILL_GAPS - specifies that small gaps in between and within the data sets being used to
 generate the contours will be filled in by interpolating the surrounding data to come up
 with an elevation for the point in question. This option is on by default, specify FILL_
 GAPS=NO to turn off.
l LAYER_DESC - specifies the name to assign to this layer. If no layer description is
 provided, the default name of "GENERATED CONTOURS" will be used.
l INC_UNIT_SUFFIX - specifies whether or not a unit suffix (either "m" or "ft") should be
 appended to the numeric label of generated features. By default this is enabled, so spe-
 cify INC_UNIT_SUFFIX=NO to turn unit suffixes off. This is useful if the data the contours
 are being generated over doesn't actually represent elevation.
l SMOOTH_CONTOURS - specifies whether or not generated contour line and area fea-
 tures should have smoothing applied to improve appearance. This option is enabled by
 default. Use SMOOTH_CONTOURS=NO to disable smoothing.
l CREATE_ON_WAY_DOWN - specifies whether contours are created as the terrain passed
 from a higher elevation to a contour height (CREATE_ON_WAY_DOWN=YES) or the
 default way of being created when the terrain passes from a contour height to lower elev-
 ation values (CREATE_ON_WAY_DOWN=NO).
l MIN_CONTOUR_LEN - specifies that any closed contour lines less than the specified
 length (in meters) will be marked as deleted. This is useful for cleaning up contours in
 very rugged and detailed terrain, like from Lidar. The default is to keep all generated con-
 tour lines.
 - 113 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 GENERATE_WATERSHED and GENERATE_RIDGE_LINES
 l FIND_PEAKS - specifies whether to find isolated peak points on the surface. Use FIND_
 PEAKS=YES to enable.
 l MAX_PEAK_DIST - The maximum distance in meters between two points sharing a
 key contour.
 l MIN_PEAK_SLOPE - specifies the minimum slope (in degrees) required between
 a candidate peak.
 l MIN_SADDLE - The minimum amount of elevation drop between close peaks to
 - 114 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 GENERATE_WATERSHED and GENERATE_RIDGE_LINES
 vector area feature. The format is FLOW_TO_POS="x,y". You can provide multiple FLOW_
 TO_POS parameters to find the flow to multiple locations. Use FLOW_TO_POS_THRESH
 to specify how close to the position the flow has to go in order to consider the source
 point part of that area. Use FLOW_TO_POS_PROJ to specify the projection of the pos-
 ition. If that is not provided it will be assumed to be in the current projection.
l FLOW_TO_POS_THRESH - specifies how many samples away from the sample containing
 the specified FLOW_TO_POS that the flow can be and still be considered to go to that
 point. The default is FLOW_TO_POS_THRESH=1.
l FLOW_TO_POS_PROJ - special Projection Specification parameter providing the pro-
 jection of the FLOW_TO_POS.
l FILLED_DEM_FILENAME - specifies the full path and name of a GMG (Global Mapper
 Grid) file to save the depression filled DEM to after finding it. The default is to not save
 the filled DEM to a GMG file.
l GEN_FLOW_DIR_POINTS - specifies whether or not a separate layer containing a point
 feature with the flow direction and accumulation at each sample location. Add GEN_
 FLOW_DIR_POINTS=YES to create the layer. The symbol can be set with the FLOW_DIR_
 SYMBOL parameter.
l FLOW_DIR_SYMBOL - specifies the name of the point symbol to use for the flow dir-
 ection points. The specified symbol will be rotated to show the flow direction. The default
 is the medium black arrow.
l SHOW_FLOW_ACCUM - specifies whether or not the flow accumulation grid should be
 saved as a new layer. Use SHOW_FLOW_ACCUM=YES to enable saving the flow accu-
 mulation to a new grid layer.
l CALC_STRAHLER - specifies whether or not the Strahler stream order attribute should be
 calculated for the stream lines. Use CALC_STRAHLER=YES to enable. Use only for
 GENERATE_WATERSHED command.
l Obstructions from Vector Data:
 l USE_VECTOR_HEIGHTS - indicates whether or not loaded vector data with elev-
 ation values should be considered when performing the watershed analysis. This
 allows you to use things like buildings, culverts, dams, etc. to block or modify the
 flow, creating a more realistic watershed. The default is to not use vector data. Use
 USE_VECTOR_HEIGHTS="YES" to specify that you want to use heights from vector
 data.
 l VECTOR_FILENAME - specifies the filename/description of the vector layer(s) to get
 obstructions from. If not provided, all loaded vector layers will be considered. You
 can provide multiple VECTOR_FILENAME parameters to explicitly specify multiple
 layers.
 l VECTOR_AREAS_HIDDEN - specifies that any locations within an obstruction area,
 or immediately adjacent to an obstruction line, will not allow flow into the region
 from outside, regardless of the height of the feature. The default is "NO".
 l VECTOR_ONLY_3D - specifies that only vector features with elevations will be con-
 olution and bounds compare to the original layout for a layer. For example if you
 export to a lower resolution a box averager of appropriate size may be used auto-
 matically
 l LAYER - Use the sampling method set for each layer
l The list of SAMPLING_METHOD values for the IMPORT command can also be spe-
 cified to use a particular sampling method for all layers being exported/
 l Shared IMPORT SAMPLING_METHOD values
 - 116 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 GENERATE_WATER_RISE
GENERATE_WATER_RISE
Calculates the water rise from a given area or from a specific elevation.
 l FILENAME- filename of the terrain layer(s) to process. If an empty value is passed in, all
 loaded terrain data will be used. This parameter can be listed more than once to specify
 multiple input files, like FILENAME="FILENAME_1" FILENAME="FILENAME_2".
 l ELEVATION_TO_RISE_FROM -Specify an elevation that the water rise will calculated
 from.
 l WATER_RISE_POLY_FILE - Specify the file name for area feature(s) that water rise should
 be calculated from. Typically this would be a lake or pond.
 l MAX_DEPTH- specify the height of the water rise and the depression fill depth. This can
 be height above a specific elevation using ELEVATION_TO_RISE_FROM or height above an
 area.
 l ELEV_UNITS- specify the units for elevation values in the command
Shared Parameters
 l SPATIAL_RES - specifies spacing of grid points used to calculate the watershed. A smaller
 grid spacing results in higher fidelity, but the calculation process will take longer. Typically
 you'll want to use the default value which is the minimum spatial resolution of all loaded
 data. Should be formatted as x_resolution,y_resolution. The units are the units of the cur-
 rent global projection. For example, if UTM was the current global projection and you
 wanted to use a grid with a 30 meter spacing, the parameter/value pair would look like
 SPATIAL_RES=30.0,30.0.
 l SPATIAL_RES_METERS - specifies spatial resolution to use in meters. The value in meters
 will automatically be converted to the current view/export projection units. For example,
 to do an export at 2.0 meter spacing (or as close as you can get to that in the current
 - 117 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 GENERATE_WATER_RISE
 olution and bounds compare to the original layout for a layer. For example if you
 export to a lower resolution a box averager of appropriate size may be used auto-
 matically
 l LAYER - Use the sampling method set for each layer
l The list of SAMPLING_METHOD values for the IMPORT command can also be spe-
 cified to use a particular sampling method for all layers being exported/
 l Shared IMPORT SAMPLING_METHOD values
SAMPLES
Calculate the water rise from the area defined by "riverarea.shp" if the water was to increase
20 ft.
GLOBAL_MAPPER_SCRIPT VERSION="1.00" ENABLE_PROGRESS=NO
IMPORT FILENAME="CROPPED_DEM.dem" LAYER_DESC="SOURCE_LAYERS"
IMPORT FILENAME="riverarea.shp" LAYER_DESC="POLYFILE"
GENERATE_WATER_RISE MAX_DEPTH=20 WATER_RISE_POLY_FILE="POLYFILE" ELEV_UNITS=FEET
EXPORT_VECTOR GEN_PRJ_FILE=YES FILENAME="outwaterrise_elev860.shp" \
 TYPE=SHAPEFILE SHAPE_TYPE=AREAS
UNLOAD_ALL
GENERATE_VIEWSHED
The GENERATE_VIEWSHED command allows you to perform a view shed analysis using loaded
elevation grid data with a user-specified transmitter location, height, and radius. All areas
within the selected radius that have a clear line of sight to the transmitter are colored with a
user-specified color.
The parameters are:
 l LAYER_DESC - specifies the name to assign to the view shed layer. If no layer description
 is provided, the default name of "GENERATE_VIEWSHED Output" will be used.
 l XMIT_POS - indicates the transmitter location in the current projection system. This is a
 required parameter. This should be formatted as XMIT_POS="x_easting_longitude,y_
 northing_latitude"
 l FILENAME - filename of the layer(s) to process. All point features in the specified layers
 will be used as center points of a view shed. This parameter can be listed more than once
 to specify multiple input files, like FILENAME="FILENAME_1" FILENAME="FILENAME_
 2".The GENERATE_VIEWSHED comman must contain at least one FILENAME parameter or
 one XMIT_POS parameter, but not both.Note that this function can only be used in a
 script that runs in Global Mapper, not one that gets run via the GM_RunScript function in
 the SDK.
 l XMIT_HEIGHT - specifies the height above ground or sea level for the transmitter that the
 view shed analysis will be simulating. The value must contain the height and a units abbre-
 viation, e.g., XMIT_HEIGHT="5 ft". This is a required parameter.
 l XMIT_HEIGHT_ABOVE_SEA_LEVEL - indicates whether the XMIT_HEIGHT value is above
 sea level or above ground. Use XMIT_HEIGHT_ABOVE_SEA_LEVEL=YES to specify that the
 transmitter height is relative to sea level. The default is "NO", i.e., the transmitter height
 is above ground.
 l RECEIVER_ELEV_TYPE - specifies the method used to define the receiver height. It can be
 one of the following values:
 l "EXPLICIT_HEIGHT" - If RECEIVER_ELEV_TYPE is not specified this is the default.
l "XMIT_ANGLE"
l "XMIT_ANGLE_RANGE"
 l RECEIVER_HEIGHT - required parameter that specifies the receiver height when the type
 is "EXPLICIT_HEIGHT". This is the minimum height above the ground or sea level from
 which the transmitter must be visible for the point to be considered visible. The value
 must contain the height and a units abbreviation, e.g., RECEIVER_HEIGHT="8 m".
 l RECEIVER_ANGLE - Optionally, you can also specify that the receiver elevation should be
 calculated based on an elevation angle relative to the horizon from the transmitter. This
 is useful if you have something like a radar dish that points up at some angle and you
 - 119 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 GENERATE_VIEWSHED
 want to see where the signal can be seen. Specify the value in degrees, from 0 to 360.
 RECEIVER_ANGLE is a required parameter when the type is "XMIT_ANGLE" or "XMIT_
 ANGLE_RANGE".
l RECEIVER_ANGLE_END - specifies the other end of a transmission angle range for a beam
 transmitted from the transmitter. Then the view shed will depict where that beam would
 hit the terrain surface (or some user-specified distance above the surface). RECEIVER_
 ANGLE_END is a required parameter when the type is "XMIT_ANGLE_RANGE". Specify
 the value in degrees, from 0 to 360. It must be greater than the value used for RECEIVER_
 ANGLE.
l RECEIVER_HEIGHT_ANGLE - indicates the receiver height (in meters) to use when check-
 ing with restricted transmission angle. This parameter is optional, and is only used when
 RECEIVER_ELEV_TYPE is XMIT_HEIGHT_RANGE.
l RECEIVER_HEIGHT_ABOVE_SEA_LEVEL - indicates whether the RECEIVER_HEIGHT or
 RECEIVER_HEIGHT_ANGLE value is above sea level or above ground. Use
 RECEIVER_HEIGHT_ABOVE_SEA_LEVEL=YES to specify that the receiver height is relative
 to sea level. The default is "NO", i.e., the receiver height is relative to the ground.
l RADIUS - specifies how far in each direction from the transmitter to check for visibility.
 Typically you'd want to set this to the effective range of your transmitter. The value must
 contain the distance and a units abbreviation, e.g., RADIUS="25 km". This is a required
 parameter.
l RADIUS_MIN - If you want to ignore areas close to the transmitter, use RADIUS_MIN to
 specify a minimum view radius value. The value must contain the distance and a units
 abbreviation, e.g., RADIUS_MIN="1 km". This is an optional parameter. The default is 0,
 which includes everything from the transmitter out to the selected view radius.
l START_ANGLE - The GENERATE_VIEWSHED command allows the user to limit the view
 shed to a particular subsection of the complete radial area. The START_ANGLE specifies
 the cartographic angle, in degrees, at which the radial subregion begins. This angle is a
 cartographic angle, meaning that 0 degrees is north and angle increases clockwise. For
 example, to define a arc that starts due south, use START_ANGLE="180". This para-
 meter is optional. The default is to perform the analysis on the full radial area.
l SWEPT_ANGLE - specifies the number of degrees clockwise to include in the view shed.
 For example, if the transmitter being analyzed sweeps an arc from due south to due
 west, use START_ANGLE="180" SWEPT_ANGLE="90". SWEPT_ANGLE is an
 optional parameter. The default is 360 degrees.
l USE_EARTH_CURVATURE - indicates whether or not to take the curvature of the earth
 into account while performing the view shed analysis. Use USE_EARTH_
 CURVATURE="YES" to specify that you want to use earth curvature. This parameter is
 optional; the default is "NO".
l ATMOSPHERIC_CORRECTION - In addition, when earth curvature is being used, use
 ATMOSTPHERIC_CORRECTION specify an atmospheric correction value to be used. The
 atmospheric correction value is useful when determining the view shed for transmitting
 waves whose path is affected by the atmosphere. For example, when modeling
 - 120 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 GENERATE_VIEWSHED
 - 121 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 GENERATE_PATH_PROFILE
 things like buildings, fence lines, towers, etc. to block portions of the view, creating a
 more realistic view shed. The default is to not use vector data. Use USE_VECTOR_
 HEIGHTS="YES" to specify that you want to use heights from vector data.
 l VECTOR_AREAS_HIDDEN - specifies that any locations within an obstruction area will be
 marked as hidden, rather than only those that actually would be hidden. The default is
 "NO".
 l VECTOR_HEIGHTS_ABOVE_SEA_LEVEL - specifies whether the elevation values stored
 with vector features are relative to the ground or relative to mean sea level. Typically
 heights for vector features are specified relative to the ground. If any area features are
 included and their heights are relative to the ground, the obstruction heights within
 those areas will be increased by the specified amount, but any receiver heights will still
 be based on the terrain. This makes things like wooded areas very easy to model. The
 default is "NO" (heights are relative to the ground). To specify that vector heights should
 be relative to sea level, use VECTOR_HEIGHTS_ABOVE_SEA_LEVEL="YES"
 l FIX_INVALID - indicates whether or not to automatically detect and fix invalid coverage
 polygons. Use FIX_INVALID="YES" to detect and fix invalid polygons. The default is "NO".
 l SPATIAL_RES - specifies spacing of grid points used to calculate the viewshed. A smaller
 grid spacing results in higher fidelity, but the calculation process will take longer. Typically
 you'll want to use the default value which is the minimum spatial resolution of all loaded
 data. Should be formatted as x_resolution,y_resolution. The units are the units of the cur-
 rent global projection. For example, if UTM was the current global projection and you
 wanted to use a grid with a 30 meter spacing, the parameter/value pair would look like
 SPATIAL_RES=30.0,30.0. You can also specify as a percentage of the default res-
 olution by adding a percent. For example to get half the detail your double the spatial res-
 olution value, so you would use SPATIAL_RES="200%,200%".
 l SPATIAL_RES_METERS - specifies spatial resolution to use in meters. The value in meters
 will automatically be converted to the current view/export projection units. For example,
 to do an export at 2.0 meter spacing (or as close as you can get to that in the current
 units), use SPATIAL_RES_METERS="2.0", or to do an export at 1.0 meters in X by 1.5
 meters in Y, use SPATIAL_RES_METERS="1.0,1.5".
GENERATE_PATH_PROFILE
The GENERATE_PATH_PROFILE command allows for the saving of a 3D path profile to an ASCII
XYZ file. This command uses loaded elevation data to generate a list of the 3D coordinates
between two given points in the given elevation units. The following parameters are supported
by the command.
 l FILENAME - full path to XYZ ASCII file to save the data to
 l PATH_LAYER - Filename or layer description of the vector layer containing lines to create
 profiles from. START_POS & END_POS will be ignored if this is specified. If APPEND_TO_
 - 122 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 GENERATE_ELEV_GRID
 FILE=NO is not specified, a separate output file will be created for each line path layer. An
 index will be added to base filename given by FILENAME.
 l ELEV_UNITS - specify elevation units to use in export
 l FEET - export in US feet
 l POINT_COUNT - specifies the number of points to generate in the path. This must be at
 least 2. For example, to create 1000 points, use POINT_COUNT=1000. You can use the
 POINT_SPACING parameter rather than this to specify how far apart sample points
 should be.
 l POINT_SPACING - specifies the point spacing in meters to use between sample points
 along the path. For example, to create points spaced 10 meters apart, use POINT_
 SPACING=10.0.
 l START_POS - specifies the start position for the path profile. The coordinates must be
 given in the current global coordinate system. For example, if UTM if the current pro-
 jection, you might specify and easting/northing as follows: START_POS-
 S=480000,4310000.
 l END_POS - specifies the end position for the path profile. The coordinates must be given
 in the current global coordinate system. For example, if UTM if the current projection,
 you might specify and easting/northing as follows: START_POS=480000,4310000.
 l ADD_LAND_USE_CODES - specifies whether to query loaded LULC data sets for the land
 use code at each point and to include that land use code after the elevation. Use ADD_
 LAND_USE_CODES=YES to turn on adding land use codes for each point.
 l APPEND_TO_FILE - specifies that the elevations between the start and end locations
 should be appended to the file specified if it already exists rather than a new file being
 created. Use APPEND_TO_FILE=YES to enable.
 l ADD_BLANK_LINE - specifies that a blank line will be added to the file if APPEND_TO_FILE-
 E=YES is added to the command and the file was not empty to start with. Use ADD_
 BLANK_LINE=YES to enable adding the blank line.
 l SAVE_DIST_Z_FILE - specifies that the output file should contain distance and elevation
 values rather than XYZ coordinate values. Use SAVE_DIST_Z_FILE=YES to enable this
 option.
GENERATE_ELEV_GRID
The GENERATE_ELEV_GRID command allows for the generation of a gridded elevation layer
using loaded 3D vector data. The following parameters are supported by the command as well
as the display option parameters supported by the IMPORT command.
 l FILENAME - filename of the layer(s) to grid. If an empty value is passed in, all loaded vec-
 tor layers with 3D data will be gridded. This parameter can be listed more than once to
 specify multiple input files, like FILENAME="FILENAME_1" FILENAME-
 E="FILENAME_2". When running the script in the context of the main map view
 - 123 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 GENERATE_ELEV_GRID
 (including loading a workspace) you can also pass in the value 'USER CREATED FEATURES'
 to have the 'User Created Features' layer updated or 'SELECTED LAYERS' to have any lay-
 ers selected in the Control Center gridded.
l ELEV_UNITS - specify elevation units to use for new grid
 l FEET - US feet
l METERS - meters
l CENTIMETERS - centimeters
 areas as constraints.
 l BIN_MIN - uses the minimum value within a bin of size GRID_BIN_SIZE. Requires a
 Global Mapper Pro license . Lidar data will be binned, and 3D line an area features
 will be used as grid constraints/ break-lines.
 l BIN_AVG - uses the average value within a bin of size GRID_BIN_SIZE. Requires a
 Global Mapper Pro license . Lidar data will be binned, and 3D line an area features
 will be used as grid constraints/ break-lines.
 l BIN_MAX - uses the maximum value within a bin of size GRID_BIN_SIZE. Requires a
 Global Mapper Pro license. Lidar data will be binned, and 3D line an area features
 will be used as grid constraints/ break-lines.
l SPATIAL_RES - specifies spacing of grid points to use in generated grid. A smaller grid spa-
 cing results in higher fidelity, but larger, elevation grids. Should be formatted as x_res-
 olution,y_resolution. The units are the units of the current global projection. For example,
 if UTM was the current global projection and you wanted to use a grid with a 30 meter
 spacing, the parameter/ value pair would look like SPATIAL_RES=30.0,30.0. If you
 do not provide a SPATIAL_RES value, a good default for the input data will be chosen, so
 in most cases it is best just to leave this off.
l SPATIAL_RES_METERS - specifies spatial resolution to use in meters. The value in meters
 will automatically be converted to the current view/ export projection units. For example,
 to do an export at 2.0 meter spacing (or as close as you can get to that in the current
 units), use SPATIAL_RES_METERS=2.0, or to do an export at 1.0 meters in X by 1.5
 meters in Y, use SPATIAL_RES_METERS="1.0,1.5".
l GRID_BIN_SIZE - if using a bin-based GRID_ALG for Lidar data this specifies how many nat-
 ive spacings in size to make each bin. For example a value of GRID_BIN_SIZE="3.0"
 would make each square bin 3 times the calculated native spacing of the point data. You
 can specify a bin size in meters by using the SPATIAL_RES_METERS parameter or a neg-
 ative GRID_BIN_SIZE (like GRID_BIN_SIZE="-0.5" for 0.5 meter spacing.
l LAYER_DESC - specifies the name to assign to this layer. If no layer description is
 provided, a default name will be assigned.
l NO_DATA_DIST_MULT - specifies how far from an actual data point a grid cell has to be
 before it is treated as a no data value. This number is given as a multiple of the diagonal
 - 124 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 GENERATE_ELEV_GRID
 size of a single grid cell as nominally determined by the gridding algorithm or specified
 with the SPATIAL_RES parameter. A value of 0 (the default) means that all points should
 be considered as valid.
l GRID_FILL_TO_BOUNDS - specifies that the grid values should be filled out to the entire
 bounds of the gridded data rather than just to the convex hull of the data being gridded.
 Use GRID_FILL_TO_BOUNDS=YES to enable this.
l GRID_FLATTEN_AREAS - specifies that area features with elevation values should be
 flattened to the elevation of the area features. Use GRID_FLATTEN_AREAS=NO to disable
 this.
l GRID_HEIGHTS_RELATIVE - specifies that the elevation values for the input vector fea-
 tures should be treated as relative to any loaded terrain data rather than as absolute elev-
 ation values. This useful for things like trees or buildings where you have a height above
 the ground rather than an absolute height. Use GRID_HEIGHTS_RELATIVE=YES to enable
 this.
l GRID_SAVE_TIN - specifies that the triangulated irregular network (TIN) for the grid oper-
 ation should be saved as a new separate vector layer consisting of triangular 3D area fea-
 tures. Use GRID_SAVE_TIN=YES to enable this.
l GRID_USE_CONSTRAINTS - specifies that 3D line and area features should be treated as
 constraints (breaklines) during the gridding process. Use GRID_USE_CONSTRAINTS=YES
 to enable this. GRID_USE_CONSTRAINTS=NO will disable using 3D line and area features
 in the grid generation. The method for applying the constraints or breaklines depends on
 the GRID_ALG. The binning methods use a soft edge value of 2 samples.
l SOFT_EDGE _DIST - when gridding lidar using a bin grid method and including 3D
 areas/lines as constraints (GRID_USE_CONSTRAINTS=YES), this parameter specifies how
 many samples to blend the lidar elevation to the area/line elevation. The default value is
 SOFT_EDGE_DIST=2.
l GRID_IGNORE_ZERO - specifies that features with an elevation of 0.0 will not be used dur-
 ing the gridding process.
l GRID_TIN_AREAS_ONLY - if enabled, all features that do not conform to TIN geometry
 (i.e. 3D triangles) will be ignored. Use GRID_TIN_AREAS_ONLY=YES to enable.
l GRID_TYPE - specifies what values should be gridded for a bin-based grid. The following
 values are supported:
 l ELEVATION - default, grids the elevation values for each point
l NDVI - grids the calculate NDVI (normalized difference vegetation index) for 4-band
 occurs the most in each cell is used, with unknown / unclassified types only being
 used if no known types are found.
 - 125 -
 Global Mapper Scripting Reference Section 8: Terrain and 3D Analysis
 GENERATE_POINTS_FROM_ELEV_GRID
 l CREATE_IMAGE - specifies whether a Lidar bin grid should be created as an image rather
 than a grid layer. Use CREATE_IMAGE=YES to create an image if possible, or CREATE_
 IMAGE=NO to create a grid. This is only applicable to the GRID_TYPE values that make
 sense as either a grid or image (i.e. INTENSITY, SCAN_ANGLE, etc.)
 l Lidar Point Filter Parameters
 See also "Lidar Advanced Filter Options" on page 142
 l Specify Bounding Box for Operation
 See also "Specify Bounds for Operation" on page 234
 l Cropping to Polygons/Areas
 See also "Cropping Operations to Polygons/Areas" on page 230
GENERATE_POINTS_FROM_ELEV_GRID
Creates a point feature at the center of each cell in the specified elevation grid layer(s).
The available parameters for the command include:
 l FILENAME - filename or layer description of the layer(s) to process. If an empty value, or
 "*", is passed in, all loaded elevation grid layers will be included, and a separate output
 layer will be produced for each input layer. This parameter can be listed more than once
 to specify multiple input files, like FILENAME="FILENAME_1" FILENAME-
 E="FILENAME_2".
 l LAYER_DESC - specifies the name to assign to the output layer. If no layer description is
 provided, a default name will be assigned. If more than one layer is being processed,
 this will be used as a suffix on the automatically generated layer name.
 l Specify Bounding Box for Operation
 See also "Specify Bounds for Operation" on page 234
 l Cropping to Polygons/Areas
 See also "Cropping Operations to Polygons/Areas" on page 230
Example:
GENERATE_POINTS_FROM_ELEV_GRID FILENAME="elev_grid.gmg" \
LAYER_DESC="grid_points" \
POLYGON_CROP_FILE="CropAreas.shp" POLYGON_CROP_USE_ALL=YES
 - 126 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 EDIT_LIDAR
Lidar Analysis
 EDIT_LIDAR 127
 DEFINE_LIDAR_FILTER 128
 LIDAR_CLASSIFY 130
 LIDAR_CLASSIFY_GRAPH 134
 SPECTRAL_PARTITIONING 135
 LIDAR_COMPARE 137
 LIDAR_EXTRACT 139
 LIDAR_THIN 141
 Lidar Advanced Filter Options 142
 GENERATE_POINT_CLOUD 143
 LIDAR_APPLY_COLOR 147
 LIDAR_AUTO_FIT 148
 GENERATE_SSI 149
EDIT_LIDAR
The EDIT_LIDAR command provides a way to modify loaded Lidar point clouds. Lidar points can
be reclassified and marked as deleted, or moved to a new layer. The Lidar points to work on can
be specified by a bounding box or by proximity to other loaded Lidar and/or line features.
The following parameters specify how to define the Lidar points to search:
 l FILENAME - filename of the Lidar layer to update. If an empty value is passed in, all
 loaded Lidar layers will be updated. This parameter can be listed more than once to spe-
 cify multiple input files, like FILENAME="FILENAME_1" FILENAME="FILENAME_
 2". When running the script in the context of the main map view (including loading a
 workspace) you can also pass in the value 'USER CREATED FEATURES' to have the 'User
 Created Features' layer updated or 'SELECTED LAYERS' to have any layers selected in the
 Control Center updated.
 l LIDAR_FILTER_NAME - specify name of filter previously defined with DEFINE_LIDAR_
 FILTER command to apply to Lidar points to get list of points to search
The following parameters allow doing a proximity search near other loaded Lidar points or line
features. If no proximity search is specified, all Lidar points in the specified bounds will be oper-
ated on:
 l MAX_DIST - specifies the maximum distance (in meters) that a Lidar point can be from
 the nearest matching Lidar point or 3D line and still be part of the set of Lidar points to
 modify.
 l USE_3D_DIST - specifies whether the MAX_DIST allowed is a full 3D distance from the
 Lidar point to the other Lidar point or line, or if only a 2D distance search will be done. By
 - 127 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 DEFINE_LIDAR_FILTER
The following parameters specify what to do to the matching Lidar points, such as reclassifying
them or marking them as deleted:
 l LIDAR_CLASS - specifies the name of the Lidar class to apply to all matching Lidar points.
 This can either be the Lidar class number or the name of the Lidar class displayed in the
 user interface. For example, to set all points to type 2 (ground), use LIDAR_CLASS=2 or
 LIDAR_CLASS="Ground". This option requires a Global Mapper Pro license.
 l DELETE_FEATURES - specifies whether or not to mark all matching features as deleted.
 Use DELETE_FEATURES=YES to enable.
 l NEW_LAYER_NAME - Indicates the name of the layer where the matching Lidar points
 will be copied to. A new layer is always created, even if there is already a layer loaded
 with the specified name.
 l NEW_LAYER_PROJ - special Projection Specification indicating the projection to be used
 in the new layer. If this parameter is not specified, then the new layer will use the native
 projection of the matching points (if all the same), or the current global projection.
 l Specify Bounding Box for Operation
 See also "Specify Bounds for Operation" on page 234
SAMPLE
// Define a Lidar filter for all points
DEFINE_LIDAR_FILTER NAME="LidarFilter_Vegetation" LIDAR_FILTER="3,4,5"
DEFINE_LIDAR_FILTER NAME="LidarFilter_Building" LIDAR_FILTER="6"
// Move all vegetation points within 2 meter of building points to new layer (mark as deleted in
original layer)
EDIT_LIDAR FILENAME="*" LIDAR_FILTER_NAME="LidarFilter_Vegetation" \
NEW_LAYER_NAME="Veg within 2m of Building" DELETE_FEATURES="YES" \
LIDAR_FILTER_NEAR_NAME="LidarFilter_Building" MAX_DIST="2.0" USE_3D_DIST="YES"
DEFINE_LIDAR_FILTER
The DEFINE_LIDAR_FILTER command provides a way to define a Lidar point filter for use in later
commands, like EDIT_LIDAR. The following parameters can be used for this command:
 l NAME - specifies the name for the filter
 l LIDAR_ELEV_RANGE - specifies the range of elevations to include in the grid in meters. By
 default all elevations are gridded, but if you want to restrict values to say 50m - 150m,
 you could add LIDAR_ELEV_RANGE="50,150".
 - 128 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 DEFINE_LIDAR_FILTER
l 1 - First Return
l 2 - Second Return
l 3 - Last Return
l 4 - Single Return
 - 129 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 LIDAR_CLASSIFY
SAMPLE
// Define a Lidar filter for all points
DEFINE_LIDAR_FILTER NAME="LidarFilter_Vegetation" LIDAR_FILTER="3,4,5"
DEFINE_LIDAR_FILTER NAME="LidarFilter_Building" LIDAR_FILTER="6"
// Move all vegetation points within 2 meter of building points to new layer (mark as deleted in
original layer)
EDIT_LIDAR FILENAME="*" LIDAR_FILTER_NAME="LidarFilter_Vegetation" \
NEW_LAYER_NAME="Veg within 2m of Building" DELETE_FEATURES="YES" \
LIDAR_FILTER_NEAR_NAME="LidarFilter_Building" MAX_DIST="2.0" USE_3D_DIST="YES"
LIDAR_CLASSIFY
The LIDAR_CLASSIFY command allows for automatically identifying and classifying ground-shot
or building/high vegetation points from Lidar point clouds. The following parameters are sup-
ported by the command:
 l FILENAME - filename or description of loaded layer(s) to classify Lidar points in. This para-
 meter can be listed more than once to specify multiple input files, like FILENAME-
 E="FILENAME_1" FILENAME="FILENAME_2".
 l TYPE - specifies what type(s) of points to classify. If you don't provide a TYPE parameter
 only ground points will be classified. To classify multiple types, provide a comma-sep-
 arated list, like TYPE="GROUND,NONGROUND,POWERLINE". The following values are
 valid:
 l GROUND - classify ground shot points.
 have classified ground points for the building/tree classification to work properly.
 l POLE - classify pole points.
l POWERLINE - classify powerline vegetation points. Note you must already have
 of the native spacing for the point cloud, use a negative value (-). For example, to get a
 spacing of 0.6 meters, use GRID_BIN_SIZE="-0.6".
 l LIDAR_RESET_GROUND - specifies that any points that are already marked as ground
 should be reset to unclassified to start the process. Add LIDAR_RESET_GROUND=YES to
 reset the points.
 l LIDAR_CURVATURE - specifies the minimum height differential (curvature) in meters for
 the first pass of the MCC algorithm. The default is LIDAR_CURVATURE="0.3".
 l LIDAR_MAX_HEIGHT_DELTA - specifies the maximum height difference to consider as
 still possibly ground when removing points that are likely non-ground (i.e. buildings or
 vegetation) using a morphological filter before running the MCC algorithm to find ground
 points. You can provide a value of 0 to skip the morphological filter altogether and just
 run the MCC algorithm.
 l LIDAR_SLOPE - specifies the slope in degrees that is close to the expected steepest slope
 in the region being classified. This is used by the morphological filter which removes likely
 non-ground points before running the MCC algorithm to find ground points.
 l LIDAR_MAX_BUILDING_WIDTH - is a value specified in meters to help remove large build-
 ing areas from the ground classification. This filter compares the local minimum to neigh-
 bors in progressively larger areas building to the specified maximum building width.
 - 131 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 LIDAR_CLASSIFY
l NOISE_BIN_SIZE - specifies how many native spacings in size to make each bin initially for
 the noise classification algorithm. The noise classification algorithm identifies points that
 are far outside the normal range in a local area of the point cloud. This value will typically
 be large, like NOISE_BIN_SIZE=128, to consider local areas that are 128 times the
 nominal point spacing in each direction.
l LIDAR_RESET_NOISE - specifies that any points that are already marked as noise should
 be reset to unclassified to start the process. Add LIDAR_RESET_NOISE=YES to reset the
 points.
l LIDAR_RESET_CLASSIFIED - controls whether or not points that are already classified can
 be identified and marked as noise points. Add LIDAR_RESET_UNCLASSIFIED=NO to only
 check unclassified points for noise.
l NOISE_STD_DEV - specifies how many standard deviations above or below the mean for
 an area that a point elevation needs to be in order to be considered noise. Default is
 NOISE_STD_DEV=3.0.
l LIDAR_ELEV_RANGE - specifies that any points with elevations outside of a specified
 range should be marked as high or low noise. To specify a range of acceptable values in
 meters, specify the minimum allowed elevation followed by a comma and the maximum
 allowed elevation. For example, if you want to mark everything outside the range 50m -
 150m as noise, you could add LIDAR_ELEV_RANGE="50,150".
l LIDAR_HEIGHT_RANGE - specifies that any points with height above ground outside of a
 specified range should be marked as high or low noise. To specify a range of acceptable
 values in meters, specify the minimum allowed height followed by a comma and the max-
 imum allowed height. For example, if you want to mark everything more than 2 meters
 below the ground surface as low noise and everything more than 500m above the ground
 surface as high noise, use LIDAR_HEIGHT_RANGE="-2,500". The default value is
 LIDAR_HEIGHT_RANGE="-2,200".
l CHANGE_CLASS - specifies that any points that are identified as noise should have their
 classification changed. This defaults to on, so add CHANGE_CLASS=NO to disable.
l MARK_WITHHELD - specifies that any points that are identified as noise should be
 marked as withheld. Use MARK_WITHHELD=YES to enable this behavior. By default this
 will be the opposite of the CHANGE_CLASS value.
l DELETE_FEATURES - specifies that any points that are identified as noise should be
 marked as deleted. This defaults to the same as the MARK_WITHHELD value. Explicitly
 add DELETE_FEATURES=YES to always mark noise as deleted or DELETE_FEATURES=NO to
 never mark as deleted.
l Specify Bounding Box for Operation
 See also "Specify Bounds for Operation" on page 234
l Lidar Advanced Filter Parameters
 See also "Lidar Advanced Filter Options" on page 142
 - 133 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 LIDAR_CLASSIFY_GRAPH
LIDAR_CLASSIFY_GRAPH
The LIDAR_CLASSIFY_GRAPH command allows for automatically identifying and classifying build-
ing/high vegetation points from Lidar point clouds using a segmentation method. The following
parameters are supported by the command:
 l FILENAME - filename or description of loaded layer(s) to classify Lidar points in. This para-
 meter can be listed more than once to specify multiple input files, like FILENAME-
 E="FILENAME_1" FILENAME="FILENAME_2".
 l TYPE - specifies what type(s) of points to classify. If you don't provide a TYPE parameter
 only ground points will be classified. To classify multiple types, provide a comma-sep-
 arated list, like TYPE="BUILDIN, HIGH_VEG". The following values are valid:
 l BUILDING - Classify building points
 l GRID_BIN_SIZE -specifies the gating distance for the local neighborhood used in principal
 component analysis. For example a value of GRID_BIN_SIZE="3.0" would make
 each local neighborhood 3 times the calculated native spacing of the point data. This is
 the same as the 'Neighborhood Range' setting within the dialog of the classification tool.
 If you want to specify a spacing in meters rather than as a multiple of the native spacing
 for the point cloud, use a negative value (-). For example, to get a spacing of 0.6 meters,
 use GRID_BIN_SIZE="-0.6".
 l LIDAR_RESET_NON_GROUND - specifies that any points that are already marked as one
 of the types being classified should be reset to unclassified at the start of the operation.
 Add LIDAR_RESET_NONGROUND=YES to reset the points.
 l LIDAR_MIN_HEIGHT - specifies the minimum height above ground that a point has to be
 in order to consider it as a possible building or high vegetation point.
 l LIDAR_MAX_NUM_NEIGHBORS - Maximum number of neighbors used in principal com-
 ponent analysis. Allows for reduction in computational cost in the case that points are
 densely packed.
 l LIDAR_MAX_STD_DEV - Point-to-point associations used for clustering are limited to
 those that are within a specified statistical distance. This threshold reduces processing
 requirements and maintains the purity of clusters in the sense that it inhibits associations
 with points that have very different local neighborhood characteristics. A good value for
 this is generally around 3-4 with larger values required for data that is noisy, striped or
 has other measurement related problems. If this parameter is too small, then little or no
 clustering will happen and there will be a low probability of detection. If this parameter is
 too large, then clustering may be overly permissive and there will be a high probability of
 false alarm.
 l LIDAR_MIN_CLUSTER_SIZE - The minimum number of points required in a cluster based
 on similar principal component analysis statistics for the cluster to be classified.
 - 134 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 SPECTRAL_PARTITIONING
SAMPLE
GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL
LOG_MESSAGE Script <%SCRIPT_FILENAME%> started at %DATE% %TIME%
DEFINE_VAR NAME="LASFILE" VALUE="Augusta_LiDAR.laz"
DEFINE_VAR NAME="DATA_DIR" VALUE="C:\Users\ChrisSmith\src\GMTrunk\geoStats\test\data\"
SET_LOG_FILE FILENAME=".%LASFILE%.log" APPEND_TO_FILE=NO
IMPORT FILENAME="%DATA_DIR%%LASFILE%"
LIDAR_CLASSIFY FILENAME="%LASFILE%"\
TYPE=GROUND\
GRID_BIN_SIZE=3.0\
LIDAR_RESET_GROUND=YES\
LIDAR_CURVATURE=0.3\
LIDAR_MAX_HEIGHT_DELTA=50.0\
LIDAR_SLOPE=2.0
LIDAR_CLASSIFY_GRAPH FILENAME="%LASFILE%"\
GRID_BIN_SIZE=4.0\
TYPE=BUILDING,HIGH_VEG\
LIDAR_RESET_NON_GROUND=YES\
LIDAR_MIN_HEIGHT=2.0\
LIDAR_MIN_NUM_NEIGHBORS=3\
LIDAR_MAX_NUM_NEIGHBORS=64\
LIDAR_MAX_STD_DEV=3
LIDAR_EXTRACT FILENAME="%LASFILE%"\
GRID_BIN_SIZE=4.0\
TYPE=BUILDING\
LIDAR_MIN_POINTS_IN_PLANE=20\
LIDAR_MAX_DISTANCE_TO_PLANE=0.5\
LIDAR_MIN_FOOTPRINT_AREA_SQM=20\
LIDAR_PSEUDOMEASUREMENTS_AT_PLANAR_INTERSECTIONS=YES\
LIDAR_SIMPLIFICATION_EPSILON=1\
LIDAR_CREATE_FOOTPRINTS=YES\
LIDAR_CREATE_SIDEWALLS=YES\
LIDAR_CREATE_SEPERATE_ROOF_PLANES=YES\
LIDAR_CREATE_BUILDINGS_AS_MESH=YES\
LIDAR_COLOR_VERTICES=NO
SAVE_WORKSPACE FILENAME=".%LASFILE%.gmw"
SPECTRAL_PARTITIONING
The SPECTRAL_PARTITIONING command allows for automatic segmentation of points from lidar
point clouds using a spectral graph partitioning method. This automatic analysis tool breaks the
point cloud into segments based on the spatial and attribute relationships between points
returns in the point cloud. The following parameters are supported by the command:
 - 135 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 SPECTRAL_PARTITIONING
l FILENAME - filename or description of loaded layer(s) to classify Lidar points in. This para-
 meter can be listed more than once to specify multiple input files, like FILENAME-
 E="FILENAME_1" FILENAME="FILENAME_2".
l LIDAR_RESOLUTION - the distance parameter defining the size of a points local neigh-
 borhood which is averaged over to evaluate point attributes and similarity. The value of
 this parameter can range from 0.0001 to 1000.0
l LIDAR_RESOLUTION_UNITS - The units used to define the LIDAR_RESOLUTION. Accepted
 values are POINT SPACINGS, FEET, and METERS. The default value if not specified is
 LIDAR_RESOLUTION_UNITS="METERS"
l Attribute Specification - Select attributes used to evaluate the point to point similarity
 measure that informs spectral partitioning. Attributes of a point are based on statistics of
 a local neighborhood with extent defined by the resolution. Each attribute is accom-
 panied by a weight which determines its relative contribution to the point similarity meas-
 ure. All attributes except position are optional and will not be used if not specified. The
 weight range for each attribute is 0.0 to 1000.0
 l SPECT_PART_POSITION_WEIGHT - position refers to the X/Y/Z or Lat/Lon/El-
 evation position of each point return. This parameter is required positional rela-
 tionship between points will always be considered.
 l SPECT_PART_IS_CURVATURE and SPECT_PART_CURVATURE_WEIGHT- when
 same segment. A lower value will likely create fewer segments but the points in each will
 be more closely related. Accepted values range from 0 to 20.0
 l LIDAR_MIN_CLUSTER_SIZE - Minimum number of points a segment must have before
 being assigned a segment ID. Accepted values range from 1 to 100000
 l Specify Bounding Box for Operation
 See also "Specify Bounds for Operation" on page 234
 l Lidar Advanced Filter Parameters
 See also "Lidar Advanced Filter Options" on page 142
LIDAR_COMPARE
The LIDAR_COMPARE command supports the functionality of the Compare Point Cloud, Lidar
QC tool and the Find Duplicate Lidar tools. You can identify Lidar points that are different
between 2 sets of point clouds or compare the elevations from loaded Lidar point clouds to
loaded 3D control points. You can also adjust the Lidar points to match the control points. This
command also supports deletion of duplicate points. The following parameters are supported
by the command:
 l FILENAME - filename or description of loaded layer(s) of Lidar point clouds to compare to
 control point(s). This parameter can be listed more than once to specify multiple input
 files, like FILENAME="FILENAME_1" FILENAME="FILENAME_2". If not specified
 all loaded Lidar clouds will be used.
 l FILENAME2 - if provided, a comparison between the two sets of point clouds is done. The
 FILENAME2 parameter specifies the filename or description of loaded layer(s) of Lidar
 point clouds to compare to the layer(s) specified with the FILENAME parameter. This para-
 meter can be listed more than once to specify multiple input files, like FILENAME2-
 2="FILENAME_1" FILENAME2="FILENAME_2".
 l POINT_FILENAME - filename or description of loaded layer(s) with the 3D control point
 features. If not specified all loaded 3D point features will be used.
 l REPORT_FILENAME - if specified, the name of the text file (CSV format) to save a report
 to with each control point listed, along with information about the elevation difference at
 the point, the overall RMSE in meters, and a text reporting of the difference metrics.
 When recording the Lidar QC tool with the Script Builder, the REPORT_FILENAME para-
 meter will be added and automatically filled with the specified filepath if a report file was
 specified.
 l LAYER_DESC - specifies the description to use for the layer created when comparing
 point clouds. The new layer will contain the points that are different.
 l MAX_SEARCH_BIN_MULT - If comparing point clouds, this specifies the maximum dis-
 tance a point in the FILENAME2 cloud(s) can be from a point in the FILENAME cloud(s)
 before it is considered a new point. If comparing to control points, this specifies the max-
 imum distance from each control point to look for Lidar to get the Lidar point cloud
 height. This is a multiple of the native point spacing of the cloud. A negative value
 - 137 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 LIDAR_COMPARE
 indicates the distance in meters (like MAX_SEARCH_BIN_MULT=-0.5 for a 0.5m search dis-
 tance).
 l MAX_POINT_COUNT - specifies the maximum number of points to consider in the point
 cloud for getting the height at each location. A value of 0 means that only the search dis-
 tance is considered. Otherwise, to just consider the 3 nearest points within the search
 radius, use MAX_POINT_COUNT=3.
 l FIT_POINTS - if FIT_POINTS=YES is provided, the elevation of the Lidar points will be
 adjusted to match the control point elevations. When recording the Lidar QC tool with
 the Script Builder, FIT_POINTS=YES will be added if “Fit Lidar to Control Points” was run.
 l COMPARE_BOTH_DIRS - if COMPARE_BOTH_DIRS=YES is provided, it will enable the
 option to "Include Points From Both Point Cloud Sets Not In the Other" which enables the
 Reference to Source comparison to be generated in addition to the Source to Reference
 comparison.
 l DIFFERENCE_REPORT_WINDOWS - if DIFFERENCE_REPORT_WINDOW =YES is provided, it
 will enable the creation of a Difference Report that will open in 3 windows
 l DELETE_ORIGINALS - when set with the DELETE_DUPLICATES option also enabled, any
 points found in multiple input point clouds will be removed, leaving just the points that
 are different between the two point clouds.
 l DELETE_DUPLICATES - if set, Lidar points with the same 3D location (and optionally equal
 additional attributes specified with the DUPLICATE_ATTR parameter) are marked as
 deleted
 l DUPLICATE_ATTR - specifies the name of a Lidar attribute that must match to be con-
 sidered a duplicate. Multiple instances of the parameter can be provided. Without this
 parameter, DELETE_DUPLICATES deletes all duplicates with the same XYZ values. The fol-
 lowing values are recognized:
 l CLASS - classification code
l GPS_TIME - timestamp
l INTENSITY - intensity
SAMPLE
This script will compare and adjust loaded lidar to loaded vector point features, and generate a
comparison report in the same folder as the script:
LIDAR_COMPARE REPORT_FILENAME="%SCRIPT_FOLDER%report.csv" FIT_POINTS=YES
An example script to delete duplicates with the same XYZ location, intensity, and GPS time
looks like:
LIDAR_COMPARE DELETE_DUPLICATES=YES DUPLICATE_ATTR="INTENSITY" DUPLICATE_ATTR="GPS_TIME"
 - 138 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 LIDAR_EXTRACT
Example script that compares two point clouds to find changes and saves them to a new
changed points layer
LIDAR_COMPARE FILENAME="Augusta Original" FILENAME2="Augusta Modified" MAX_DIST="0.1" LAYER_
DESC="Changed Points"
LIDAR_EXTRACT
The LIDAR_EXTRACT command allows for automatically extracting building outlines, tree point-
s/outlines, and linear powerlines from classified Lidar point clouds. Building extraction requires
classified building points, tree extraction requires classified high vegetation points, and power-
line extraction requires classified powerline points. The following parameters are supported by
the command:
 l FILENAME - filename or description of loaded Lidar layer(s) to extract from. This para-
 meter can be listed more than once to specify multiple input files, like FILENAME-
 E="FILENAME_1" FILENAME="FILENAME_2".
 l GRID_BIN_SIZE - specifies how many native spacings in size to make each bin, or for build-
 ing extraction this is the gating distance for the local neighborhood used in principal com-
 ponent analysis. For example a value of GRID_BIN_SIZE="3.0" would make each
 square bin/ neighborhood 3 times the calculated native spacing of the point data. The
 default is GRID_BIN_SIZE="0.5" which queries the data at half of the native spacing. If
 you want to specify a spacing in meters rather than as a multiple of the native spacing for
 the point cloud, use a negative value. For example, to get a spacing of 0.6 meters, use
 GRID_BIN_SIZE="-0.6".
 l TYPE - specifies what type of features to extract. If you don't provide a TYPE parameter
 all types will be extracted. The following values are valid:
 l ALL - extract all types
l BUILDING - extract building/ roof outlines. Note you must already have classified
 - 139 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 LIDAR_EXTRACT
 tices that do not move the original boundary further than the specified LIDAR_
 SIMPLIFICATION_EPSILON value. Cannot enable both LIDAR_REGULARIZE_
 FOOTPRINTS and LIDAR_SIMPLIFY_FOOTPRINTS.
 l LIDAR_SIMPLIFICATION_EPSILON - If LIDAR_SIMPLIFY_FOOTPRINT=YES, specify the
 corners become 90 degrees and opposite walls are parallel. Cannot enable both
 LIDAR_REGULARIZE_FOOTPRINTS and LIDAR_SIMPLIFY_FOOTPRINTS.
 l LIDAR_MIN_FOOTPRINT_AREA_SQM - Minimum footprint area required for extrac-
 - 140 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 LIDAR_THIN
LIDAR_THIN
The LIDAR_THIN command allows Lidar point clouds to be spatially thinned, either in 2D or 3D.
A full Lidar point, with all attributes, is kept for each cell that has a point.The following para-
meters are supported by the command:
 l FILENAME - filename or description of loaded Lidar layer(s) to spatially thin. This para-
 meter can be listed more than once to specify multiple input files, like FILENAME-
 E="FILENAME_1" FILENAME="FILENAME_2". If no FILENAME is provided, all
 loaded Lidar layers will be thinned.
 l LAYER_DESC - specifies the description to assign to the new point cloud layer. If not
 provided a default description will be assigned.
 - 141 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 Lidar Advanced Filter Options
 l GRID_BIN_SIZE - specifies the spacing that the data is thinned to as a multiple of the nat-
 ive spacing/resolution of the source Lidar point clouds. For example, GRID_BIN_SIZE=4
 would create a new point cloud at 1/4th of the native spacing. To specify the spacing in
 ground distance, use the SPATIAL_RES_METERS parameter instead.
 l SPATIAL_RES_METERS - specifies the spacing that the data is thinned to in meters.
 l ELEV_DIST - specifies the spacing in the Z direction that the data is thinned to in meters.
 Only applies if THIN_ALG="3D" is used. If not provided, the ELEV_DIST will be the same as
 the 2D spacing (from GRID_BIN_SIZE or SPATIAL_RES_METERS).
 l THIN_ALG - specifies the thinning algorithm that is used. The following values are sup-
 ported:
 l 3D (default): the Lidar point of median height is kept from each 3D cell (2D size
l MAX: the Lidar point of maximum height is kept from each 2D cell
l MED: the Lidar point of median height is kept from each 2D cell
 - 142 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 GENERATE_POINT_CLOUD
 or NONE to clear the filter, then add or remove stuff after that. For example, to specify a
 return filter with only unknown and first returns, use LIDAR_RETURN_FILTER-
 R="NONE,0,1". To get one with everything but the first return, use LIDAR_RETURN_
 FILTER="ALL,-1". The numeric values have the following meanings:
 l 0 - Unknown Returns
l 1 - First Return
l 2 - Second Return
l 3 - Last Return
l 4 - Single Return
GENERATE_POINT_CLOUD
The GENERATE_POINT_CLOUD command allows generating a Lidar point cloud and (optional)
3D PLY model from a set of overlapping images. The following parameters are supported:
 l IMAGE_FOLDER - specifies the folder containing the JPG images to use as input. You can
 use the RECURSE_DIR parameter to specify whether or not to check sub-folders for addi-
 tional images. Use the IMAGE_LIST parameter if you would instead prefer to specify a spe-
 cific set of images to use.
 - 143 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 GENERATE_POINT_CLOUD
l IMAGE_LIST - specifies the filename of the list of images to use. The value can either
 refer to a previously defined inline DEFINE_TEXT_FILE or a text file on disk. Each line
 should contain the filename to load.
l RECURSE_DIR - specifies whether or not the IMAGE_FOLDER path should be searched
 recursively for JPG images. By default this is enabled. Use RECURSE_DIR=NO to disable.
l FILENAME-A FILENAME parameter can be used to specify the name of a *.gmi2c file to
 use for all of the image files and default settings rather than specifying them in the com-
 mand. This would be the equivalent to the 'Load From File' option on the dialog.
l POINT_FILENAME - specifies the name of the output GMP (Global Mapper Package) file
 to create containing the generated point cloud (which is also automatically loaded). If no
 filename is provided the GMP is not automatically saved
l MESH_FILENAME - specifies the name of an output PLY file to generate with a 3D tex-
 tured mesh of the point cloud. Note this can take a long time to generate and may fail
 depending on your available system memory and the size of the data. No 3D model/mesh
 is generated if this is not provided.
l CREATE_CLOUD_FROM_MESH - this option produces a point cloud from the generated
 mesh. It is typically used to create a less noisy point cloud. Checking this option will gen-
 erate a mesh feature, whether it is saved as an output or not. This will increase the pro-
 cessing time. A point cloud can also be created from the saved mesh at a later point.
l LAYER_DESC - specifies the description to use for the generated point cloud layer. If not
 provided, 'Generated Point Cloud' be used as the default
l TAKE_OFF_ALT - allows specification of a base altitude to use to calculate the initial
 height of all images which know their height above the take-off altitude. If no units are
 included in the string, meters are assumed. Valid values look like TAKE_OFF_ALT="30 m"
 or TAKE_OFF_ALT="150 ft".
l CAMERA_MODEL - specifies the camera model type. Most cameras will use the default of
 PINHOLE_RADIAL_3. The following values are supported:
 l PINHOLE
l PINHOLE_RADIAL_1
l PINHOLE_RADIAL_3
l PINHOLE_BROWN_2
l PINHOLE_FISHEYE
 (default)
 l GLOBAL - performs a Global SfM process using the latest methods
 - 144 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 GENERATE_POINT_CLOUD
 l GLOBAL_THEN_INC - perform a Global SfM process to get camera poses, then does
 an Incremental on top of that for better results
 l INCREMENTAL_ORIG - performs an Incremental SfM process using the previous
l 1 - L1_ANGULAR
l 2 - LINFINITY_ANGULAR
l 3 - INVERSE_DEPTH_WEIGHTED_MIDPOINT
l 1 - P3P_KE_CVPR17
l 2 - P3P_KNEIP_CVPR11
l 3 - P3P_NORDBERG_ECCV18
l SFM_QUALITY - specifies how deeply the input images are examined looking for match-
 ing points. The following values are accepted:
 l NORMAL - search for a medium amount of points
l ULTRA - find maximum number of points. Takes the longest but results may be
 - 145 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 GENERATE_POINT_CLOUD
SAMPLE
This example prompts the user for an input *.gmp2p file, which can be saved from the Pixels to
Points dialog.
GLOBAL_MAPPER_SCRIPT
 - 146 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 LIDAR_APPLY_COLOR
LIDAR_APPLY_COLOR
The LIDAR_APPLY_COLOR command applies RGB(I) colors to points in a point cloud from a ref-
erence image. This command requires the LiDAR add-on license.
The command supports the following parameters:
 l FILENAME - specifies the LiDAR layer(s) to colorize. You can use * to use all loaded raster
 imagery layers. This is the default. This parameter can be listed more than once to specify
 multiple input files, like FILENAME="FILENAME_1" FILENAME="FILENAME_2".
 You can also pass in the description of the layer if it isn't based on a file, such as a layer
 created by the script. When running the script in the context of the main map view
 (including loading a workspace) you can also pass in the value 'USER CREATED FEATURES'
 to have the 'User Created Features' layer updated or 'SELECTED LAYERS' to have any lay-
 ers selected in the Control Center.
 l COLOR_LAYER - specifies the source raster image or elevation layer for color values. This
 parameter can be listed more than once to specify multiple input files. The default is to
 use all loaded raster image and elevation data.
 l APPLY_NIR - indicates whether to apply the NIR band in addition to RGB. Specify YES or
 TRUE, or list the parameter without a value to include NIR.
 l APPLY_TO_ALREADY_COLORED_LIDAR - indicates whether to apply colors to layers that
 already have colors. Specify YES or TRUE, or list the parameter without a value to over-
 write existing colors.
 l COLOR_INTENSITY - use this to set the intensity of the lidar points from the images. The
 following values are supported:
 l GRAY - set the intensity from the grayscale equivalent of the pixel color
 l BAND_EXPORT_SETUP - defines the raster bands to use for colors. Required if APPLY_NIR
 is TRUE. Use the following format to specify what band from what layer to use for a given
 export band: output_band?input_band?layer_filename . So for example to assign the 4th
 (infrared) band in an export from the 1st (red) band in a previously loaded file name
 C:\data\input_file.tif, use the following parameter: BAND_EXPORT_SETUP-
 P="4?1?c:\data\input_file.tif". Note that you would include a separate
 BAND_EXPORT_SETUP parameter for each output band that you want to setup. If you
 leave off the filename then you all loaded data will be considered as input, with just the
 input-to-output band assignment being updated.
 l NUM_BANDS - indicates the number of BAND_EXPORT_SETUP commands. Required if
 APPLY_NIR is TRUE.
SAMPLE
Here is an example for applying color to lidar from separate COLOR_LAYER image bands:
 - 147 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 LIDAR_AUTO_FIT
LIDAR_APPLY_COLOR FILENAME="V:\LIDAR\Vermont\USGS_LPC_VT_EasternVermont_L1_2014_EVT2837_LAS_
2017.laz" \
COLOR_LAYER="R:\Landsat8\LC80140292014203LGN00_B2.TIF" COLOR_
LAYER="R:\Landsat8\LC80140292014203LGN00_B3.TIF" \
COLOR_LAYER="R:\Landsat8\LC80140292014203LGN00_B4.TIF" BAND_EXPORT_
SETUP="1?1?R:\Landsat8\LC80140292014203LGN00_B2.TIF" \
BAND_EXPORT_SETUP="2?1?R:\Landsat8\LC80140292014203LGN00_B3.TIF" BAND_EXPORT_
SETUP="3?1?R:\Landsat8\LC80140292014203LGN00_B4.TIF" \
NUM_BANDS="3" APPLY_NIR="NO" APPLY_TO_COLORED_LIDAR="YES"
LIDAR_AUTO_FIT
The LIDAR_AUTO_FIT command provides a way to automatically fit one or more point clouds to
another set of one or more point clouds.
The following parameters are supported by the command:
 l FILENAME_TO_MOVE - filename or description of loaded layer(s) of Lidar point clouds to
 automatically fit to the other cloud(s). This parameter can be listed more than once to
 specify multiple input files, like FILENAME_TO_MOVE="FILENAME_1" FILENAME_
 TO_MOVE="FILENAME_2".
 l FILENAME_REF - filename or description of loaded layer(s) of reference Lidar point clouds
 to fit the FILENAME_TO_MOVE point cloud(s) to. This parameter can be listed more than
 once to specify multiple input files, like FILENAME_REF="FILENAME_1"
 FILENAME_REF="FILENAME_2".
 l TRANSLATE_ONLY - specifies whether the shift should only do a translate and not a full
 3D transform (including rotation and scale). The default is off, use TRANSLATE_ONLY=YES
 to enable only translation.
 l OUTLIER_XY_DIST - specifies the maximum XY distance to search (in meters) in for a
 nearest point. Default is 5 meters. You can include units in the string to specify non-
 meters values, like '10 ft'.
 l OUTLIER_Z_DIST - specifies the maximum Z distance to search (in meters) for a nearest
 point. Default is 40 meters. You can include units in the string to specify non-meters
 value, like '100 ft'.
 l MATCH_CLASS - specifies whether or not to only find nearest points of the same clas-
 sification. Default is off, use MATCH_CLASS=YES to enable.
 l THIN_BIN_MULT - specifies how much to thin the data to move for the nearest search.
 This is a multiple of the native point spacing of the cloud(s) to move. A negative value
 indicates the distance in meters (like THIN_BIN_MULT=-0.5 for a 0.5m search dis-
 tance), or you can include units in the value, like THIN_BIN_MULT="3.0 ft" for 3
 feet, or THIN_BIN_MULT="2.0 m" for 2 meters.
 l MIN_ERR_BIN_MULT - stop the process when the avg distance between the clouds is less
 than the given multiplier of Lidar points to move (default is 0.2). This is a multiple of the
 native point spacing of the cloud(s) to move. A negative value indicates the distance in
 meters (like MIN_ERR_BIN_MULT=-0.05 for a 0.05m search distance).
 - 148 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 GENERATE_SSI
 l ITER_STOP_BIN_MULT - stop the process when the improvement in avg distance since
 the last iteration is less than the given multiplier of Lidar points to move (default is 0.05)
 This is a multiple of the native point spacing of the cloud(s) to move. A negative value
 indicates the distance in meters (like MIN_ERR_BIN_MULT=-0.05 for a 0.05m search
 distance).
 l MAX_ITERS - maximum number of iterations to do before stopping if no other stop cri-
 teria are met. Default value is 20.
SAMPLE
This script will adjust the Lidar cloud 'SamMBESp2p" to the best-fit match to the cloud 'NLD':
LIDAR_AUTO_FIT FILENAME_REF="NLD" FILENAME_TO_MOVE="SamMBESp2p" \
TRANSLATE_ONLY="NO" OUTLIER_XY_DIST="10 ft" OUTLIER_Z_DIST="45 m" MATCH_CLASS="NO" \
THIN_BIN_MULT="3" MIN_ERR_BIN_MULT="0.05 m"
GENERATE_SSI
This command generates a Swath Separation Image (SSI) from load lidar point cloud data which
has overlapping flight lines. The output image will be a rendered intensity image of the data,
with the height differences in the overlap area shaded using an elevation shader and 50% blen-
ded with the underlying intensity image.
 l OUTPUT_FILENAME - the name of the image to create as output. The image format is
 determined by the extension.
 l FILENAME - the filename or description of a loaded Lidar point cloud layer to use as
 input. You can include multiple FILENAME parameters to specify multiple input layers.
 Wildcards are also supported. If no FILENAME is provided, all loaded Lidar point clouds
 inside the specified bounds will be used as input.
 l FLIGHT_LINES - specifies where the flight line information comes from. One of the fol-
 lowing values is supported:
 l POINT_SOURCE_ID - (default) each unique Point Source ID is treated as a separate
 flight line
 l LAYER - each point cloud layer is treated as a separate flight line
 l LOAD_OUTPUT - This is enabled by default and will automatically import the generated
 swath separation image from the saved OUTPUT_FILENAME location. Use LOAD_
 OUTPUT=NO to disable.
 l GEN_PRJ_FILE - enabled by default to generated a projection file saved with the Swath
 Separation Image. Use GEN_PRJ_FILE=NO to disable.
 l GEN_WORLD_FILE - enabled by default. Use GEN_WORLD_FILE=NO to disable.
 l SHADER_NAME - specifies the name of the elevation shader to use when coloring the
 overlap elevation differences. If nothing is provided, the default 'Swath Separation Over-
 lap Difference (QL1 / QL2)' shader will be used.
 l LIDAR_FILTER - specifies a comma-separated list of lidar class numbers to enable or dis-
 able. Provide a minus sign to remove the type from the filter rather than add it. The filter
 - 149 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 GENERATE_SSI
 starts off with nothing in it if you provide a LIDAR_FILTER string, but you can add ALL to
 enable everything or NONE to clear the filter, then add or remove stuff after that. For
 example, to specify a class filter with only types 2 and 3 enabled, use LIDAR_FILTER-
 R="NONE,2,3". To get one with everything but classes 2 and 3, use LIDAR_FILTER-
 R="ALL,-2,-3". If no LIDAR_FILTER is provided then all types currently enabled in the
 shared global Lidar filter are used.
 l LIDAR_RETURN_FILTER - specifies a comma-separated list of lidar return types to enable
 or disable. Provide a minus sign to remove the type from the filter rather than add it. The
 filter starts off with the current filter settings, but you can add ALL to enable everything
 or NONE to clear the filter, then add or remove stuff after that. For example, to specify a
 return filter with only unknown and first returns, use LIDAR_RETURN_FILTER-
 R="NONE,0,1". To get one with everything but the first return, use LIDAR_RETURN_
 FILTER="ALL,-1". The numeric values have the following meanings:
 l 0 - Unknown Returns
l 1 - First Return
l 2 - Second Return
l 3 - Last Return
l 4 - Single Returns
SAMPLE
This script will create and load a Swath Separation Image for all the loaded lidar data:
GENERATE_SSI OUTPUT_FILENAME="%SCRIPT_FOLDER%ssi_script_out.tif" \
FLIGHT_LINES="POINT_SOURCE_ID" GEN_PRJ_FILE="NO" GEN_WORLD_FILE="NO" LOAD_OUTPUT="YES" \
 - 150 -
 Global Mapper Scripting Reference Section 9: Lidar Analysis
 GENERATE_SSI
 - 151 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 EDIT_VECTOR
EDIT_VECTOR
The EDIT_VECTOR command selects and modifies vector data. You can choose to update area,
line, and/ or point features with a single operation. You can also supply multiple COMPARE_STR
parameters to apply multiple criteria, all of which must be true, in order to edit a feature.
It allows you to assign feature types (classifications), add/update attributes and display labels,
and reshape or delete features based on one or more attribute or label values.
The following parameters are supported by the command:
 - 152 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 EDIT_VECTOR
 you have an attribute named CFCC and you want to match when the value of that
 attribute starts with an 'A', you can use COMPARE_STR="CFCC=A*" as your para-
 meter. Note that when you use a wild card, only the "=" and "!=" comparison oper-
 ators will result in a successful match.
 l Instead of testing a specific attribute name, you can test whether any attribute in a
 feature has a particular value. To do this, use "<Any Attribute>" as the attribute
 name. For example, COMPARE_STR="<Any Attribute>=1" will match all fea-
 tures that have an attribute containing the value "1". You can use any operator,
 and the comparison value can contain wildcards.
 l You can add multiple COMPARE_STR parameters to a single command to combine
 multiple criteria for your search. See "Attribute Name Values" on page 180 details
 for other special allowed attribute names. Special attributes can only be used for
 "=" and "!=" comparisons.
 l CASE_SENSITIVE - specifies whether or not text comparisons are case sensitive or not.
 Use CASE_SENSITIVE=YES to enable, by default comparisons are not case sensitive.
 l ATTR_EXISTS and ATTR_MISSING - specialized instances of COMPARE_STR that allow you
 to select features based on whether or not an attribute exists. For example, use ATTR_
 EXISTS="CFCC" to select features that have an attribute called CFCC, or ATTR_
 MISSING="CFCC" to select features that do not have an attribute called CFCC. ATTR_
 EXISTS and ATTR_MISSING parameters can be used more than once in an EDIT_VECTOR
 command, and can be combined with COMPARE_STR parameters.
 l COMPARE_OP - controls how multiple COMPARE_STR, ATTR_EXISTS, and ATTR_MISSING
 parameters are handled. The default is to require that all conditions be met to include a
 feature (an AND operation), but if you would like to match on a feature if at least one con-
 dition is met, use COMPARE_OP=ANY to specify that a logical OR operation should be
 used rather than an AND operator. You can explicitly add COMPARE_OP=ALL if you want
 a logical AND operation, but that is the default and it will work that way if you leave it off
 as well.
 l COMPARE_NUM - specifies that any comparisons that are done against numeric values
 should be numeric rather than alphabetic. Use COMPARE_NUM=YES to enable.
 original layer. If you use this parameter, but do not specify a value, then YES will be
 assumed.
 l NEW_LAYER_NAME - Indicates the name of the layer where the features will be created,
 copied or moved. If a layer with this name already exists, then that layer will be used, oth-
 erwise, a new layer will be created.
 l NEW_LAYER_PROJ - special Projection Specification indicating the projection to be used
 in the new layer. If this parameter is not specified, then the new layer will use the current
 global projection.
 - 154 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 EDIT_VECTOR
 attribute named DEPTH from the value of an attribute named Z, use ATTR_TO_COPY-
 Y="DEPTH=Z".
 l ATTR_REPLACE_STR - specifies the name of an attribute to replace text in, the text to be
 replace, and the new text. You can include multiple instances of this attribute to replace
 text in multiple attributes. For example, to replace the text 'Street' with 'St.' in an attrib-
 ute named 'ROAD_NAME', use ATTR_REPLACE_STR="ROAD_NAME=Street=St."
 in your command. To replace text in the feature label rather than an attribute, use
 <Feature Name> for the attribute name. To replace a new line character, use the escape
 sequence \n.
 l STYLE_ATTR - provides a style attribute to update. You can include multiple STYLE_ATTR
 parameters, one for each style attribute pair. See ASCII Field Options for a list of the sup-
 ported style attributes and values. For example to set all matching lines to a solid green
 pen 3 pixels wide, add the following: STYLE_ATTR="LINE_STYLE=SOLID"
 STYLE_ATTR="LINE_WIDTH=3" STYLE_ATTR="LINE_COLOR=RGB
 (0,255,0)"
 l ADD_COORD_ATTRS - specifies that X and Y attributes should be added with the X and Y
 coordinate values to the attribute list of any matching point features. For matching line
 features you will get attributes for the start and end points (START_X, START_Y, END_X,
 and END_Y).
Buffer Creation
The following parameters control creation of buffer areas around matching features:
 l BUFFER_DIST - explicit buffer radius parameter, in meters by default. e.g. BUFFER_
 DIST="5.0". You can also put units in string (like BUFFER_DIST="5.0 miles" or
 BUFFER_DIST="500 m"). Put space between distance and units.
 l BUFFER_DIST_END - explicit buffer radius parameter for radius at end of tapered buffer,
 in meters by default. e.g. BUFFER_DIST_END="3.0". You can also put units in string
 - 156 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 EDIT_VECTOR
 l INDIVIDUAL_CENTER - rotates each feature about the center of the feature inde-
 pendently.
 l Manually specified location - you can manually specify the X and Y coordinates to
 rotate about (in the projection of the layer being rotated), like ROTATE_ABOUT-
 T="45000.0,1356000.0"
l CREATE_LABEL_POINTS - specifies that a point feature should be created at the centroid-
 /label position of each matching area feature. Use CREATE_LABEL_POINTS=YES to enable.
 If you only want to match areas with a non-empty label also add COMPARE_STR-
 R="<Feature Name>=*".
l CREATE_VERTEX_POINTS - specifies that a point feature should be created at each vertex
 of the matching area and line features. Use CREATE_VERTEX_POINTS=YES to enable.
l CONNECT_ISLANDS - specifies that any matching area features with islands should have
 the islands connected to the outer area boundary to form a single vertex list. This is use-
 ful if you need to export the data for use in software that doesn't support area features
 with holes/islands in them. Use CONNECT_ISLANDS=YES to enable.
l SIMPLIFICATION - specifies a simplification threshold to use to simplify/reduce the match-
 ing area and line features. It can contain a horizontal threshold (e.g., SIMPLIFICATION-
 N="20") or both horizontal and vertical thresholds, separated by a blank (e.g.,
 SIMPLIFICATION="20 10").
 l The horizontal threshold specifies how far off a straight line (in the units of the cur-
 rent projection) that a point has to be before it is kept. Vertices that are this dis-
 tance or further from the straight line will be kept. Vertices that are closer than this
 distance from the straight line will be discarded.
 l The vertical threshold applies only to 3D data, and will be applied to the vertex elev-
 ations. If the calculation exceeds the threshold, then the vertex will be kept.
 l By default, the vertical threshold is treated as elevation (in the vertical unit of the
 data). This specifies a threshold for the elevation difference between vertices. If
 the elevation difference is greater than or equal to the threshold, the vertex will be
 kept.
 l If you include the VERT_THRESH_IS_SLOPE parameter, the vertical threshold will be
 treated as slope, in degrees. This indicates a threshold for the slope difference
 between vertices. Each calculation involves three points (A, B, and C). If the dif-
 ference between slope AC and slope AB exceeds the threshold, and the difference
 between slope AC and slope BC exceeds the threshold, then the point will be kept.
l CONVERT_AREAS_TO_LINES - specifies that any matching area features will have new
 line features created from them. Use CONVERT_AREAS_TO_LINES=YES to enable this
 functionality. By default each matching area and all islands/holes in that area will have
 lines created for them (the islands will get an ISLAND=Y attribute), but you can add
 IGNORE_ISLANDS=YES to just create lines from the parent areas.
l LINE_FROM_POINTS - creates lines from point features based on distance, similar to how
 it is done in the UI with the digitizer > Advanced Feature Creation Options > Create New
 - 158 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 EDIT_VECTOR
 Line From Points > Enter the maximum distance. Example: "EDIT_VECTOR LINE_FROM_
 POINTS=75" will turn points that are within 75 meters of each other into lines.
l CREATE_POINTS_ALONG_FEATURES - creates points along area or line features at a spe-
 cified distance interval, or creates a certain number of points spaced evenly on a feature.
 The value is the distance in meters. If the value is negative, it represents the number of
 points to create.
 l LABEL_START_NUM - the starting number for new point labels. Point labels will
 start with this number on each feature. Value must be a number, greater than zero.
 l KEEP_END_POINT - When processing the RESAMPLE_FEATURES, CREATE_POINTS_
 PERP_LINES_ALONG_FEATURES parameter.
l INSERT_VERTICES_AT_INTERSECTIONS - specifies that new vertices will be inserted at
 the intersection of any matching line features. Use INSERT_VERTICES_AT_
 INTERSECTIONS=YES to enable this functionality.
l SPLIT_AT_INTERSECTIONS - specifies that any matching line features that share an
 interior vertex will be split at that vertex into new lines. Use SPLIT_AT_
 INTERSECTIONS=YES to enable this functionality. Use this in conjunction with the INSERT_
 VERTICES_AT_INTERSECTIONS option to insert vertices at intersections and then split the
 lines there. The INSERT_VERTICES_AT_INTERSECTIONS option is enabled by default if
 SPLIT_AT_INTERSECTIONS is enabled (v16.1.2 and later). Add INSERT_VERTICES_AT_
 INTERSECTIONS=NO if you only want to split at existing vertices.
 - 159 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 EDIT_VECTOR
l PTS_AT_INTERSECTIONS - specifies that new point features will be created wherever two
 or more matching line features touch. Use PTS_AT_INTERSECTIONS=YES to enable.
l UNIQUE_ID_BASE - specifies a number to start assigning unique IDs to features that
 match the query. For example, using UNIQUE_ID_BASE=1 would assign ID attributes
 to each matching feature starting at 1 and increasing sequentially (i.e. 1, 2, 3, etc.).
l SMOOTH_FEATURES - specifies that matching area and line features should be
 smoothed. Use SMOOTH_FEATURES=YES to enable.
l CREATE_COVERAGE_AREAS - specifies that a new layer with coverage areas for all match-
 ing features should be created. Use CREATE_COVERAGE_AREAS=YES to enable.
l COVERAGE_SMOOTHING_FACTOR - specifies a smoothing factor to use when creating
 the coverage areas to control how tightly shrink-wrapped around the vector features the
 area is. The default value is 1.0, but any value greater than 0 is allowed, with larger val-
 ues resulting in more smoothing.
l CREATE_SKELETON_LINES - specifies that skeleton lines for the matching area features
 should be created and added to a new layer. The layer description will be the area layer
 description with "Skeleton Lines" appended to it. Use CREATE_SKELETON_LINES=YES to
 enable.
l REMOVE_ISLANDS - specifies that any areas with islands/holes should be chopped up to
 remove the islands. The original area will be marked as deleted and the new island-less
 areas added to the same layer. Use REMOVE_ISLANDS=YES to enable this behavior.
l POINT_LAYER_TO_SPLIT_AGAINST - specifies the full path and filename or description of
 a loaded point layer to use to split matching line features. The closest line to each point
 in the layer will be found and (if closer than MAX_DIST) will be split at the location that
 the point snaps to.
l CALC_LIDAR_STATS - uses loaded point cloud data to calculate elevation and intensity
 statistics for all area and closed line features that meet the selection criteria. It can be
 used in combination with the following parameters: ELEV_ATTR.
l CALC_LIDAR_STATS - specifies the full path and filename or description of a loaded point
 layer to use to split matching line features. The closest line to each point in the layer will
 be found and (if closer than MAX_DIST) will be split at the location that the point snaps
 to.
l MAX_DIST - uses loaded point cloud data to calculate elevation and intensity statistics for
 all area and closed line features that meet the selection criteria. It can be used in com-
 bination with the following parameters:ELEV_ATTR.
l SPLIT_MESHES- split mesh features. Default of SPLIT_MESHES=XYZ will split the mesh by
 XYZ islands. Use SPLIT_MESHES = UV to instead split by texture coordinates.
l FIX_INVALID - specifies that invalid polygon geometries should be found and, if possible,
 fixed. Add FIX_INVALID=YES to enable this.
l Specify Bounding Box for Operation
 See also "Specify Bounds for Operation" on page 234
 - 160 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 GENERATE_LABEL_LAYER
SAMPLES
Here is an example illustrating how to move features with a CLASS attribute with a value of '1'
to a new layer named 'Major Highways':
EDIT_VECTOR MOVE_TO_NEW_LAYER=YES NEW_LAYER_NAME="Major Highways" \
 COMPARE_STR="CLASS=1"
Here is an example illustrating how to add evenly spaced points every 200 meters along the fea-
tures containing a CLASS attribute with a value of '1'. Point features will also be created at the
end point, and at each current vertex:
EDIT_VECTOR CREATE_POINTS_ALONG_FEATURES=200 COMPARE_STR="CLASS=1" \
 KEEP_END_POINT=YES KEEP_ORIGINAL_VERTICES=YES
Here is an example illustrating how to add evenly spaced perpendicular lines, 50 meters long,
every 250 meters along the features containing a CLASS attribute with a value of '2'. Line fea-
tures will also be created at the end point:
EDIT_VECTOR CREATE_PERP_LINES_ALONG_FEATURES=250 PERP_LINE_LENGTH=50 COMPARE_STR="CLASS=2" \
 KEEP_END_POINT=YES
Here is a sample script demonstrating applying elevations to all loaded vector data from all
loaded terrain:
GLOBAL_MAPPER_SCRIPT VERSION=1.00
// Apply elevations from all loaded terrain layers to all loaded vector layer.
// Do NOT add elev values to existing values and do NOT include unit suffix.
// If the data already has an existing elevation, do NOT replace it
// Assign elevations for points to the ELEV_1 attribute rather than ELEVATION
EDIT_VECTOR APPLY_ELEVS=YES ADD_EXISTING_ELEV=NO INC_UNIT_SUFFIX=NO \
REPLACE_EXISTING=NO ELEV_ATTR="ELEV_1"
For more examples of how to use the EDIT_VECTOR command, see the sample at the bottom of
this document.
GENERATE_LABEL_LAYER
Overview
 l FILENAME - required parameter that identifies the loaded layer that will be the source for
 the label layer.
 l GROUP_LABEL_LAYER_WITH_SOURCE - indicates whether or not to put the label layer
 and its source layer into a new group in the Control Center.
 l LABEL_FIELD - specifies the name of the attribute field to use as the label attribute for the
 features in the file. By default the attribute-based labeling will only be applied to those
 features that don't already have a label, but if the LABEL_FIELD_FORCE_OVERWRITE
 attribute is set to YES then all features will have their labels replaced. If you want to build
 the label from multiple attributes, separate them with '>+<' in the file, like LABEL_
 FIELD='RD_PREFIX>+<RD_NAME>+<RD_SUFFIX'.
 - 161 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 COMBINE_LINES
 l LABEL_FIELD_SEP - specifies the attribute separator to use when building a label from
 multiple attributes. This can be any character(s). For example LABEL_FIELD_SEP='-
 ' will insert a dash between each attribute. Use hex codes to add any non-printable char-
 acters, such as LABEL_FIELD_SEP='0x20' to add a space.
 l LABEL_CUSTOM_DEF - specifies a custom free-form string describing how to form the dis-
 play labels for this layer. This can include embedded attribute values as %ATTR_NAME%.
 l LABEL_FIELD_FORCE_OVERWRITE - specifies that the LABEL_FIELD or LABEL_CUSTOM_
 DEF attribute value should be applied to all feature labels, not just those that don't
 already have labels. Use LABEL_FIELD_FORCE_OVERWRITE=YES to enable.
 l SHOW_LABELS - specifies whether or not labels are shown for features in this layer,
 assuming they would be otherwise shown. The default is SHOW_LABELS=YES. Use
 SHOW_LABELS=NO to disable the display of labels for this layer regardless of other set-
 tings.
 l LABEL_PREFIX - specifies the prefix to prepend to attribute-based labels
 l LABEL_SUFFIX - specifies the suffix to append to attribute-based labels
 l LABEL_FORMAT_NUMBERS - specifies whether or not numeric attribute values should
 automatically have formatting applied to them. This is enabled by default. Use LABEL_
 FORMAT_NUMBERS=NO to disable numeric formatting and keep numeric values exactly
 as they are in the attribute list.
 l LABEL_PRECISION - value is an integer indicating the number of decimal digits to use.
 This applies to numeric labels.
 l LABEL_REMOVE_TRAILING_ZEROS - This removes the trailing zeros to the right of the
 decimal place in numeric labels. This can be specified by listing the parameter alone, or
 accepts boolean values.
 l LABEL_USE_SCIENTIFIC_NOTATION - Display the number in scientific notation. This
 accepts boolean values, or can be called by listing the parameter alone.
SAMPLE
GLOBAL_MAPPER_SCRIPT VERSION=1.00
IMPORT FILENAME="V:\SHP\maine\cnty24p.shp"
GENERATE_LABEL_LAYER FILENAME="V:\SHP\maine\cnty24p.shp" GROUP_LABEL_LAYER_WITH_SOURCE
COMBINE_LINES
The COMBINE_LINES command allows you to combine connected lines features based on one
or more attribute or label values. You can choose to combines in just a single loaded layer or in
all loaded vector layers. You can either create new line features from the connected lines, or
using the CREATE_AREAS_FROM_LINES parameter instead create new area features by con-
necting the lines into closed shapes. The newly created features will be placed in a new layer
and have the current projection. If creating lines, any lines that are connected to another line
will be marked as deleted. You can also supply multiple COMPARE_STR parameters to apply
multiple criteria, all of which must be true, in order for the lines to be considering for com-
bining.
The following parameters are supported by the command:
 - 162 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 COMBINE_LINES
 - 163 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 CROP_AREAS_TO_LINES
CROP_AREAS_TO_LINES
The CROP_AREAS_TO_LINES tool crops or splits areas based on line features. It uses the fol-
lowing parameters:
 l AREA_FILENAME - filename of the layer that contains the area features to be cropped. If
 an empty value is passed in, all loaded area features that meet the AREA_COMPARE_STR
 conditions will be used. When running the script in the context of the main map view you
 can also pass in the value 'USER CREATED FEATURES' to have the 'User Created Features'
 layer updated or 'SELECTED LAYERS' to have any layers selected in the Control Center.
 l AREA_COMPARE_STR - specifies a comparison operation to perform to see if an area fea-
 ture is one that needs to be cropped. The format is attr_name=attr_value or attr_name!-
 !=attr_value (for equals and not equals comparisons respectively). For example if you
 have an attribute named CFCC and you want to match when the value of that attribute
 starts with an 'A', you can use COMPARE_STR="CFCC=A*" as your parameter. You
 can add multiple AREA_COMPARE_STR parameters to a single command to combine mul-
 tiple criteria for your search. If you would like to compare against a feature label rather
 than an attribute, use <Feature Name> for your attribute name. To compare against a
 feature type name rather than an attribute, use <Feature Type> for your attribute name.
 To compare against the feature description, use <Feature Desc> for your attribute name.
 If you just want all lines features from the specified layer(s), just don't specify a
 COMPARE_STR value. You can also use <Feature Layer Name> to specify a match against
 a layer name that will support wildcards.
 l LIST_FILENAME - filename of the layer that contains the line features that will be used to
 crop the area features. If an empty value is passed in, all loaded line features that meet
 the LINE_COMPARE_STR conditions will be used. When running the script in the context
 of the main map view you can also pass in the value 'USER CREATED FEATURES' to have
 the 'User Created Features' layer updated or 'SELECTED LAYERS' to have any layers selec-
 ted in the Control Center.
 l LINE_COMPARE_STR - specifies a comparison operation to perform to see if a line fea-
 ture is one that will be used to crop the areas. The format is attr_name=attr_value or
 attr_name!=attr_value (for equals and not equals comparisons respectively). For example
 if you have an attribute named CFCC and you want to match when the value of that attrib-
 ute starts with an 'A', you can use COMPARE_STR="CFCC=A*" as your parameter. You
 can add multiple AREA_COMPARE_STR parameters to a single command to combine mul-
 tiple criteria for your search. If you would like to compare against a feature label rather
 than an attribute, use <Feature Name> for your attribute name. To compare against a
 feature type name rather than an attribute, use <Feature Type> for your attribute name.
 To compare against the feature description, use <Feature Desc> for your attribute name.
 If you just want all lines features from the specified layer(s), just don't specify a
 COMPARE_STR value. You can also use <Feature Layer Name> to specify a match against
 a layer name that will support wildcards.
 - 164 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 DEFINE_SPATIAL_OPERATION and BEGIN_SPATIAL_OPERATION
Feature Collection
New layers and sets can be created using assignment statements that resemble algebraic
expressions. They take the general form:
Expressions
An output layer or set is defined equal to an expression made up of one or more functions.
 - 165 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 Loading and Unloading Layers
Spatial Operations
Spatial operations output new geometry based on two input layers or sets, defined
inside the parenthesis. The inputs can be layers, listed in quotes, or sets listed
without quotes. The results[] parameter can be added as a third value to specify
the geometry type for the resulting layer of features.
 l INTERSECTION("layer1","layer2")
 The Intersection operation creates a new layer consisting of overlapping
 regions of the two input layers. New features receive attributes from both
 layers.
 l UNION("layer1","layer2")
 The Union operation creates a new layer consisting of all regions from the
 two input layers. Regions that overlap are split from their containing fea-
 tures. Attributes of non-overlapping regions will come from their original
 layer; attributes from overlapping regions will come from the features that
 participated in the overlap. UNION can also be executed on a single layer to
 find overlapping areas between the features in one layer, UNION("layer1").
 l DIFFERENCE("layer1","layer2")
 The difference operation subtracts "layer 2" from "layer 1".
 l SYMMETRICDIFFERENCE("layer1","layer2")
 A symmetrical difference finds all areas that are exclusively in one layer
 OR the other, but not in both.
Spatial Predicates
 - 166 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 Loading and Unloading Layers
 by the other feature. Overlap means partial coverage of the feature, i.e.
 some shared area and some non-shared area in both features.
 l TOUCHES("layer1","layer2")
 The Touches predicate returns the set of features from layer1 whose bound-
 ary intersects the boundary of a feature in layer2, but whose interiors do not
 overlap. The touches relationship is met when two features intersect, but the
 interiors of the features do not intersect.
 l CONTAINS("layer1","layer2")
 The Contains predicate returns the set of features from layer1 that wholly
 contain a feature from layer2. Contains is the opposite of within, i.e. feature
 A contains feature B if and only if feature B is within feature A.
 l EQUALS("layer1","layer2")
 The Equals predicate returns the set of features from layer1 that have an
 exact match with the geometry of a feature from layer2. This means the two
 boundaries, interiors and exteriors match.
 l WITHIN("layer1","layer2")
 The Within predicate returns the set of features from layer1 that are wholly
 contained by a feature from layer2. A feature is within another feature if the
 interiors of the features intersect, but the interior of the within feature does
 not intersect the boundary of the containing feature. The two features can
 share some boundary.
 l DISJOINT("layer1","layer2")
 The Disjoint predicate returns the set of features from layer1 that do not
 intersect with any features from layer2. A disjoint feature has no intersection
 between interior or boundary with another feature.
 l RELATE("layer1","layer 2","DE-9IM string")
 The Relate predicate returns the set of features from one layer using a DE-
 9IM formatting string to designate relations between the Inner, Outer and
 Boundary portions of pairs of geometries.
Results Type
This parameter can be added as a third value to any spatial operation or spatial pre-
dicate listed above to specify the geometry type for the resulting layer of features.
 l results[geometry type]
 Valid geometry types are points, lines, and areas. Multiple types can be listed
 separated by commas.
Feature Transforms
Transforms are used to create new geometries by transforming the original geo-
metries from a single layer in some way. Using a transform on a collection of geo-
metries creates new, separate geometries in a different collection.
 - 167 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 Loading and Unloading Layers
 l Spatial transforms are executed on groups of features within a layer. The fol-
 lowing grouping options are available:
 l grouping:none
 None will consider each feature as its own group, executing the spatial
 transform for each feature in the selected layer. This is the default if no
 grouping is specified in the transform.
 l grouping:partition("attribute list")
All will consider all the features in the layer as a single group.
Transforms
 l MBR("layer1" ,grouping:grouping)
 The MBR transform creates a minimum bounding rectangle for each feature
 in its collection.
 l BUFFER("layer1",distance:value, grouping:grouping)
 Creates a new layer of features buffering the feature collection by the spe-
 cified distance. Specify the distance with a numeric value in the defined
 DEFAULT UNITS or followed by the unit designation.
 l CENTER("layer1" ,grouping:grouping)
 The CENTER transform generates the center point of the MBR of each of the
 geometry groups.
 l CENTROID("layer1" ,grouping:grouping)
 The CENTROID transform generates the geometric center point of each of
 the geometry groups.
 l CIRCLE("layer1",radius:value, grouping:grouping)
 The CIRCLE transform generates a circle area of the given radius around the
 center point of each of the geometry groups. As a special case, a radius of
 zero generates a minimum enclosing circle around the group. Specify the
 radius with a numeric value in the defined DEFAULT UNITS or followed by
 the unit designation.
 l CONVEXHULL("layer1" ,grouping:grouping)
 The CONVEXHULL transform creates a convex hull from each area feature in
 its collection.
 l CONCAVEHULL("layer1",radius:value, grouping:grouping)
 The CONCAVEHULL transform generates a concave hull around each the
 - 168 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 Loading and Unloading Layers
Units
 l DEFAULT UNITS units
 The linear units to be used throughout the script can be specified with
 DEFAULT UNITS. Valid unit values are:
 l Meters: m, meter, meters, metre, metres
Layer Filters
These filters will create a new layer or subset of features based on the filter oper-
ation.
 l VALID("layer1")
 Creates a new feature collection of the valid features from the specified
 layer.
 l INVALID("layer1")
 Creates a new feature collection containing the invalid features from the spe-
 cified layer.
 l SELECTION
 Creates a new layer containing only the currently selected features. No layer
 can be specified with this operation. A geometry type filter can be added to
 this command ex: SELECTION[areas] to return only the selected areas in the
 new layer.
Filters
 - 169 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 Loading and Unloading Layers
Selection
Selection of features can be passed to the workspace. Note the following commands only have
a noticeable effect when using the option Run Script in the Context of the Main View in the
Script Processing dialog.
Manage feature selection using the following commands:
 l SELECT<feature collection> - Select features in the specified feature collection with the
 digitizer tool
 l SELECT ADD <feature collection> - Add features in feature collection to the current selec-
 tion
 l SELECT CLEAR- Clear the current selection
 l SELECT DELETE <feature collection> - Removes features in feature collection from current
 selection
Attribute Management
Spatial operations can be used to add, remove, or edit attributes for a feature collection. Oper-
ators ADD, DELETE, and RENAME are used to manage and change attributes.
 l <feature collection> attribute ADD <attribute-name = attribute-formula> - Adds a new
 attribute using the specified formula. To create a formula see the Formula Calculator
 l <feature collection> attribute DELETE <attribute-name> - Deletes an attribute for the set
 of features
 l <feature collection> attribute RENAME <attribute-name> <new-attribute-name> -
 Renames an attribute
Error Handling
When invalid geometries are found performing commands inside of expressions, the
ONERROR command specifies how to handle the errors. The default setting for scripts is to skip
invalid geometries, and not attempt to repair them first. That is, it is as if the script begins with
ONERROR SKIP
 l ONERROR GEOMETRY
 l SKIP- Skip invalid geometries
 - 170 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 END_DEFINE_SPATIAL_OPERATION
 l REPAIR - attempt to repair invalid geometries before acting on the main command.
 This can be combined with the above options determine what to do with geo-
 metries that are not reparable. For example: For example: ONERROR
 GEOMETRY SKIP REPAIR.
 l PAUSE - The PAUSE command is used to pause script operation and show a message to
 the user. The user will be prompted to either halt or continue the script operation. To spe-
 cify the message for the user, append a quote-delimited string to the command. For
 example: PAUSE ‘Intersection calculated’. The default message, if not specified, is “Exe-
 cution paused, continue?”.
END_DEFINE_SPATIAL_OPERATION
Paired with DEFINE_SPATIAL_OPERATION, END_DEFINE_SPATIAL_OPERATION, end the defin-
ition of an operation or series of operations.
END_SPATIAL_OPERATION
Paired BEGIN_SPATIAL_OPERATION, END_SPATIAL_OPERATION ends the operation definition
and runs the operation immediately.
RUN_SPATIAL_OPERATION
Workspaces and scripts can store various spatial operations. These are not run until the RUN_
SPATIAL_OPERATION command is performed.
 l SPATIAL_OPERATION_NAME - Run a spatial operation that has been previously defined
 by calling it by name.
SAMPLE
DEFINE_SPATIAL_OPERATION SPATIAL_OPERATION_NAME="intersectselect"
//Create a new layer named risk countaining countries the intersect the hurricane trajectory
Layer "risk" = INTERSECTS("countries.shp","hurricane")
//Select all feature in the new risk layer with the digitizer tool
SELECT "risk"
END_DEFINE_SPATIAL_OPERATION
RUN_SPATIAL_OPERATION SPATIAL_OPERATION_NAME="intersectselect"
GENERATE_DENSITY_GRID
The GENERATE_DENSITY_GRID command allows you create a new raster density grid layer
based on vector points or point cloud returns.
 - 171 -
 Global Mapper Scripting Reference Section 10: Edit Vector Data
 GENERATE_DENSITY_GRID
l FILENAME - Name of a vector point or Lidar layer. Can only specify one layer name.
l LAYER_DESC - Description for the new Density Grid layer.
l DENSITY_TYPE - This option allows you to specify whether a weighted-distance Gaussian
 distribution is used (this gives much prettier results) or a simple in-or-out of radius cal-
 culation is used. Required parameter. Valid values are GAUSSIAN, CIRCLE, and
 EPANECHNIKOV.
l RADIUS – Used to specify how far from a grid sample location a point can be and still be
 considered as part of the value. Include unit abbreviation, e.g., '8 ft' for 8 feet. If no unit
 specified, the default meters. If the radius is not specified, a default value will be cal-
 culated.
l CELLS_PER_RADIUS - When combined with the Search Radius, controls how large the
 pixels are in the resulting density grid. For example, if you have a search radius of 90
 meters and a 'Cells Per Radius' of 3, each pixel should end up 30 meters across. If not spe-
 cified, the default is 3.
l POPULATION_ATTR - This option allows you to control whether a simple point count or
 attribute value is used to compute the density grid. Default is to just count points.
l AREA_UNITS - Units of area measure. Valid values are ACRES, HECTARES, SQUARE MILES,
 SQUARE KILOMETERS, SQUARE METERS, and SQUARE FEET.
l SHADER_NAME - this sets the name of the shader to use when rendering the data for this
 layer.
 - 172 -
 Global Mapper Scripting Reference Section 11: Attribute Management
 ADD_MEASURE_ATTRS
Attribute Management
 ADD_MEASURE_ATTRS 173
 CALC_ATTR 174
 SAMPLE 175
 CALC_ATTR_FORMULA 175
 SAMPLE 176
 COPY_ATTRS 176
 SAMPLE 178
 GENERATE_REPORT 178
 JOIN_TABLE 178
 Attribute Name Values 180
See also "EDIT_VECTOR" on page 152 for additional attribute management options.
ADD_MEASURE_ATTRS
The ADD_MEASURE_ATTRS command allows you to add/update feature measure attributes to
all of the line and area features in a loaded vector layer.
The following parameters are supported by the command:
 l FILENAME - filename of the layer to update. If an empty value is passed in, all layers that
 were created by the script, such as those from a GENERATE_CONTOURS command, will
 be updated. When running the script in the context of the main map view (including load-
 ing a workspace) you can also pass in the value 'USER CREATED FEATURES' to have the
 'User Created Features' layer updated or 'SELECTED LAYERS' to have any layers selected
 in the Control Center.
 l AREA_UNITS - specifies the units to use when storing area measurements. The following
 values are supported:
 l ACRES
l HECTARES
l "SQUARE FEET"
l "SQUARE KILOMETERS"
l "SQUARE METERS"
l "SQUARE MILES"
 l DISTANCE_UNITS- specifies the units to use when storing linear distance measurements.
 The following values are supported:
 l METRIC - meters for shorter distances, kilometers for longer
 - 173 -
 Global Mapper Scripting Reference Section 11: Attribute Management
 CALC_ATTR
meters for distance. Use this if you want to numerically compare values
CALC_ATTR
The CALC_ATTR command allows you to calculate a new attribute value (or update the value
for an existing attribute) for features in a layer based on a source attribute (including things like
the feature label or type) and a second value. The second value can be a specified string or num-
ber, or the value from another attribute of the feature.
The following parameters are supported by the command:
 l FILENAME - filename of the layer to update. If an empty value is passed in, all loaded vec-
 tor layers will be updated. This parameter can be listed more than once to specify mul-
 tiple input files, like FILENAME="FILENAME_1" FILENAME="FILENAME_2".
 When running the script in the context of the main map view (including loading a work-
 space) you can also pass in the value 'USER CREATED FEATURES' to have the 'User
 Created Features' layer updated or 'SELECTED LAYERS' to have any layers selected in the
 Control Center If you don't pass anything in all vector layers will be operated on.
 l TYPE - specifies what type of operation to use when assigning the new attribute value.
 l COPY - copies the source attribute value into the new attribute
l ADD - numerically adds the second value to the source value and saves the result
 result into the new attribute. The SEP_STR parameter defined below is used to sep-
 arate the second value from the source.
 l PREPEND - prepends the second value (as a string) to the source value and saves
 the result into the new attribute The SEP_STR parameter defined below is used to
 separate the second value from the source.
 l NEW_ATTR - specifies the attribute value to create or update. See special Attribute Name
 parameter details.
 l SOURCE_ATTR - specifies the attribute value to start with when creating the new attrib-
 ute. See special Attribute Name parameter details.
 - 174 -
 Global Mapper Scripting Reference Section 11: Attribute Management
 CALC_ATTR_FORMULA
 l VALUE_ATTR - specifies the attribute value to use as the 2nd value of the calculation. See
 special Attribute Name parameter details.
 l VALUE - specifies the value to use as the 2nd value of the calculation. For numeric oper-
 ations this must be a number.
 l SEP_STR - specifies the string to use to separate the source attribute and 2nd value when
 appending or prepending text. If not provided the default is no separator at all.
SAMPLE
Here is a sample of creating a new elevation attribute in feet from an elevation attribute (ELEV_
M) in meters, including with an appended unit string.
GLOBAL_MAPPER_SCRIPT VERSION=1.00
// Create new ELEV_FT attribute with attribute in feet in any loaded layers
CALC_ATTR TYPE="MULTIPLY" NEW_ATTR="ELEV_FT" SOURCE_ATTR="ELEV_MT" VALUE="3.2808"
// Append the unit name to the new attribute
CALC_ATTR TYPE="APPEND" NEW_ATTR="ELEV_FT" SOURCE_ATTR="ELEV_FT" VALUE=" ft"
CALC_ATTR_FORMULA
The CALC_ATTR_FORMULA command allows you to calculate a new attribute value (or update
the value for an existing attribute) for features in a layer, based on a formula that may contain
numbers, strings or other attributes. A number of functions may be used as well.
The following parameters are supported by the command:
 l FILENAME - filename of the layer to update. If an empty value is passed in, all loaded vec-
 tor layers will be updated. This parameter can be listed more than once to specify mul-
 tiple input files, like FILENAME="FILENAME_1" FILENAME="FILENAME_2".
 When running the script in the context of the main map view (including loading a work-
 space) you can also pass in the value 'USER CREATED FEATURES' to have the 'User
 Created Features' layer updated or 'SELECTED LAYERS' to have any layers selected in the
 Control Center If you don't pass anything in all vector layers will be operated on.
 l NEW_ATTR - specifies the attribute value to create or update. See special Attribute Name
 parameter details.
 l CALC_MODE - specifies the way that formula operations are performed when data types
 are ambiguous. Possible values are:
 l AUTOMATIC - calculations are performed as numeric if the first operand is
 l FORMULA specifies the formula to be used to create the new attribute values. See the
 formula calculator reference documentation for details.
 - 175 -
 Global Mapper Scripting Reference Section 11: Attribute Management
 COPY_ATTRS
SAMPLE
Here is a sample of creating a new elevation attribute in feet from an elevation attribute (ELEV_
M) in meters, including with an appended unit string.
GLOBAL_MAPPER_SCRIPT VERSION=1.00
// Create new ELEV_FT attribute with attribute in feet in any loaded layers
CALC_ATTR_FORMULA NEW_ATTR="ELEV_FT" FORMULA="ELEV_MT * 3.2808"
// Append the unit name to the new attribute
 CALC_ATTR_FORMULA NEW_ATTR="ELEV_FT" FORMULA="ELEV_FT + ' ft'"
COPY_ATTRS
The COPY_ATTRS command copies one or more attributes from one layer of features to
another. The attributes are copied spatially between feature types, like copying point attributes
to the area features those points are contained in, etc. Not every combination of feature types
is supported for copying. If you choose a combination that is not supported (like LINES to LINES)
you will get an error message.
The following parameters are used by the COPY_ATTRS command:
 l LAYER1_FILENAME - full path and filename of the loaded vector layer to copy attributes
 from. You can also pass in the full description of the loaded layer to use in case you want
 to use a layer not loaded from a file. Wildcards (i.e. '*' and '?') are supported in the file-
 name, so to match all layers, use *.
 l FROM_TYPE - defines the type of features to copy attributes from. The following values
 are supported:
 l AREAS - copy attributes from areas
 l LAYER2_FILENAME - full path and filename of the loaded vector layer to copy attributes
 to. You can also pass in the full description of the loaded layer to use in case you want to
 use a layer not loaded from a file. Wildcards (i.e. '*' and '?') are supported in the file-
 name, so to match all layers, use *.
 l TO_TYPE - defines the type of features to copy attributes to. The following values are sup-
 ported:
 l AREAS - copy attributes to areas
 l ATTR_TO_COPY - specifies the name of an attribute to copy from the "from" features to
 the "to" features. You can include multiple instances of this parameter to copy multiple
 attributes. In addition to attribute names, you can specify <Feature Name> to copy the
 feature display label.
 l MAX_DIST - when copying from LINES to POINTS or POINTS to LINES, specifies the max-
 imum distance that a point can be from the closest line and still have the attributes
 copied.
 - 176 -
 Global Mapper Scripting Reference Section 11: Attribute Management
 COPY_ATTRS
 than one
 l ALL - copy the attributes of every area containing the point/line feature
l ALL_SORT - copy the attributes of every area containing the point/line feature. If
 there are multiple copies of the same attribute (including existing values), separate
 the values with a comma and sort them alphabetically. So if there are values of an
 attribute 'South St', '83 Pine', and 'Main', the result would be '83 Pine,Main,South
 St'. The sorting is done without regard to case.
 l FIRST - only copy the attributes of the topmost containing area to the point/line
 feature
l MULTI_POINT - specifies how to handle assigning attributes from POINTS to AREAS or
 LINES when there are multiple points inside a single area or near a line. The following val-
 ues are supported:
 l NONE - don't copy the attributes from any of the points in the area/line feature
l ALL - copy the attributes of every point in the area or near the line to the area/line
 feature
 l ALL_CLONE - if multiple exist clone the feature for each matching feature
l FIRST - (to AREAS only) only copy the attributes of the first point in the area to the
 area
 l CLOSEST - (to LINES only) only copy the attributes of the closest point to the line to
 the line
 l MIN - (to LINES only) use the minimum value of the attribute encountered
l MAX - (to LINES only) use the maximum value of the attribute encountered
l AREA_COVERAGE - specifies how covered a "to" area has to be by a "from" area for the
 attributes to be copied. The following values are supported:
 l COMPLETE - the "to" area has to be complete inside the "from" area
l PARTIAL - the "to" area has to be covered at least some by the "from" area
l CENTROID - the "to" area centroid has to be inside the "from" area. This option is
 the fastest but may result in some areas getting attributes that aren't covered at all
 if the centroid is outside of the "to" area.
 l MOST - the "to" area has to be at least half covered by the "from" area
l EQUAL_ATTR - specifies an attribute that must be equal between two features in order
 to be a possible match for copying other attributes. See special Attribute Name para-
 meter details for allowed attribute names. You can include multiple EQUAL_ATTR para-
 meters on a command to require multiple attributes be equal.
 - 177 -
 Global Mapper Scripting Reference Section 11: Attribute Management
 GENERATE_REPORT
SAMPLE
GLOBAL_MAPPER_SCRIPT VERSION="1.00"
/* Copy all loaded area attributes to the points in the area */
COPY_ATTRS LAYER1_FILENAME="*" FROM_TYPE="AREAS" LAYER2_FILENAME="*" TO_TYPE="POINTS"
GENERATE_REPORT
The GENERATE_REPORT command allows you to generate a CSV text report file on the data in
one or more loaded layers broken down by a particular attribute value, feature name, or type,
or just a single line report about all features. The report will include the count of area, line, and
point features matching the specified criteria as well as the total combined length of the line
features and combined covered area of the area features.
The following parameters are supported by the command:
 l OUTPUT_FILENAME - specifies the name of the text .csv file to write the report results to.
 l FILENAME - filename of the layer to generate the report for. If an empty value is passed
 in, all layers that were created by the script, such as those from a GENERATE_CONTOURS
 command, will be used to generate the report. This parameter can be listed more than
 once to specify multiple input files, like FILENAME="FILENAME_1" FILENAME-
 E="FILENAME_2". You can also pass in the value 'USER CREATED FEATURES' when run-
 ning a script in the context of the main map view or loading a workspace to have the
 'User Created Features' layer be used. If no FILENAME parameter is provided, the report
 will cover all available vector layers.
 l REPORT_ATTR - specifies what to use to divide up the report into categories. See special
 Attribute Name parameter details. If no REPORT_ATTR parameter is provided or the
 value is empty, only a single line concerning all matching features will be generated in the
 report. You can provide multiple REPORT_ATTR parameters if you want to group the res-
 ults by more than one attribute. For example you might want to separate by layer and
 type so you could add REPORT_ATTR="<Feature Layer Name>" and REPORT_
 ATTR="<Feature Name>".
 l COMPARE_STR - specifies a comparison operation to perform to see if a feature is one
 that needs to be included in the report. The format is attr_name=attr_value. For example
 if you have an attribute named CFCC and you want to match when the value of that attrib-
 ute starts with an 'A', you can use COMPARE_STR="CFCC=A*" as your parameter. You
 can add multiple COMPARE_STR parameters to a single command to combine multiple cri-
 teria for your search. See special Attribute Name parameter details for special attribute
 names to compare against.
 l CASE_SENSITIVE - specifies whether or not text comparisons are case sensitive or not.
 Use CASE_SENSITIVE=YES to enable, by default comparisons are not case sensitive.
JOIN_TABLE
The JOIN_TABLE command joins the attributes from a table file to the features of a loaded vec-
tor layer. The following parameters are supported
 - 178 -by the command:
 Global Mapper Scripting Reference Section 11: Attribute Management
 JOIN_TABLE
 file
 l KEEP_ALL_APPEND - keep all matching records from the join file, appending new
 of values will be sorted in ascending order. If all of the values are numbers, they
 will be sorted using a numeric sort, otherwise, they will be sorted using a text
 sort.
 l KEEP_ALL_APPEND_SORT_DESC - same as KEEP_ALL_APPEND, except that the list
 of values will be sorted in descending order. If all of the values are numbers, they
 will be sorted using a numeric sort, otherwise, they will be sorted using a text
 sort.
 l KEEP_ALL_COPY - keep all matching reords from the join file, but create new
 attribute values with a numeric suffix for the multiple entries. For example if there
 were 5 matching records with an ADDR attribute, you would get ADDR, ADDR2,
 ADDR3, ADDR4, and ADDR5 attributes added
 l COPY_FEATURE - create duplicate features for each record with a duplicate join
 attribute, one addition feature for each duplicate join attribute value
 l PROMPT - prompt the user for how to handle duplicates if encountered
l NO - abort the join if any duplicate records are encountered in the join file
 - 179 -
 Global Mapper Scripting Reference Section 11: Attribute Management
 Attribute Name Values
 - 180 -
 Global Mapper Scripting Reference Section 12: Raster Analysis
 APPLY_FORMULA
Raster Analysis
 APPLY_FORMULA 181
 APPLY_CONVOLUTION 182
 PAN_SHARPEN 183
 GENERATE_EQUAL_VAL_AREAS 185
 GENERATE_ROUGHNESS_GRID 186
 CREATE_MULTI_BAND 187
 RASTER_RECLASSIFY 187
APPLY_FORMULA
The APPLY_FORMULA command allows you to apply a mathematical formula to the bands in
one or more loaded raster layers to create a new raster or grid layer. This is useful for doing
things like NDVI or NDWI calculations from multi-spectral imagery, among a large array of other
multi-spectral analysis.
The following parameters are supported by the command:
 l FILENAME - filename of the layer(s) to use as input to the operation. You can use * to use
 all loaded raster imagery layers. This is the default. This parameter can be listed more
 than once to specify multiple input files, like FILENAME="FILENAME_1" FILENAME-
 E="FILENAME_2". When multiple bands are named in the FORMULA they will be
 assigned in the order the files are listed. In this case, B1 would represent FILENAME_1
 and B2 would represent FILENAME_2. You can also pass in the description of the layer if
 it isn't based on a file, such as a layer created by the script. When running the script in
 the context of the main map view (including loading a workspace) you can also pass in
 the value 'USER CREATED FEATURES' to have the 'User Created Features' layer updated
 or 'SELECTED LAYERS' to have any layers selected in the Control Center
 l LAYER_DESC - description to assign to the newly created layer
 l FORMULA - this free-form string describes the formula for a single band of the output.
 You would have a separate FORMULA parameter for each output band. So if you were
 creating a 3-band output you would have 3 separate FORMULA parameters. Each
 FORMULA parameter is a string that can either be the name of a pre-defined operation,
 like NDVI or NDWI, or a free-form equation definition. See formula reference doc-
 umentation for details. The bands default to the original source bands from the provided
 input layers, but you can use the NUM_BANDS, BAND_BIT_DEPTH, and BAND_EXPORT_
 SETUP parameters (described below) to customize which bands from which input layers
 are assigned to each band number variable in the formula.
 l OUTPUT_BIT_DEPTH - specifies the bit depth for the output band(s) (one for each
 FORMULA parameter). Valid values are 8, 16, or 32. If you don't specify this then you will
 - 181 -
 Global Mapper Scripting Reference Section 12: Raster Analysis
 APPLY_CONVOLUTION
 get 32-bit floating point values if the output is a single band grid and 8-bit per band for
 imagery output.
 l OUTPUT_GRID - specifies whether the output should be treated as a grid that is shaded
 using an "elevation" shader or as an imagery layer. Use OUTPUT_GRID=YES to make it a
 shaded grid.
 l NUM_BANDS - specifies how many bands of data to make available for input. If you don't
 specify a value for this the band count will be the maximum available for any of the
 loaded layers.
 l BAND_BIT_DEPTH - specifies how many bits to use for each band of data. If you don't spe-
 cify a value for this the highest bit depth of any of the input data layers will be used. The
 valid values are BAND_BIT_DEPTH=8, BAND_BIT_DEPTH=16, or BAND_BIT_DEPTH=32.
 l BAND_EXPORT_SETUP - allows you to override the default band assignment for the
 FORMULA parameters. Use the following format to specify what band from what layer to
 use for a given export band: <output_band>?<input_band>?<layer_filename> . So for
 example to assign the 4th (infrared) band in an export from the 1st (red) band in a pre-
 viously loaded file name C:\data\input_file.tif, use the following parameter: BAND_
 EXPORT_SETUP="4?1?c:\data\input_file.tif". Note that you would
 include a separate BAND_EXPORT_SETUP parameter for each output band that you want
 to setup. If you leave off the filename then you all loaded data will be considered as
 input, with just the input-to-output band assignment being updated.
SAMPLE
Here is an example script command showing how to apply a formula to all currently loaded ras-
ter layers.
GLOBAL_MAPPER_SCRIPT VERSION=1.00
APPLY_FORMULA FILENAME="*" OUTPUT_BIT_DEPTH="8" FORMULA="IF(B1<90, B1*0.765+20, B1)"
GLOBAL_MAPPER_SCRIPT VERSION=1.00
APPLY_FORMULA FILENAME="Layer1_Grid" Filename="Layer2_Grid" FORMULA="IF(B1=0,B2,B1)"
APPLY_CONVOLUTION
The APPLY_CONVOLUTION command allows you to create a new layer from an existing raster
or grid layer by applying a convolution filter (resampling method) to the layer.
The following parameters are supported by the command:
 l FILENAME - filename or layer description of the layer(s) to use as input to the operation.
 You can use * to use all loaded raster imagery layers. This is the default. This parameter
 can be listed more than once to specify multiple input files, like FILENAME-
 E="FILENAME_1" FILENAME="FILENAME_2". When running the script in the con-
 text of the main map view (including loading a workspace) you can also pass in the value
 'USER CREATED FEATURES' to have the 'User Created Features' layer updated or
 - 182 -
 Global Mapper Scripting Reference Section 12: Raster Analysis
 PAN_SHARPEN
SAMPLE
Here are example script commands showing how to apply a convolution filter to all currently
loaded raster layers.
GLOBAL_MAPPER_SCRIPT VERSION=1.00
APPLY_CONVOLUTION FILENAME="*" SAMPLING_METHOD="SHARPEN_3X3"
GLOBAL_MAPPER_SCRIPT VERSION=1.00
APPLY_CONVOLUTION FILENAME="*" CUSTOM_FILTER="1 2 1 2 4 2 1 2 1"
PAN_SHARPEN
The PAN_SHARPEN command fuses a lower resolution color/multi-band image with a higher res-
olution panchromatic (grayscale) image to create a new color/multi-band image at the same
detail as the pan image. This is often used with satellite-based imagery with a pan sensor at
double the resolution as the color/multi-spectral sensor. The result is a new color/multi-band
layer. In addition, all of the option parameters for the IMPORT command are also supported for
this command.
The following parameters are used by the PAN_SHARPEN command:
 l COLOR_LAYER - full path and filename of the color/multi-band layer to pan sharpen. You
 can also pass in the full description of the loaded layer to use in case you want to use a
 layer not loaded from a file.
 l PAN_LAYER - full path and filename of the panchromatic layer to use. You can also pass
 in the full description of the loaded layer to use in case you want to use a layer not
 loaded from a file.
 l LAYER_DESC - description to use for the new layer. If not provided, the description will be
 that of the color layer with (Pan Sharpened) appended.
 - 183 -
 Global Mapper Scripting Reference Section 12: Raster Analysis
 PAN_SHARPEN
 l ALGORITHM - specifies which pan sharpening algorithm will be used to perform the oper-
 ation. The following values are supported:
 l IHS - converts the color to the HSI (hue/saturation/intensity) colorspace, then
 replaces the intensity with the pan value. This is the default value.
 l BROVEY - uses the Brovey algorithm
l MEAN - uses a simple mean (average) of the pan value and each band for the new
 band value
 l WEIGHTS - provides a list of weight values to apply to each band in the color image. This
 should be a comma-delimited list of 3 (RGB) or 4 (RGBI) weights to apply. The weight
 order is red, green, blue, infrared. If not provided, each band will be equally weighted
 when calculating an initial intensity for the IHS and BROVEY algorithms. The ESRI
 algorithm uses a default weighting of "0.167,0.167,0.167,0.5" (i.e. half to infrared and
 equally divided amongst the rest). The weight values will automatically be normalized so
 they sum up to 1 for all used bands, so if you want to weight green at twice the other
 bands, you could use WEIGHTS="1,2,1,1".
 l SPATIAL_RES - specifies spatial resolution. Defaults to the minimum spatial resolution of
 the two layers if not specified. Should be formatted as x_resolution,y_resolution. The
 units are the units of the current global projection. For example, if UTM was the current
 global projection and you wanted to export at 30 meter spacing, the parameter/ value
 pair would look like SPATIAL_RES=30.0,30.0. You can also specify as a percentage
 of the default resolution by adding a percent. For example to get half the detail your
 double the spatial resolution value, so you would use SPATIAL_RES="200%,200%".
 l SPATIAL_RES_METERS - specifies spatial resolution to use in meters. The value in meters
 will automatically be converted to the curent view/export projection units. For example,
 to do an export at 2.0 meter spacing (or as close as you can get to that in the current
 units), use SPATIAL_RES_METERS=2.0, or to do an export at 1.0 meters in X by 1.5
 meters in Y, use SPATIAL_RES_METERS="1.0,1.5".
 l Specify Bounding Box for Operation
 See also "Specify Bounds for Operation" on page 234
SAMPLE
Example: Create a pan sharpened layer from 2 loaded 16-bit images:
 - 184 -
 Global Mapper Scripting Reference Section 12: Raster Analysis
 GENERATE_EQUAL_VAL_AREAS
GENERATE_EQUAL_VAL_AREAS
The GENERATE_EQUAL_VAL_AREAS command allows for the generation of areas for regions of
the same (or similar) color, elevation, or slope values from a loaded raster or elevation layer.
 l FILENAME - specifies the filename of the already loaded layer from which to generate the
 equal-value areas. This parameter can be listed more than once to specify multiple input
 files, like FILENAME="FILENAME_1" FILENAME="FILENAME_2".
 l LAYER_DESC - specifies the description to use for the layer
 l ATTR_NAME - specifies the name to use for the attribute holding the color, elevation, or
 slope that a particular area represents. If you leave this attribute off then no value attrib-
 ute will be saved with each area.
 l ATTR_FORMAT - specifies a custom format string for creating the color attribute. This
 would be a C-style string with either a single number parameter or 3 for separate red,
 green, and blue. Usually you wouldn't specify this and the default would then just be the
 same as ATTR_FORMAT="RGB( %3d, %3d, %3d )".
 l AREA_TYPE - specifies the name of the area type to assign to the area features. See the
 Area Styles tab of the Configuration dialog for a list of available type names.
 l EQUAL_COLORS (raster only) - specifies the color(s) to create areas for. If you don't
 provide one of more colors all colors are matched on. The color(s) should be specified as
 RGB(<red>,<green>,<blue>). For example, to create areas for white, use EQUAL_
 COLORS=RGB(255,255,255). Optionally, if the image that you are creating areas for
 uses a palette for the colors, you can specify a palette index in the following format:
 INDEX(<0-based palette index>). For example, to make the second color in the palette
 transparent, use EQUAL_COLORS=INDEX(1). You can provide more than one color to
 match on by providing a semi-color separated list, like EQUAL_COLORS="RGB
 (0,255,0);RGB(255,0,0)" to match on blue and red.
 l COLOR_DIST - specifies how far from an exact match each color channel of a color value
 must be to be considered the same. By default a value of 0 is used which means exact
 matches only. If you want to break the entire color range into say 4 ranges for each color
 channel, use something like COLOR_DIST=32 as that would allow colors up to 32 away
 from each color channel value to match to a color.
 l ELEV_DIST - specifies how far from an exact match (in meters) each value must be to be
 considered the same. By default a value of 0 is used which means exact matches only. If
 you want to say split into area groups 10 meters in size, use ELEV_DIST=5. This would
 give you areas with values between -5 and 5 meters, 5 and 15 meters, etc.
 l SLOPE_DIST - specifies how far from an exact match (in degrees) each value must be to
 be considered the same. By default a value of 0 is used which means exact matches only.
 - 185 -
 Global Mapper Scripting Reference Section 12: Raster Analysis
 GENERATE_ROUGHNESS_GRID
 If you want to say split into area groups 10 degrees in size, use SLOPE_DIST=5. This
 would give you areas with values between 0 and 10 degrees, 10 and 20 degrees, etc.
 l FORCE_RGB - specifies that the attribute value for a color-based area will always be the
 full RGB color and not a palette index/name if available. Use FORCE_RGB=YES to enable.
 l FIX_INVALID - specifies whether or not the resulting areas should be split up into pieces if
 any invalid (i.e. self-intersecting) pieces are created. Use FIX_INVALID=YES to force the
 invalid areas to be fixed.
 l Specify Bounding Box for Operation
 See also "Specify Bounds for Operation" on page 234
SAMPLE
This sample will generate equal-elevation areas of size 20 meters (10 meters on either side)
from the specified DEM layer and store the elevation values in an attribute named ELEV for
each area feature.
 GENERATE_EQUAL_VAL_AREAS FILENAME="C:\temp\export test\blue_springs_4_quads.dem" ELEV_
DIST=10.0 ATTR_NAME="ELEV"
GENERATE_ROUGHNESS_GRID
The GENERATE_ROUGHNESS_GRID command operates on loaded raster data to generate a
Roughness Grid layer.
 l FILENAME - specifies the filename of the already loaded layer from which to generate the
 equal-value areas. This parameter can be listed more than once to specify multiple input
 files, like FILENAME="FILENAME_1" FILENAME="FILENAME_2".
 l LAYER_DESC - specifies the description to use for the layer.
 l ROUGHNESS_TABLE - the table used to create the grid. Supports all of the current built-in
 tables, and custom tables. Reference a custom table by typing the name exactly as it
 appears in the roughness_tables.txt file. Reference the standard tables by using one of
 the following values CORINE_SUMMER, CORINE_WINTER, VCF, NLCD, GLOBCOVER_ESA_
 2009, GLOBCOVER_ESA_2020, GLOBELAND30, or ESA_CCI.
 l CREATE_EQUAL_ROUGHNESS_AREAS - indicates whether to create area features from
 adjacent grid cells with the same roughness value. Default is NO.
 l SHADER_NAME - name of the shader to be applied to the generated layer.
 l FIX_INVALID - specifies whether or not the resulting areas should be split up into pieces if
 any invalid (i.e. self-intersecting) pieces are created. Use FIX_INVALID=YES to force the
 invalid areas to be fixed.
 l Specify Bounding Box for Operation
 See also Specify Bounds for Operation
 - 186 -
 Global Mapper Scripting Reference Section 12: Raster Analysis
 CREATE_MULTI_BAND
CREATE_MULTI_BAND
The CREATE_MULTI_BAND command combines multiple loaded single-band imagery files in to
a single logical multi-band layer. Each specified single-band layer will be removed from the act-
ive layer list and instead be accessible through the multi-band layer. The following parameters
are supported:
 l LAYER_DESC - description for the newly created multi-band layer
 l BAND_FILENAME - specifies the filename or description of a loaded layer to add as a
 band to the new layer. Add a separate BAND_FILENAME parameter for each band that
 you want to add in the order that you want them added. Alternatively, you can use the
 more verbose BAND_EXPORT_SETUP parameter to specify band numbers explicitly.
 l BAND_EXPORT_SETUP - allows you to specify the input layer to use for each band. Use
 the following format to specify what band from what layer to use for a given output band
 in the new layer: <output_band>?<input_band>?<layer_filename> . For example to assign
 the 4th (infrared) band in an export from the 1st (red) band in a previously loaded file
 name C:\data\input_file.tif, use the following parameter: BAND_EXPORT_SETUP-
 P="4?1?c:\data\input_file.tif". Note that you need to include a separate
 BAND_EXPORT_SETUP parameter for each output band you want to add to the mult-
 iband image.
See the IMPORT command for other options parameters to apply to the multi-band layer after
load.
RASTER_RECLASSIFY
The RASTER_RECLASSIFY command modifies the pixel values of a raster layer, including palette
images, terrain data, and single bands of imagery based on user specified rules.
 l LAYER_DESC - description for the newly created raster layer.
 l FILENAME - specify the filename of the already loaded layer to reclassify.
 l BAND - specify the band from the input image layer that will be used in the reclas-
 sification. This parameter allows integer values. This parameter is not needed input for
 palette type layers or elevation grid layers. For elevation grid layers, only raw elevation
 values can be reclassified via this script command.
 l OUTPUT_LAYER_TYPE - specify the type of layer to generate through reclassification. The
 output raster layer can be stored as a palette image, or a single band raster layer.
 Allowed values are: PALETTE, BAND_8BIT, BAND_16BIT. The default value is PALETTE.
 l SET_UNLISTED_NO_DATA - set all values not specified in the reclassification rules to NO_
 DATA with SET_UNLISTED_NO_DATA=TRUE. If this parameters is not specified it defaults
 to FALSE.
 l RULES_FILENAME - the full path to the saved rules file (*.gmr) to be used in the reclas-
 sification. This file must be created in the user interface Raster Reclassification tool and
 saved to a file location in order to use the rules in a script.
 - 187 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_ANY
Export
 EXPORT_ANY 188
 EXPORT_CLOUD 188
 EXPORT_ELEVATION 189
 EXPORT_METADATA 199
 EXPORT_PACKAGE 199
 EXPORT_GEOPACKAGE 201
 EXPORT_PDF 202
 EXPORT_PDF3D 203
 EXPORT_RASTER 205
 EXPORT_VECTOR 213
 EXPORT_WEB 226
EXPORT_ANY
The EXPORT_ANY command exports loaded data to some file format. The TYPE parameter for
this will automatically determine which of the EXPORT_ELEVATION, EXPORT_PACKAGE,
EXPORT_PDF, EXPORT_RASTER, or EXPORT_VECTOR commands should be used. For example if
you use TYPE=USGS_DEM then you will export using the EXPORT_ELEVATION command. The
parameters for the command that is used based on the TYPE parameter.
 l TYPE - type of file we're exporting to. See the other EXPORT commands for a complete
 list of available types. The following types are special types:
 l FIRST_LOADED - export to the same type as the first loaded file
EXPORT_CLOUD
The EXPORT_CLOUD command exports data to a cloud database, including Amazon S3 account.
The following parameters are supported by the command.
 l CLOUD_TYPE - Cloud type, currently only AWS is supported "Amazon's AWS S3"
 l CLOUD_KEY1- first access key, for AWS S3 this is the Public Key
 l CLOUD_KEY2 - second access key, for AWS S3 this is the Private Key
 l CLOUD_FOLDER - folder where file exists in the cloud, for AWS S3 this is the bucket
 l CLOUD_LOCATION - location where folder exists, for AWS S3 this is region
 l CLOUD_FILE - the name of the file as it exists in the cloud.
SAMPLE
EXPORT_CLOUD GEN_PRJ_FILE=YES TYPE="SHAPEFILE" \
ELEV_UNITS="METERS" LABEL_FIELD_FORCE_OVERWRITE="YES" LABEL_FIELD_SEP="0x20" LABEL_FIELD="NAME"
 - 188 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_ELEVATION
\
CODE_PAGE="0" CLOUD_TYPE="Amazon's AWS S3" CLOUD_KEY1="AAAAAAAAAAAAAAAAAAAA" CLOUD_
KEY2="AAAA+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" \
CLOUD_FOLDER="bmg-bucket" CLOUD_LOCATION="us-east-1" CLOUD_FILE="biggybig.shp"
EXPORT_ELEVATION
The EXPORT_ELEVATION command exports all currently loaded elevation data to a file. The fol-
lowing parameters are supported by the command.
 l FILENAME - full path to file to save the data to
 l EXPORT_LAYER - filename or description of layer(s) to export. By default all compatible
 and exportable layers are exported. You can include multiple EXPORT_LAYER parameters
 if you have multiple masks to search. Wildcards (* and ?) are supported. Hidden layers
 are not considered. To export just the layer(s) selected in the Control Center, use
 EXPORT_LAYER="SELECTED LAYERS".
 l TYPE
 - type of elevation file we're exporting to:
 l FIRST_LOADED - export to the same type as the first loaded file
l BIL - export to a BIL format file (simple binary format with header).
 - 189 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_ELEVATION
 - 190 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_ELEVATION
 l SAMPLING_METHOD (elevation and raster only) - specifies the sampling method to use
 when resampling this layer. The following values are supported:
 l DEFAULT - Use either automatic resampling based on export or layer resampling,
 olution and bounds compare to the original layout for a layer. For example if you
 export to a lower resolution a box averager of appropriate size may be used auto-
 matically
 l LAYER - Use the sampling method set for each layer
l The list of SAMPLING_METHOD values for the IMPORT command can also be spe-
 cified to use a particular sampling method for all layers being exported.
 l Shared IMPORT SAMPLING_METHOD values
 - 191 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_ELEVATION
 l EXPORT_COLORS - specifies that RGB color values should be exported for each coordin-
 ate that is saved.
 l EXPORT_ECEF - specifies that the export should use ECEF (earth-centered earth-fixed, or
 geocentric) coordinates.
 l EXPORT_ROW_MAJOR - specifies that the XYZ values should be exported in row-major
 order. Use EXPORT_ROW_MAJOR=YES to enable this.
 l REVERSE_ROWS - specifies that the values should be exported from bottom-to-top
 rather than top-to-bottom
 l REVERSE_COLS - specifies that the values should be exported from right-to-left rather
 than left-to-right
 l THIN_GRID_MAX_DELTA - specifies that the output points should be thinned in areas
 with elevation values that change less than the specified valu. The units are whatever
 units are specifed in the ELEV_UNITS parameter. By default if this value is provided the
 data will be divided in to grids of a max size 64x64. If all values in that grid are within
 THIN_GRID_MAX_DELTA of each other, only a single point will be exported. If not, 4 smal-
 ler grids of size 32x32 are examined, and so on until a single point is reached. Use THIN_
 GRID_PIX_SIZE to specify a different maximum subgrid size other than 64x64.
 l THIN_GRID_PIX_SIZE - specifies the maximum number of samples on each side of the
 sub-grids examined with THIN_GRID_MAX_DELTA is specified.
 l COORD_DELIM - specifies the delimeter between coordinates
 l COMMA - coordinates are separated by commas
 - 192 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_ELEVATION
 l EXPORT_COLORS - specifies that RGB color values should be exported for each coordin-
 ate that is saved.
 l EXPORT_ECEF - specifies that the export should use ECEF (earth-centered earth-fixed, or
 geocentric) coordinates.
 l EXPORT_ROW_MAJOR - specifies that the XYZ values should be exported in row-major
 order. Use EXPORT_ROW_MAJOR=YES to enable this.
 l REVERSE_ROWS - specifies that the values should be exported from bottom-to-top
 rather than top-to-bottom
 l REVERSE_COLS - specifies that the values should be exported from right-to-left rather
 than left-to-right
 l THIN_GRID_MAX_DELTA - specifies that the output points should be thinned in areas
 with elevation values that change less than the specified valu. The units are whatever
 units are specifed in the ELEV_UNITS parameter. By default if this value is provided the
 data will be divided in to grids of a max size 64x64. If all values in that grid are within
 THIN_GRID_MAX_DELTA of each other, only a single point will be exported. If not, 4 smal-
 ler grids of size 32x32 are examined, and so on until a single point is reached. Use THIN_
 GRID_PIX_SIZE to specify a different maximum subgrid size other than 64x64.
 l THIN_GRID_PIX_SIZE - specifies the maximum number of samples on each side of the
 sub-grids examined with THIN_GRID_MAX_DELTA is specified.
 l COORD_OFFSET (XYZ_GRID only) - specifies the offset to apply to any coordinates written
 to the file. This offset will be added to each coordinate written to the file. The offset
 should be specified as a comma-delimited list of the X, Y, and Z offsets, such as COORD_
 OFFSET=100000.0,200000.0,0.0
 l COORD_SCALE (XYZ_GRID only) - specifies the scale factors to apply to any coordinates
 written to the file. Each coordinate will be multiplied by these scale factor before being
 written to the file. The scale factors should be specified as a comma-delimited list of the
 X, Y, and Z scale factors, such as COORD_SCALE=0.1,0.1,1.0
ERDAS Fields
 l BYTES_PER_SAMPLE - specifies how many bytes to use per elevation sample in the IMG
 file. Valid values are 2 bytes (16-bits) and 4 bytes (32-bits). If this value isn't specified, 2
 bytes are used.
 l ADD_OVERVIEW_LAYERS - specifies that overview (pyramid) layers should be generated
 for the export. Use ADD_OVERVIEW_LAYERS=YES to enable.
 l BLOCK_SIZE - specifies the block size to use for the export. The default is BLOCK_SIZE=64.
 l COMPRESS_OUTPUT - specifies whether or not the exported file should be compress.
 The default is COMPRESS_OUTPUT=YES.
 l BYTES_PER_SAMPLE - specifies how many bytes to use per elevation sample in the IMG
 file. Valid values are 2 bytes (16-bits) and 4 bytes (32-bits). If this value isn't specified, 2
 bytes are used.
 - 193 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_ELEVATION
GeoTIFF Fields
 l SAMPLE_TYPE - specifies what type of samples will be exported for formats that support
 different data types. If provided, this parameter will take precedence over the BYTES_
 PER_SAMPLE and USE_UNSIGNED parameters. For example, use SAMPLE_TYPE="F32" to
 specify 32-bit single precision floating point samples. Here is a list of the valid values and
 the associated types:
 l U8 - unsigned 8-bit integer
 - 194 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_ELEVATION
 l COMPRESSION (GeoTIFF only)- specifies the type of compression to use for the gen-
 erated TIFF file. If you do not provide a compression value then no compression will be
 used.
 l NONE - Do not compress the output.
 l VERT_CITATION - specifies the text description to store in the GeoTIFF file for the vertical
 coordinate system for the elevations. If nothing is supplied the default one (if any) for the
 supplied VERT_CS_CODE will be used.
 l VERT_CS_CODE - specifies the vertical coordinate system (i.e. vertical datum) to store in
 the GeoTIFF file to specify what the elevations are referenced to. Use the EPSG code, like
 5103 for NAVD88. If you don't specify a value and you specify a VERT_CITATION field that
 matches a known name, the associated VERT_CS_CODE for that name will be used. For
 example, VERT_CITATION="NAVD88" will provide VERT_CS_CODE=5103 by default.
 If neither of these are present and the source files used all use the same known system,
 that will be used. Note that no vertical datum conversion is done, this is just to supply
 metadata.
 l l VOID_ELEV - pixel value to use for noData pixels.
FLOAT_GRID Fields
 l EXPORT_SLOPE - use to specify that slope values should be exported rather than elev-
 ation values. Use EXPORT_SLOPE=YES to enable.
 l EXPORT_SLOPE_DIR - use to specify that slope direction values should be exported
 rather than elevation values. Use EXPORT_SLOPE_DIR=YES to enable.
 l EXPORT_SLOPE_PERCENT - use to specify that slope values should be exported as per-
 cent slope rather than degrees. Use EXPORT_SLOPE_PERCENT=YES to enable and also
 make sure to add EXPORT_SLOPE=YES to the command line.
DTED Fields
 l DTED_LEVEL - specifies which DTED level to export to. The values must be between 0 and
 5 (with 0, 1, and 2) being the only levels supported by most applications.
 l DTED_PRODUCER_CODE - specifies a producer code to store in the DTED file header. This
 should be in the form CCAAABBB where the first 2 characters are the country code.
 l DTED_SECURITY_CLASS - specifies the security classification character to store in the
 DTED file header. The default is 'U' for unclassified. Other valid values are 'C' (con-
 fidential), 'S' (secret), and 'R' Restricted.
 l SPLIT_INTO_FOLDERS - write each column out to separate folders by longitude. Use
 SPLIT_INTO_FOLDERS=YES to enable this behavior.
 for NAVD88. If you don't specify a value and the source files used all use the same known
 system, that will be used. Note that no vertical datum conversion is done, this is just to
 supply metadata.
 l VERT_CITATION - specifies the text description to store in the Lidar LAS file for the ver-
 tical coordinate system for the elevations. If nothing is supplied the default one (if any)
 for the supplied VERT_CS_CODE will be used.
 l FILE_SOURCE_ID - specifies a File Source ID numeric value to store in the exported LAS
 file header. If not specified and one of the input files is a LAS file with this value specified
 it will be used.
 l GLOBAL_ENCODING - specifies a Global Encoding numeric value to store in the exported
 LAS file header. If not specified and one of the input files is a LAS file with this value spe-
 cified it will be used.
 l SYSTEM_ID - specifies a System ID value to store in the exported LAS file header. If not
 specified and one of the input files is a LAS file with this value specified it will be used.
 l GEN_SOFTWARE - specifies a Generating Software value to store in the exported LAS file
 header. If not specified and one of the input files is a LAS file with this value specified it
 will be used. Otherwise 'Global Mapper' will be used.
 l FLIGHT_DATE - specifies the flight date to store in the exported LAS file header. This can
 be either the day of the current year (value 1 to 366) or a common date format, including
 month, day, and year. If not specified the current date will be used.
 l GUID - specifies the GUID to store in the LAS header. The format should be like GUID="
 {21EC2020-3AEA-4069-A2DD-08002B30309D}".
 l USE_8BIT_CLASSES - specifies that full 8-bit values should be used to store the point clas-
 sification, allowing values up to 255, even in LAS 1.1/1.2 files that only support classes up
 to 31 per the standard. Use with care as the files created using USE_8BIT_CLASSES=YES
 will not comply with the LAS standards if any classes over 31 are present.
 - 197 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_ELEVATION
SAMPLES
Here is an example script showing 2 GWS exports:
GLOBAL_MAPPER_SCRIPT VERSION=1.00
 - 198 -specified
// Do export with elev/roughness layers separately
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_METADATA
EXPORT_METADATA
The EXPORT_METADATA command exports the metadata for a specified load layer. The fol-
lowing parameters are supported by the command.
 l FILENAME - full path of file (must already be loaded) that you want to save the metadata
 for.
 l METADATA_FILENAME - full path of new text file to create on disk containing the
 metadata for the specified layer.
 l ADD_LIDAR_STATS - specifies whether or not statistics about a Lidar point cloud should
 be dumped to the file for Lidar point cloud layers. This includes all of the statistics that
 you see on the Statistics tab of the Metadata dialog for a Lidar layer. Use ADD_LIDAR_
 STATS=YES to enable.
 l APPEND_TO_FILE - specifies that the metadata text should be appended to the file spe-
 cified if it already exists rather than a new file being created. Use APPEND_TO_FILE=YES
 to enable.
 l HEADER - specifies a header line to include before the metadata output by this state-
 ment. If you want to insert extra line breaks in the header, use the \n escape character.
 l ADD_BLANK_LINE - specifies that a blank line will be added to the file if APPEND_TO_FILE-
 E=YES is added to the command and the file was not empty to start with. Use ADD_
 BLANK_LINE=YES to enable adding the blank line.
EXPORT_PACKAGE
The EXPORT_PACKAGE command exports all currently loaded raster, vector, and elevation data
to a Global Mapper Package (*gmp) or Global Mapper Mobile Package (*gmmp) file. The fol-
lowing parameters are supported by the command.
 l FILENAME - specify the path to save the exported file. The package format will be determ-
 ined by the file extension used in the file name. Use *.gmp to export as a Global Mapper
 Package and *.gmmp for a Global Mapper Mobile Package.
 l EXPORT_LAYER - filename or description of layer(s) to export. By default all compatible
 and exportable layers are exported. You can include multiple EXPORT_LAYER parameters
 if you have multiple masks to search. Wildcards (* and ?) are supported. Hidden layers
 are not considered.
 l SIMPLIFICATION - specifies the simplification threshold to use when exporting the vector
 features. This specifies how far off a straight line (in the units of the current projection)
 that a point has to be before it is kept. Generally you should not specify a simplification
 - 199 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_PACKAGE
 value as the default just exports all vertices as they are. This is an option for advanced
 users only.
l SINGLE_PRECISION - specifies that vector coordinates should be written out as 4-byte
 single precision floating point numbers rather than the default 8-byte double precision
 floating point numbers. Use SINGLE_PRECISION=YES to enable single precision export,
 which will result in smaller files.
l DISCARD_ATTRIBUTES - specifies that the list of attribute-value pairs for each vector fea-
 ture should not be written out. Use DISCARD_ATTRIBUTES=YES to enable this behavior.
l VECTOR_ONLY - specifies that only vector layers should be exported to the package file.
 Use VECTOR_ONLY=YES to enable.
l SHAPE_TYPE specifies the vector object type(s) (area, line, or point) to export. You can
 specify a comma-delimited list of the following (like SHAPE_TYPE="AREAS,LINES")
 or if you don't provide a value at all the default of all types will be exported:
 l AREAS - export area features
l KEEP_ALL_STYLES - specifies that the full style of each feature should be written to the
 package file, even if it uses the current default for the type. Use KEEP_ALL_STYLES=YES to
 enable this. This is useful if you want features to look exactly the same on all systems and
 not be affected by changes to the default styling for types.
l KEEP_NATIVE_PROJECTION - specifies that each layer should be exported in the native
 projection of the layer rather than reprojected to the current projection. Use KEEP_
 NATIVE_PROJECTION=YES to enable this behavior.
l COMBINE_VECTOR_LAYERS - specifies that all vector data should be combined into a
 single layer within the package file. Use COMBINE_VECTOR_LAYERS=YES to enable this
 behavior.
l SORT_LIDAR- allows you to have the Lidar data re-organized on export for faster display
 and analysis. Use this for poorly organized Lidar data that draws slowly. Add SORT_
 LIDAR=YES to enable. Note this setting requires Global Mapper Pro license.
l OVERWRITE_EXISTING - specifies that existing files should be overwritten. The default is
 OVERWRITE_EXISTING=YES, so use OVERWRITE_EXISTING=NO to skip exporting files that
 already exist.
l INC_THMBNAIL - specifies whether to export a small image of the map to be displayed in
 the Map List in Global Mapper Mobile. Enabled (INC_THUMBNAIL=YES) by default, use
 INC_THUMBNAIL=NO to disable.
l Specify Bounding Box for Operation
 See also "Specify Bounds for Operation" on page 234
l Cropping to Polygons/Areas
 See also "Cropping Operations to Polygons/Areas" on page 230
l Tiling/Gridding Export into Smaller Chunks
 See also "Gridding/Tiling Operations into Smaller Chunks" on page 232
 - 200 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_GEOPACKAGE
EXPORT_GEOPACKAGE
The EXPORT_GEOPACKAGE command exports all currently loaded raster, vector, and elevation
data to a GeoPackage (*.gpkg) file. The following parameters are supported by the command.
 l FILENAME - full path to file to save the data to
 l EXPORT_LAYER - filename or description of layer(s) to export. By default all compatible
 and exportable layers are exported. You can include multiple EXPORT_LAYER parameters
 if you have multiple masks to search. Wildcards (* and ?) are supported. Hidden layers
 are not considered.
 l OVERWRITE_EXISTING – indicates whether or not to overwrite the output file, if it already
 exists. Default is NO
 l Vector Options
 l SHAPE_TYPE – allow one or more of AREAS, LINES, POINTS. Default is to export all
l QUALITY – Image quality. Valid range is 0 to 100. Only valid for IMAGE_FORMAT-
 T=JPG
 l TILE_SIZE – Size in pixels for each tile. Tiles will be square. Valid values are 256, 512,
 - 201 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_PDF
EXPORT_PDF
The EXPORT_PDF command exports all currently loaded data to a PDF file. The following para-
meters are supported by the command.
 l FILENAME - full path to file to save the data to
 l EXPORT_LAYER - filename or description of layer(s) to export. By default all compatible
 and exportable layers are exported. You can include multiple EXPORT_LAYER parameters
 if you have multiple masks to search. Wildcards (* and ?) are supported. Hidden layers
 are not considered.
 l DPI - specifies the DPI that the file is generated at.
 l EXPORT_SCALE - specifies the scale to do the export at. For example to export at
 1:50,000 scale, use EXPORT_SCALE=50000.
 l PDF_PAGE_SIZE - specifies the name of the paper size to use. This should match one of
 the entries on the PDF export dialog, like Letter, A0, etc. If you would like to define a cus-
 tom page size, use a format like PDF_PAGE_SIZE="CUSTOM 12in x 18in" (cre-
 ates a 12 inch wide by 18 inch tall page or PDF_PAGE_SIZE="CUSTOM 30cm X
 60cm" which creates a 30 cm by 80 cm page.
 l PDF_PAGE_ORIENTATION - specifies the page orientation to use for the generated PDF
 file. The following values are supported:
 l AUTO - Automatically determine whether to use portrait or landscape mode based
l LANDSCAPE
 l PDF_MARGINS - specifies the margins to use in inches. The value should be a comma-
 delimited list of numbers for the left, top, right, and bottom margins. For example, PDF_
 MARGINS="0.5,1.0,0.5,1.25" would result in a 0.5 inch margin for the left and
 right, 1.0 inch for the top, and 1.25 inches for the bottom.
 l PDF_HEADER - specifies the header to use
 l PDF_FOOTER - specifies the footer to use
 l PDF_COMBINE_RASTERS - specifies whether multiple raster layers should be combined
 into a single layer or kept separate. Use PDF_COMBINE_RASTERS=YES to combine them
 or PDF_COMBINE_RASTER_LAYERS=NO to keep separate.
 l PDF_VERSION - specifies the version of PDF to export. The default is PDF_VERSION=”1.5”.
 You can specify versions up to 1.7.
 l PDF_EMBED_FONTS - controls whether or not unknown fonts are embedded in the expor-
 ted PDF file. This is enabled by default, use PDF_EMBED_FONTS=NO to never embed any
 fonts.
 l PDF_FILL_PAGE - specifies whether the PDF export should fill the page or be cropped to
 the exact bounds specified. Use PDF_FILL_PAGE=YES to enable or PDF_FILL_PAGE=NO to
 disable.
 l PDF_FONT_SCALE - specifies the scale factor to apply to text. For example use PDF_
 FONT_SCALE=2.0 to double the size of text.
 - 202 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_PDF3D
 l PDF_SYMBOL_SCALE - specifies the scale factor to apply to point symbols and icons. For
 example use PDF_SYMBOL_SCALE=2.0 to double the size of symbols.
 l LAYER_ATTR - specifies the attribute value to use from each feature for the layer name in
 the PDF file. The default is to use the feature description. See special Attribute Name
 parameter details for recognized values.
 l VECTOR_ONLY - specifies that only vector layers should be exported to the PDF file. Use
 VECTOR_ONLY=YES to enable.
 l SAVE_GRID_LINES - specifies that if grid line display is enabled that the grid lines should
 be saved. Specify SAVE_GRID_LINES=NO to disable this option. If it's not specified the
 grid lines will be saved if enabled.
 l SAVE_SCALE_AND_LEGEND - specifies that the distance scale and elevation legend, if
 applicable and enabled for display on the Configuration dialog, should be exported to the
 generated PDF file. Specify SAVE_SCALE_AND_LEGEND=NO to disable this option. If it's
 not specified the current view settings will be used.
 l PDF_USE_ADOBE_EXT - specifies that Adobe ISO 32000 Extensions should be used for
 georeference. Specify PDF_USE_ADOBE_EXT=YES to enable this option (default) or PDF_
 USE_ADOBE_EXT=NO to disable this option and use standard PDF georeferencing.
 l OVERWRITE_EXISTING - specifies that existing files should be overwritten. The default is
 OVERWRITE_EXISTING=YES, so use OVERWRITE_EXISTING=NO to skip exporting files that
 already exist.
 l Specify Bounding Box for Operation
 See also "Specify Bounds for Operation" on page 234
 l Tiling/Gridding Export into Smaller Chunks
 See also "Gridding/Tiling Operations into Smaller Chunks" on page 232
EXPORT_PDF3D
The EXPORT_PDF3D command exports all currently loaded data to a 3D PDF file. The following
parameters are supported by the command.
 l FILENAME - full path to file to save the data to
 l EXPORT_LAYER - filename or description of layer(s) to export. By default all compatible
 and exportable layers are exported. You can include multiple EXPORT_LAYER parameters
 if you have multiple masks to search. Wildcards (* and ?) are supported. Hidden layers
 are not considered.
 l PDF_PAGE_SIZE - specifies the name of the paper size to use. This should match one of
 the entries on the PDF export dialog, like Letter, A0, etc. If you would like to define a cus-
 tom page size, use a format like PDF_PAGE_SIZE="CUSTOM 12in x 18in" (cre-
 ates a 12 inch wide by 18 inch tall page or PDF_PAGE_SIZE="CUSTOM 30cm X
 60cm" which creates a 30 cm by 80 cm page.
 l PDF_PAGE_ORIENTATION - specifies the page orientation to use for the generated PDF
 file. The following values are supported:
 - 203 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_PDF3D
l LANDSCAPE
l PDF_MARGINS - specifies the margins to use in inches. The value should be a comma-
 delimited list of numbers for the left, top, right, and bottom margins. For example, PDF_
 MARGINS="0.5,1.0,0.5,1.25" would result in a 0.5 inch margin for the left and
 right, 1.0 inch for the top, and 1.25 inches for the bottom.
l PDF_HEADER - specifies the header to use
l PDF_FOOTER - specifies the footer to use
l PDF_COMBINE_RASTERS - specifies whether multiple raster layers should be combined
 into a single node or kept separate. Use PDF_COMBINE_RASTERS=YES to combine them
 (default) or PDF_COMBINE_RASTERS=NO to keep separate.
l PDF_COMBINE_ELEV_GRIDS - specifies wheter multiple elevation grid layers should be
 combined into a single node or kept separate. Use PDF_COMBINE_ELEV_GRIDS=YES to
 combine them (default) or PDF_COMBINE_ELEV_GRIDS=NO to keep separate.
l PDF_CREATE_IMAGE_DRAPED - specifies whether to combine raster and elevation grid
 layers into a single image draped surface node. Use PDF_CREATE_IMAGE_DRAPED=YES
 to combine them (default) or PDF_CREATE_IMAGE_DRAPED=NO to keep separate.
l PDF_LIDAR_AS_LINES - specifies wether to render Lidar points as short line segments in
 PDF. This will improve appearance in some PDF readers. Specify PDF_LIDAR_AS_
 LINES=YES to enable this option (default) or PDF_LIDAR_AS_LINES=NO to disable this
 option and render as points.
l PDF_USE_FILENAME_FOR_NODES - specifies whether to use the source filename for
 exported node names. Specify PDF_USE_FILENAME_FOR_NODES=YES to enable this
 option or PDF_USE_FILENAME_FOR_NODES=NO to disable this option and assign default
 node names based on data type (raster, lidar, point, line, area).
l PDF_USE_LDP - specifies whether to use a Low Distortion Projection for exported data.
 This can impove accuracy when the range of coordinates is small compared to their val-
 ues. Specify LDP=YES to enable this option (default) or PDF_USE_LDP=NO to disable this
 option.
l PDF_USE_ADOBE_EXT - specifies that Adobe ISO 32000 Extensions should be used for
 georeference. Specify PDF_USE_ADOBE_EXT=YES to enable this option (default) or PDF_
 USE_ADOBE_EXT=NO to disable this option and use standard PDF georeferencing.
l OVERWRITE_EXISTING - specifies that existing files should be overwritten. The default is
 OVERWRITE_EXISTING=YES, so use OVERWRITE_EXISTING=NO to skip exporting files that
 already exist.
l "Specify Bounds for Operation" on page 234
l "Gridding/Tiling Operations into Smaller Chunks" on page 232
 - 204 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_RASTER
EXPORT_RASTER
The EXPORT_RASTER command exports all currently loaded raster, vector, and elevation data
to a file. The following parameters are supported by the command.
 l FILENAME - full path to file to save the data to. When using additional name parameters
 with Tiling/Gridding or Polygon Cropping, this can specify just a directory, or the prefix
 and/or extension for the filename.
 l EXPORT_LAYER - filename or description of layer(s) to export. By default all compatible
 and exportable layers are exported. You can include multiple EXPORT_LAYER parameters
 if you have multiple masks to search. Wildcards (* and ?) are supported. Hidden layers
 are not considered.
 l TYPE
 type of raster file we're exporting to
 l FIRST_LOADED - export to the same type as the first loaded file
l ADRG - export to an ADRG data set. See supported ADRG fields below.
l ASRP - export to an ASRP data set. See supported ASRP fields below.
l KML - export to a raster KML/KMZ format file for display in Google Earth.
l RPF - export to a RPF (CADRG or CIB) data set. See required RPF fields below.
 - 205 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_RASTER
 of the default resolution by adding a percent. For example to get half the detail your
 double the spatial resolution value, so you would use SPATIAL_RES="200%,200%".
l SPATIAL_RES_METERS - specifies spatial resolution to use in meters. The value in meters
 will automatically be converted to the current view/ export projection units. For example,
 to do an export at 2.0 meter spacing (or as close as you can get to that in the current
 units), use SPATIAL_RES_METERS=2.0, or to do an export at 1.0 meters in X by 1.5
 meters in Y, use SPATIAL_RES_METERS="1.0,1.5".
l PIXEL_SIZE - specifies the desired size in pixels of your export. Use this instead of
 SPATIAL_RES if you know exactly how many pixels in size your export should be. The
 format is PIXEL_SIZE="widthxheight". For example, to make your export have dimensions
 of 1024 pixels wide by 768 pixels tall, use PIXEL_SIZE="1024x768".
l PIXEL_SIZE_MAX - specifies the maximum desired size in pixels of your export. The
 format is the same as the PIXEL_SIZE parameter, but specifies the maximum dimension
 on either side. If the dimensions result in non-square pixels, a smaller pixel count will be
 used in width or height so that the pixel aspect ratio is maintained.
l FORCE_SQUARE_PIXELS - if this value is set to YES, the spatial resolution of the resultant
 raster file will be set so that the x and y pixel size are the same, with the minimum default
 size being used for both.
l SAMPLING_METHOD - specifies the sampling method to use when resampling this layer.
 The following values are supported:
 l DEFAULT - Use either automatic resampling based on export or layer resampling,
 olution and bounds compare to the original layout for a layer. For example if you
 export to a lower resolution a box averager of appropriate size may be used auto-
 matically
 l LAYER - Use the sampling method set for each layer
l The list of SAMPLING_METHOD values for the "IMPORT" on page 52 command can
 also be specified to use a particular sampling method for all layers being exported
 Shared IMPORT SAMPLING_METHOD values
 See "SAMPLING_METHOD (elevation and raster only) - specifies the sampling
 method to use when resampling this layer. " on page 60
l PALETTE
 Specifies the palette/image type to use. If not specified, a 24-bit RGB image will be gen-
 erated.
 l KEEP_SOURCE - The exported file will use the some color configuration (if possible)
 as the file being exported. Note that this option is only available if you have only a
 single layer loaded for export.
 l OPTIMIZED (BMP, ERDAS, GEOTIFF, and PNG only) - The palette generated will be
 an optimal mix of up to 256 colors that will closely represent the full blend of colors
 in the source images. This option will generate the best results, but can more than
 - 206 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_RASTER
 double the export time required if any high color images are present in the export
 set.
 l HALFTONE (BMP, ERDAS, GEOTIFF, and PNG only) - use a 256-color halftone
 palette spread over the color spectrum
 l DOQ_DRG (BMP, ERDAS, GEOTIFF, and PNG only) - use a 256-color palette optim-
 ized for combined grayscale DOQs and USGS DRGs
 l DRG (BMP, ERDAS, GEOTIFF, and PNG only) - use a 256-color palette optimized for
 the colors found in USGS DRGs
 l GRAYSCALE - use a 256-color grayscale palette
 l BW (BMP, GEOTIFF only) - creates a black and white, 1-bit per pixel image
 l BLACKISMIN (GEOTIFF only) - creates an 8-bit per pixel grayscale image with no
 color map stored in the image. Black will be stored as zero with varying shades of
 gray up to white with a value of 255.
 l WHITEISMIN (GEOTIFF only) - creates an 8-bit per pixel grayscale image with no
 color map stored in the image. White will be stored as zero with varying shades of
 gray up to black with a value of 255.
 l JPG (GEOTIFF only) - creates a 24-bit RGB JPG-in-TIFF image. Note that while this
 creates a highly compressed GeoTIFF file, many software packages do not recog-
 nize JPG-in-TIFF format files.
 l MULTIBAND (BIL, BIP. BSQ, GEOTIFF, JPEG2000, ERDAS, and NITF only) - creates a
 multi-band image file with any number of bands of data. This is useful for multi-
 spectral imagery. Either 8- or 16-bits per band will be used depending on what is
 available in the input data. Use the NUM_BANDS parameter to specify how many
 bands to use. You can override the default band setting using the BAND_EXPORT_
 SETUP parameter (described below).
 l Custom palette filename - you can also pass in the full path to a .pal file containing
 a custom palette to use for the export.
l PALETTE_MAX_COLORS - specifies the maximum number of colors to use in an image-
 optimized or grayscale palette. The valid range is 2-256. If not specified, the value is the
 default max for the image format (typically 256).
l NUM_BANDS - specifies how many bands of data to export for a PALETTE=MULTIBAND
 export. If you don't specify a value for this the band count will be the maximum available
 for any of the loaded layers.
l BAND_BIT_DEPTH - specifies how many bits to use for each band of data for a PALETTE-
 E=MULTIBAND export. If you don't specify a value for this the highest bit depth of any of
 the input data layers will be used. The valid values are BAND_BIT_DEPTH=8, BAND_BIT_
 DEPTH=16, or BAND_BIT_DEPTH=32.
l BAND_EXPORT_SETUP - allows you to override the default band assignment for a
 MULTIBAND export. Use the following format to specify what band from what layer to
 use for a given export band: <output_band>?<input_band>?<layer_filename> . So for
 example to assign the 4th (infrared) band in an export from the 1st (red) band in a pre-
 viously loaded file name C:\data\input_file.tif, use the following parameter: BAND_
 - 207 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_RASTER
Projection Files
 l GEN_WORLD_FILE - specifies that a world file should be generated in addition to the
 image file. Use GEN_WORLD_FILE=YES to turn on.
 l GEN_TAB_FILE (GEOTIFF and PNG only) - specifies that a MapInfo TAB file should be gen-
 erated in addition to the image file. Use GEN_TAB_FILE=YES to turn on.
 l GEN_PRJ_FILE - specifies that a projection (PRJ) file should be generated in addition to
 the data file. Use GEN_PRJ_FILE=YES to turn on.
 l GEN_AUX_XML_FILE - specifies that an ESRI .aux.xml projection file should be generated
 in addition to the data file. Use GEN_AUX_XML_FILE=YES to turn on.
 l GEN_OZI_MAP_FILE - specifies that an OziExplorer .map file should be generated in addi-
 tion to the data file. Use GEN_OZI_MAP_FILE=YES to turn on.
 - 208 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_RASTER
 l GEN_ERS_FILE - specifies that an ERMapper .ers header file should be generated in addi-
 tion to the data file. Use GEN_ERS_FILE=YES to turn on.
GeoTIFF Fields
 l COMPRESSION - specifies the type of compression to use for the generated TIFF file. If
 you do not provide a compression value the default compression for each type will be
 used. The following values are supported:
 l NONE - Do not compress the output.
l JPEG - Use JPEG-in-TIFF (lossy) compression. Only works for 24-bit RGB output. Use
 output.
 l DEFLATE - Use Deflate/ZIP (lossless) compression on the output.
KML/KMZ Fields
 - 209 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_RASTER
 l KML_MIN_LOD_PIXELS - specifies how large layer has to be in pixels before it will show
 up in Google Earth.
 l KML_MAX_LOD_PIXELS - specifies how large layer has to be in pixels before it will stop
 showing up in Google Earth. The default value of -1 which means that a layer will never
 go away once it is displayed.
 l KML_FADE_EXTENT_MIN - specifies at what number of pixels in size that the image will
 start fading out. This value should be between KML_MIN_LOD_PIXELS and KML_MAX_
 LOD_PIXELS. The fade will be such that the image is 100% opaque at KML_FADE_EXTENT_
 MIN and completely transparent at KML_MIN_LOD_PIXELS.
 l KML_FADE_EXTENT_MAX - specifies at what number of pixels in size that the image will
 start fading out. This value should be between KML_MIN_LOD_PIXELS and KML_MAX_
 LOD_PIXELS. The fade will be such that the image is 100% opaque at KML_FADE_EXTENT_
 MAX and completely transparent at KML_MAX_LOD_PIXELS.
 l KML_RASTER_FORMAT - specified which raster image format to use when creating tiles
 for KML/KMZ files. The valid options are JPG, PNG, and TIFF. For example, add KML_
 RASTER_FORMAT=JPG to use JPG format files.
 l KML_SUPER_OVERLAY - specifies that the data should be automatically gridded into
 "super overlays" to allow displaying large quantities of data in Google Earth. Use KML_
 SUPER_OVERLAY=YES to enable this behavior.
 l KML_TILE_SIZE - if data is being automatically gridded into "super overlays", this specifies
 the size of tiles to use for gridding. The default tile size is 1024. To change this for
 example to 512x512, use KML_TILE_SIZE=512.
 l KML_ZOOM_SCALE_FACTOR - if data is being automatically gridded into "super over-
 lays", this specifies the multiplier to use when creating zoomed out pyramid layers. The
 default value of 2 makes each successive zoom level 1/2 the resolution of the previous
 one until everything fits in a single tile. To change this to making each layer 1/3rd the res-
 olution of the previous one, use KML_ZOOM_SCALE_FACTOR=3.
 l KML_GEN_INDEX_FILE - specifies that an _index.kml file should be generated in the tar-
 get folder which is an index to the individual KML/KMZ tiles that were exported.
 l KML_RASTER_ALTITUDE_MODE- specifies how the altitude is interpreted.
 Valid values are:
 l clampToSeaFloor (default) - The overlay will be draped over the sea floor. If the
 point is on land rather than at sea, the overlay will be positioned on the ground.
 l clampToGround - Indicates to drape the overlay over the terrain.
BSB Fields
 l CHART_NAME - Name of chart
 l CHART_NUMBER - Chart number
 l CHART_SCALE - Denominator of scale, like CHART_SCALE=5000 for a 1:5,000 scale
 chart.
 l CHART_EDITION_DATE - Chart edition date, like CHART_EDITION_DATE-
 E="04/21/2014" for April 21, 2014.
 - 210 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_RASTER
 l CREATE_BSB_FILE - Flag to control whether or not a BSB file is created alongside KAP.
 Use CREATE_BSB_FILE=NO to disable.
 l INC_POLYNOMIAL - Flag to control whether or not the polynomial coordinate trans-
 formation is included in the KAP file. Use INC_POLYNOMIAL=NO to disable
 l SCALE - The scale to export at. In most cases the SERIES implies the scale so this value is
 ignored, but it you use a SERIES with a variable scale this is required.
 l PRODUCER_CODE - The numeric producer code ID from [MIL-STD-2411-1, Section 5.2.1),
 like 1 for AFACC (Air Force Air Combat Command) or the abbreviation (like AFACC).
 l AUTHOR - The author to store in the NITF file header in the Originator's Name field ((MIL-
 STD-2500A 5.2)
 l SECURITY_CLASS - The 1-character security classification from [MIL-STD-2411-1, Section
 5.1.8). The default is SECURITY_CLASS=U for unclassified.
 l SECURITY_COUNTRY - The 2-character security country code from [MIL-STD-2411-1, Sec-
 tion 5.1.7). The default is SECURITY_COUNTRY=US for the US.
 l SECURITY_MARKING - The 2-character security marking from [MIL-STD-2411-1, Section
 5.1.9). The default is SECURITY_MARKING=uu for unclassified.
 l VERSION - The file version. The default is 1 if you don't provide a value.
 l WRITE_EMPTY_FRAMES - Specifies that all frames within the bounds should be written
 out, even if all pixels in the frame are transparent. Add WRITE_EMPTY_FRAMES=YES to
 enable this behavior.
 l MAX_COLORS - specifies the maximum number of colors to use in the palette when com-
 pressing the CADRG/CIB. By default the maximum of 216 is used, but you can specify a
 smaller value to reduce the colors and perhaps maintain more sharpness in the com-
 pressed result.
ADRG/ASRP Fields
 - 211 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_RASTER
 l FILENAME - Full path and name of TRANSH01.THF file at root of data set export.
 l MAP_NAME - The map name, usually a 6-character name
 l VERSION - The file version. The default is 12 for ASRP 1.2. The value of 11 is also sup-
 ported for v1.1.
 l USE_BAND4_AS_ALPHA (ECW only) - specifies that the ECW file should store values from
 the 4th band of loaded layers to the alpha channel rather than using the alpha channel as
 on/off values. Use USE_BAND4_AS_ALPHA=YES to enable. This is an advanced option
 that allows some rudimentary multi-band ECW support.
 l SAVE_FULL_ALPHA (PNG Only) - Specifies that the full range of alpha values from the
 top-most raster layer at each location should be stored for RGB PNG files with an alpha
 channel rather than just 0 (transparent) or 255 (opaque). Disabled by default, use SAVE_
 FULL_ALPHA=YES to enable.
 l NO_PROJ_HEADER (ECW or JPEG2000 only) - specifies that no projection or datum
 information should be written to the file. Use NO_PROJ_HEADER=YES to indicate that the
 projection should not be written.
 - 212 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_VECTOR
 l NITF_USE_DECIMAL (NITF only) - specifies that is a NITF file is exported with lat/lon
 coordinates that the ICORDS is set to D for decimal coordinates rather than G for DMS.
 l Specify Bounding Box for Operation
 See also "Specify Bounds for Operation" on page 234
 l Cropping to Polygons/Areas
 See also "Cropping Operations to Polygons/Areas" on page 230
 l Tiling / Gridding
 See also "Gridding/Tiling Operations into Smaller Chunks" on page 232
EXPORT_VECTOR
The EXPORT_VECTOR command exports all currently loaded vector data to a file. The following
parameters are supported by the command.
 l FILENAME - full path to file to save the data to
 l EXPORT_LAYER - filename or description of layer(s) to export. By default all compatible
 and exportable layers are exported. You can include multiple EXPORT_LAYER parameters
 if you have multiple masks to search. Wildcards (* and ?) are supported. Hidden layers
 are not considered.
 l TYPE
 type of vector file to export
 l FIRST_LOADED - export to the same type as the first loaded file
 format file.
 l ARC_UNGENERATE - export line and area features to an Arc Ungenerate format
 file.
 l ARC_UNGENERATE_POINTS - export point features to an Arc Ungenerate format
 file.
 l CDF - export to a Geographix CDF format file.
l GEOJSON - exports area, line, and point features to a GeoJSON (JavaScript Object
 Notation) file.
 - 213 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_VECTOR
 l GPX - exports line and point features to a GPX (GPS eXchange Format) file.
 l INROADS - exports to the InRoads ASCII format.
l LIDAR_LAS - export to a Lidar LAS/LAZ file. Use .laz in filename to get LasZip.
l SOSI - exports area, line, and point features to a SOSI (Norwegian Data) file.
 only).
 l ZMAP_XYSEGID - export to a ZMap+ XYSegId format file (area and line features
 only).
l SAVE_GRID_LINES - specifies that if grid line display is enabled that the grid lines should
 be saved. Specify SAVE_GRID_LINES=NO to disable this option. If it's not specified the the
 grid lines will be saved if enabled.
l GEN_PRJ_FILE - specifies that a projection (PRJ) file should be generated in addition to
 the output file. Set this to YES to cause the projection file to be generated. Leaving out
 this parameter or setting it to anything but YES will cause no PRJ file to be generated.
l GEN_AUX_XML_FILE - specifies that an ESRI .aux.xml projection file should be generated
 in addition to the data file. Use GEN_AUX_XML_FILE=YES to turn on.
 - 214 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_VECTOR
 - 215 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_VECTOR
Shapefile Parameters
 l SPLIT_BY_LAYER (SHAPEFILE only) - specifies that the export should generate a separate
 Shapefile for each layer/type in the input data
 l EXPORT_MEASURES- specifies that 3D line and point objects should be export as
 PolyLineM and PointM features (respectively) rather than as PolyLineZ and PointZ fea-
 tures. Use EXPORT_MEASURES=YES to enable.
 l GEN_MULTI_PATCH (SHAPEFILE only) - specifies that area features exported to a
 Shapefile should be stored as multi-patch features rather than areas. Use GEN_MULTI_
 PATCH=YES to enable.
 l DISCARD_EMPTY_ATTRS (SHAPEFILE only) - specifies whether or not to include attributes
 in the DBF file even if all encountered values are empty. By default these attributes are
 included, add DISCARD_EMPTY_ATTRS=YES to discard them.
 l ALLOW_COMMA_DECIMAL - specifies whether or not a comma character can act as a
 decimal separator. Use ALLOW_COMMA_DECIMAL=YES to allow a comma as the decimal
 within string values. If not specified only periods will be allowed for decimals when
 determining the type for a field in the exported DBF file.
 l INC_MAP_NAME_ATTR - specifies whether or not the name of the map file that a feature
 came from should be added as an attribute to the DBF files exported with the Shapefile.
 Use INC_MAP_NAME_ATTR=YES to enable.
 l INC_STYLE_ATTRS - specifies whether or not attributes for the feature styles of each fea-
 ture should be added as attributes to the DBF files exported with the Shapefile This is dis-
 abled by default, use INC_STYLE_ATTRS=YES to enable.
 l CODE_PAGE - specifies the code page to use for the Shapefile export. The default is ANSI
 (1252). Use the code page number, or the text UTF-8 (number 65001).
 l GEN_3D_FEATURES - specifies that 3D line and point objects should be created in the
 exported file. Set this to YES to cause the the 3D features to be generated. Leaving out
 this parameter or setting it to anything but YES results in the normal 2D objects. The elev-
 ation stored for each vertex/point will be the first of the following that is available:
 l The elevation associated with the vertex/point in question.
l The elevation associated with the entire area/line/point being exported. For
 of the vertex/point.
 A value of 0.0 will be used if no elevation could not be obtained via any of the prior meth-
 ods.
 - 216 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_VECTOR
 l COORD_ORDER - specifies the order of the coordinates in coordinate lines. The following
 values are supported:
 l X_FIRST - x coordinates (i.e. easting or longitude) come first, followed by y coordin-
l Any other text. Use the escape sequence \n to specify that you want to insert a line
 break. For example, to separate features with a blank line, then a line with the text
 "NEW FEATURE", then another blank line, use FEATURE_SEP="\nNEW
 FEATURE\n".
 l PRECISION specifies the number of digits to include beyond the decimal point for the
 stored values. For example use PRECISION=6 to store values like XXXXXXX.XXXXXX.
 l SAVE_DIST_Z_FILE (SIMPLE_ASCII only) - specifies that the output file should be a dis-
 tance/Z file. Use SAVE_DIST_Z_FILE=YES to enable this option.
 l USE_3D_DIST (SIMPLE_ASCII only) - specifies if exporting a distance/Z file that the dis-
 tances are the 3D along-ground distance and not just distances on a flat ellipsoid. Add
 USE_3D_DIST=YES to enable.
 l COORD_OFFSET (SIMPLE_ASCII only) - specifies the offset to apply to any coordinates
 written to the file. This offset will be added to each coordinate written to the file. The off-
 - 217 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_VECTOR
 not currently loaded, or it does not contain saved column names, the default
 column names will be used.
 l A comma-separated list of column names 'X Col,Y Col [,Z Col]'. If you specify column
 names, you must specify the X and Y column names. The Z column name is
 optional. For example COORD_COL_NAMES="my_x, my_y, my_z"
 l ADD_LAT_LON (CSV only) - specifies that lat/lon columns should be added to a CSV
 export. Use ADD_LAT_LON=YES to enable.
 l EXPORT_HEADER (CSV only) - specifies whether or not the header line for CSV files
 should be written. Enabled by default, use EXPORT_HEADER=NO to disable.
 l USE_COMMA_FOR_DECIMAL (CSV only) - specifies whether the European style of using a
 comma for a decimal should be used rather than using a period.
 l POINTS_ONLY (CSV only) - specifies whether loaded area and line features should be
 included in a CSV export as WKT coordinate strings. The default is to only export points,
 so add POINTS_ONLY=NO to enable area and line export.
 l EXPORT_ECEF (SIMPLE_ASCII only) - specifies that the export should use ECEF (earth-
 centered earth-fixed, or geocentric) coordinates.
DXF/DWG Parameters
 l EXPORT_DWG_LABELS (DWG only) and EXPORT_DXF_LABELS (DXF only) - controls how
 object labels are exported to DWG/DXF files. The following values are supported:
 - 218 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_VECTOR
 Typically you want to set this to YES, unless you are working with a software package that
 cannot handle DWG/DXF files with attributes. Leaving out this parameter will cause fea-
 ture labels to be discarded on export.
 l LAYER_ATTR - specifies the attribute value to use from each feature for the layer name in
 the output file. The default is to use the feature description. See special Attribute Name
 parameter details for recognized values.
 l VERSION (DWG only) - specifies the version of DWG to export. The following values are
 supported:
 l R12
l R13
l R14
 l DWG_TEXT_SIZE (DWG only) - specifies the multiplier value to apply to text sizes when
 exporting DWG file. Use this to control how large text is in the exported file.
 l DXF_TEXT_SIZE (DXF only) - specifies the multiplier value to apply to text sizes when
 exporting DXF file. Use this to control how large text is in the exported file.
 l ALLOW_LONG_LABELS (DXF only) - specifies that labels over 31 characters in the DXF file.
 Add ALLOW_LONG_LABELS=YES to enable this.
 l EXPORT_ELEV - specifies whether or not a elevation value should be generated for each
 vertex. A value of EXPORT_ELEV=YES will cause elevations to be generated. If the option
 is not specified, elevation values will be generated.
 l EXPORT_SINGLE_ELEV_2D - specify that line features with a single elevation (like con-
 tours) should be exported as 2D polylines with a single elevation rather than 3D polylines.
 Use EXPORT_SINGLE_ELEV_2D=YES to enable.
 l EXPORT_ATTRS - specifies whether or not feature attributes should be written to the file.
 Use EXPORT_ATTRS=YES to enable export of the feature attributes. If the option is not
 specified, attributes will not be exported.
 l USE_LEGACY_DXF_EXPORTER - specifies whether or not to use the older DXF export
 method. Use USE_LEGACY_DXF_EXPORTER=YES to enable, if this is not specified the
 updated exported will be used.
 l EXPORT_BINARY_DXF - specifies a binary DXF should be written instead of an ASCII DXF.
 Use EXPORT_BINARY_DXF=YES to enable. If the option is no specified an ASCII DXF will be
 exported.
 l TYPE - File-Based Spatial Databases (Using these TYPE values requires that the FILENAME
 parameter also be specified to identify the spatial database to be used.)
 l SPATIALITE - Spatialite/SQLite
 l TYPE - Connection-Based Spatial Databases (Using these type values requires that the
 SDB_CONNECTION_NAME parameter also be specified to identify the connection to be
 used.)
 l ESRI_ARCSDE - Esri ArcSDE Geodatabase
l POSTGIS - PostGIS/PostgreSQL
Polish MP Parameters
 l MAP_NAME - specifies the name to use for the map. Typically defaults to the filename if
 not specified.
 l TEMPLATE_FILENAME (POLISH_MP only) - specifies the full path and filename for
 another MP file to use for the settings for the new MP file being exported.
 l MP_EXPORT_TEMPLATE_FILES (POLISH_MP only) - if a TEMPLATE_FILENAME value is
 provided, this controls whether or not the [FILES] section(s) from the template file will be
 copied to the new file.
 - 220 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_VECTOR
DGN Parameters
 l GEN_3D_FEATURES - specifies that 3D line and point objects should be created in the
 exported file. Set this to YES to cause the the 3D features to be generated. Leaving out
 this parameter or setting it to anything but YES results in the normal 2D objects. The elev-
 ation stored for each vertex/point will be the first of the following that is available:
 l The elevation associated with the vertex/point in question.
l The elevation associated with the entire area/line/point being exported. For
 of the vertex/point.
 A value of 0.0 will be used if no elevation could be obtained via any of the prior methods.
 l DGN_UNIT_RESOLUTION - specifies the unit resolution to use in an exported DGN file.
 The default is 10000.0.
 l DGN_GLOBAL_ORIGIN_LL - specifies whether the global origin of the exported DGN file
 should be set to the lower left of the design plane rather than at the center of the design
 plane. Use DGN_GLOBAL_ORIGIN_LL=YES to move the global origin to the lower left.
 l DGN_REPLACE_DARK_COLORS - specifies whether the color of dark lines should auto-
 matically be replaced with white on export to make them more visible on a dark back-
 ground. Use DGN_REPLACE_DARK_COLORS=YES to enable this option.
 l EXPORT_ATTRS - specifies whether or not feature attributes should be written to the
 DGN file as tags. Use EXPORT_ATTRS=YES to enable export of the feature attributes. If
 the option is not specified, attributes will be exported. If you don't want to export style
 attribute with the feature, use EXPORT_ATTRS=NO_STYLE to get just the associated attrib-
 utes and name of the feature in the attribute list.
KML/KMZ Parameters
 l KML_AREA_DISPLAY_ABOVE_TERRAIN (KML only) - specifies that area features with
 associated elevation value should be displayed at height above the terrain surface in
 Google Earth. Use KML_AREA_DISPLAY_ABOVE_TERRAIN=YES to enable.
 l KML_AREA_ELEVS_RELATIVE (KML only) - specifies that the elevation values associated
 with 3D area features are relative to the terrain surface rather than relative to sea level.
 Use KML_AREA_ELEVS_RELATIVE=YES to enable.
 - 221 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_VECTOR
 - 222 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_VECTOR
 l LAS_VERSION - specifies what version of LAS file to write out. This would be 1.1, 1.2, 1.3,
 or 1.4. If you don't specify a version, the lowest version that will support all of the
 provided options will be used (typically 1.1 or 1.2).
 l VERT_CS_CODE - specifies the vertical coordinate system (i.e. vertical datum) to store in
 the LAS file to specify what the elevations are referenced to. Use the EPSG code, like 5103
 for NAVD88. If you don't specify a value and the source files used all use the same known
 system, that will be used. Note that no vertical datum conversion is done, this is just to
 supply metadata.
 l VERT_CITATION - specifies the text description to store in the Lidar LAS file for the ver-
 tical coordinate system for the elevations. If nothing is supplied the default one (if any)
 for the supplied VERT_CS_CODE will be used.
 l FILE_SOURCE_ID - specifies a File Source ID numeric value to store in the exported LAS
 file header. If not specified and one of the input files is a LAS file with this value specified
 it will be used.
 l GLOBAL_ENCODING - specifies a Global Encoding numeric value to store in the exported
 LAS file header. If not specified and one of the input files is a LAS file with this value spe-
 cified it will be used.
 l SYSTEM_ID - specifies a System ID value to store in the exported LAS file header. If not
 specified and one of the input files is a LAS file with this value specified it will be used.
 l GEN_SOFTWARE - specifies a Generating Software value to store in the exported LAS file
 header. If not specified and one of the input files is a LAS file with this value specified it
 will be used. Otherwise 'Global Mapper' will be used.
 l INC_COLOR - specifies that a color value should be included with each point sample from
 the loaded raster layers (or from the original points if they were Lidar points with a color
 value). Use INC_COLOR=YES to enable. If not specified, the default will be set to YES if
 any point clouds with color values are part of the export.
 l NO_PROJ_HEADER - specifies whether or not the current projection should be written in
 the LAS header. Use NO_PROJ_HEADER=YES to cause the projection to not be written.
 l HEADER_OFFSET - specifies a custom header offset to use in the LAS file rather than an
 automatically determined one. The offset should be specified as a comma-delimited list
 of the X, Y, and Z offsets, such as HEADER_OFFSET="100000.0,200000.0,0.0".
 If you want the offset used for the original input file (if a Lidar point cloud), use HEADER_
 OFFSET="KEEP_ORIG".
 - 223 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_VECTOR
 l HEADER_SCALE - specifies a custom header scale factor to use in the LAS file rather than
 an automatically determined one. The offset should be specified as a comma-delimited
 list of the X, Y, and Z scales, such as HEADER_OFFSET="0.01,0.01,0.001" to spe-
 cify precision of 100ths of units in X and Y and thousandths in Z. If you want the offset
 used for the original input file (if a Lidar point cloud), use HEADER_SCALE="KEEP_ORIG".
 l FLIGHT_DATE - specifies the flight date or data edit date to store in the exported LAS file
 header. This can be either the day of the current year (value 1 to 366) or a common date
 format, including month, day, and year. If not specified the current date will be used.
 l SORT_FIELD - provides one or more instances of this field if you want to sort the expor-
 ted Lidar points by one or more fields. The parameter value is the sort field name, option-
 ally followed by a semi-color and 0 for descending order or 1 for ascending order (the
 default). For example, to sort first by GPS time, then by return number within that, add
 the following 2 fields: SORT_FIELD="GPS_TIME;1" SORT_FIELD="RETURN_NUM;1". The
 following field names are supported: "ELEVATION", "CLASS", "INTENSITY", "RETURN_
 NUM", "RETURN_CNT", "EDGE_FLIGHT_LINE", "SYNTHETIC", "KEY_POINT", "WITHHELD",
 "OVERLAP", "SCAN_DIR", "SCAN_ANGLE", "SCANNER_CHANNEL", "USER_DATA",
 "SOURCE_ID", "GPS_TIME", "RED", "GREEN", "BLUE", "NIR", "NDVI", "NDWI", "HEIGHT_
 ABOVE_GROUND", "RETURN_HEIGHT_DELTA", "DENSITY".
Land/XML Fields
 l EXPORT_TYPE - type of data to be exported. To export more than one type, separate the
 types with a comma Example: EXPORT_TYPE="CONTOURS,POINTS". Choices are:
 l POINTS - point or Lidar features
l CONTOURS - contour lines (line features with one of the "Contour Line" clas-
 - 224 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_VECTOR
 sifications)
 l WATERSHEDS - watershed area features
 l ELEV_UNITS - the unit for the elevation data. Choices are FEET and METERS.
 - 225 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_WEB
EXPORT_WEB
The EXPORT_WEB command exports all currently loaded data to a tiled web format. The fol-
lowing parameters are supported by the command.
 l FILENAME - output file name. For Google Maps, Bing, and OSM, this is the name of the
 HTML file that will be used to display the tiles. For TMS, this is the name of the XML file
 that contains the tile info. For KML Raster, this is the name of the KML/KMZ file. For
 MBTiles, this is the name of the SQLite database, with an extension of ".mbtiles". For
 RMaps, this is the name of the SQLite database, with an extension of ".sqlite". In all of
 these cases, the EXPORT_WEB command will create a new output file.
 l EXPORT_LAYER - filename or description of layer(s) to export. By default all compatible
 and exportable layers are exported. You can include multiple EXPORT_LAYER parameters
 if you have multiple masks to search. Wildcards (* and ?) are supported. Hidden layers
 are not considered.
 l TYPE - type of vector file we're exporting to
 l GOOGLE_MAPS - Google Maps Tiles
 l MAX_ZOOM_LEVEL
 - highest zoom level for which tiles will be created.
 Valid zoom levels, and associated resolution using the default 256 x 256 pixel tiles are:
 l 0 or not provided - automatically choose a default zoom level to capture the full
l 4 - 9784 meters/pixel
l 5 - 4892 meters/pixel
l 6 - 2446 meters/pixel
l 7 - 1223 meters/pixel
l 8 - 611 meters/pixel
l 9 - 306 meters/pixel
l 10 - 153 meters/pixel
l 11 - 76 meters/pixel
l 12 - 38 meters/pixel
l 13 - 19 meters/pixel
l 14 - 9.6 meters/pixel
l 15 - 4.8 meters/pixel
l 16 - 2.4 meters/pixel
 - 226 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_WEB
 l 17 - 1.19 meters/pixel
 l 18 - 0.60 meters/pixel
 l 19 - 0.30 meters/pixel
 l 20 - 0.15 meters/pixel
 l 21 - 0.07 meters/pixel
 l 22 - 0.04 meters/pixel
 l 23 - 0.02 meters/pixel
l NUM_ZOOM_LEVELS - contains the number of zoom levels to be created. The default is
 5.
l MAP_NAME - user-defined name for the map.
l IMAGE_FORMAT - is the format to be used for the images. Choices are "PNG", "JPG"and
 "GMG". The default is "PNG". To export terrain tiles using the Global Mapper Grid (GMG)
 format, use IMAGE_FORMAT="GMG".
l QUALITY - For JPG format images specify the quality
l BG_MAP_NAME (Google Maps tiles only) - type of map to use as the background:
 l ROADMAP - Road map
l TRANSLUCENCY - amount of translucency for the tiles. The value must be between 0.0
 and 1.0. 1.0 is Opaque, and the image gets more translucent as the numbers get lower.
 0.0 is treated the same as 1.0. The default is 1.0.
l TILE_PATH - contains the directory where the tiles should be stored. If this is not spe-
 cified, the tiles will be written to the directory specified for the FILENAME parameter.
l CUSTOM_TILE_FILENAME - custom definition for tile filenames. Use variables %z for
 zoom, %x for column, and %y for row. For example, use "%z\\prefix_%y_%x.png" to cre-
 ate one folder per zoom level. The tiles will be created in the path under the HTML file-
 name path.
l TILE_SIZE - use this to override the default tile size for the selected TYPE. This value spe-
 cifies the size of each tile in the resulting tile set. For example, using TILE_SIZE=1024
 will result in tiles of size 1024x1024 being created rather than the default (typically
 256x256).
l MBT_DESCRIPTION (MBTiles only) - map description that will be added to the MBTiles
 metadata .
l MBT_MAP_TYPE (MBTiles only)- indicates the type of map . Valid values are (default is
 "overlay"):
 l BASEMAP - This map will be the base map.
 - 227 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_WEB
The following parameters accept boolean values ("YES" or "NO") to turn on or off the asso-
ciated option (the default is no, but by listing the parameter it will be set to yes).
 l WEB_NO_TRANSPARENCY - Do not use transparent background pixels
 l WEB_HIDE_PROGRESS - Hide the progress bar windows
 l WEB_ADD_SCALE_BAR (Google Maps Only) - Add a scale bar to the map
 l WEB_ADD_MAP_TYPE_CONTROL (Google Maps Only) - Add a map type control
 l WEB_ADD_OVERVIEW_MAP (Google Maps Only) - Add an Overview Map
 l WEB_ADD_PAN_CONTROL(Google Maps Only) - Controls the display of map
 l WEB_ADD_STREET_VIEW (Google Maps Only) - Add a Google Street View
 l WEB_ADD_ZOOM_CTRL(Google Maps Only) - Control the initial resolution at which to dis-
 play the map
 l WEB_AUTO_GRID (KML Raster only) - Create a default grid
 l WEB_SKIP_EMPTY_TILES - Skip tiles that have no data
 l WEB_USE_JAVA_FILE_NAMES (World Wind only) - Create names for World Wind Java
 l WEB_TRANSPARENT_TILES - Make the image tiles transparent
 l WEB_SKIP_EXISTING_TILES - Skip tiles that already exist (resuming export)
 l WEB_FILL_TO_TILE_BOUNDS - Fill the tiles to the bounds
 l WEB_NO_HTML_FILE - Generate tiles only, no HTML file
 l WEB_FORCE_PALETTE_PNG - Force the PNG to have palette instead of RGB
 l WEB_FULL_TILES_ONLY - Only export tiles that are fully covered
 l WEB_USE_LAT_LON_TILES - If provided, the tiles will be exported in the lat/lon/WGS84
 (EPSG 4326) projection rather than Web Mercator
 - 228 -
 Global Mapper Scripting Reference Section 13: Export
 EXPORT_WEB
 - 229 -
 Global Mapper Scripting Reference Section 14: Shared Parameters
 Cropping Operations to Polygons/Areas
Shared Parameters
 Cropping Operations to Polygons/Areas 230
 Gridding/Tiling Operations into Smaller Chunks 232
 Specify Bounds for Operation 234
 - 230 -
 Global Mapper Scripting Reference Section 14: Shared Parameters
 Cropping Operations to Polygons/Areas
 command the results will contain everything outside the crop areas but within the full
 export bounds.
l POLYGON_CROP_COMBINE_DUPS - specifies that if a POLYGON_CROP_FILE is specified
 that contains multiple polygons and POLYGON_CROP_USE_EACH is set, whether or not
 polygons with duplicate values for the attribute used for filenaming will be combined into
 a single export or split into separate exports. The default is POLYGON_CROP_COMBINE_
 DUPS=YES.
l POLYGON_CROP_BBOX_ONLY - specifies that if the POLYGON_CROP_USE_EACH para-
 meter is specified that each export should just be cropped to the bounding box of each
 polygon rather than the actual boundary of the polygon. Use POLYGON_CROP_BBOX_
 ONLY=YES to enable only cropping to the bounding box.
l POLYGON_CROP_GRID_ONLY - specifies that any crop polygon(s) are used only to
 determine which tile/grid cells will be exported. For each tile/grid cell that intersects a
 crop polygon, the full tile/grid cell will be exported. Use POLYGON_CROP_GRID_
 ONLY=YES to enable.
l POLYGON_CROP_INT_DATA_BOUNDS - control how the bounding box for the export is
 determined if a crop polygon is specified. If this option is disabled, the export bounds will
 be the bounds of the crop area(s), even if they extend outside the data bounds, unless
 you explicitly specified a bounding box in the other parameters (i.e. LAYER_BOUNDS,
 GLOBAL_BOUNDS, etc.). If the option is enabled, the export bounds will be the inter-
 section of the crop area bounds and the non-cropped bounding box (i.e. full data bounds
 or specified bounds in other parameter). This parameter is enabled by default, use
 POLYGON_CROP_INT_DATA_BOUNDS=NO to disable.
l POLYGON_CROP_NAME_ATTR - used to control the filenames generated when cropping
 to multiple polygons using the POLYGON_CROP_USE_EACH parameter. See special Attrib-
 ute Name parameter details. This value will be appended to any filename specified in the
 EXPORT FILENAME parameter. If no value is provided, the exported files will be sequen-
 tially numbered.
l POLYGON_CROP_FOLDER_ATTR - used to control the filenames generated when crop-
 ping to multiple polygons using the POLYGON_CROP_USE_EACH parameter. See special
 Attribute Name parameter details.
l POLYGON_CROP_FILENAME_SUFFIX - specifies the text to insert in the output filename
 just before the file extension when cropping to polygons. For example, if you add
 POLYGON_CROP_FILENAME_SUFFIX="_out", the original FILENAME was "my_
 file_.dem" and the value from the polygon was "A1", you would get an output filename
 of "my_file_A1_out.dem".
l POLYGON_CROP_COMPARE_STR - specifies a compare string to use to filter out the
 areas in the polygon crop file. See the COMPARE_STR parameter for the EDIT_VECTOR
 script command for details.
 - 231 -
 Global Mapper Scripting Reference Section 14: Shared Parameters
 Gridding/Tiling Operations into Smaller Chunks
EXAMPLE
GLOBAL_MAPPER_SCRIPT VERSION=1.00
EXPORT_RASTER FILENAME="C:\TEMP\" SPATIAL_RES="1, 1" TYPE=GEOTIFF\
POLYGON_CROP_FILE="ne_10m_admin_0_countries.shp" POLYGON_CROP_USE_EACH=YES POLYGON_CROP_NAME_
ATTR="<Feature Name>" POLYGON_CROP_FILENAME_SUFFIX="_crop.tiff"
l GRID_KEEP_CELL_SIZE - specifies that the size of the grid cells should be maintained over
 sample spacing. This means that if you specify a grid of 4 rows and 5 columns, each grid
 cell will be exactly 25% of the total export height and 20% of the total export width. The
 sample spacing may be slightly smaller than what is specified in order to achieve this. By
 default, the sample spacing is exactly maintained and each grid cell may be slightly larger
 than specified to maintain an integer number of exported cells. Use GRID_KEEP_CELL_
 SIZE=YES to enable.
l GRID_NAMING - specifies how to name tiles when gridding an export into multiple tiles.
 The value should be SEQUENTIAL for sequential numeric naming starting at 1, SEPARATE
 for separate prefix appending by row and column, or SEPARATE_COLS_FIRST for separate
 prefix appending by columns and rows. For the SEPARATE options, use the GRID_
 NAMING_COLS and GRID_NAMING_ROWS parameters to specify the details of how to
 name the rows and columns. The value will be appended to FILENAME specified in the
 EXPORT command. If no GRID_NAMING parameter is supplied, the last selected grid nam-
 ing options selected in the user interface will be used.
l GRID_NAMING_COLS - specifies how to name the column portion of grid cell names
 when using the GRID_NAMING=SEPARATE or GRID_NAMING=SEPARATE_COLS_FIRST
 parameter. The value of this field is a comma-delimited list with the following field val-
 ues:
 l Naming type. Can have the following values:
 You can leave values blank if they don't apply or you want to use the default. As an
 example, to do numeric naming starting at the number 100, increasing by 10 each time
 with a prefix of DEM, you would use GRID_NAMING_COLS="NUM,100,DEM,10".
l GRID_NAMING_ROWS - specifies how to name the row portion of grid cell names when
 using the GRID_NAMING=SEPARATE parameter. See the documentation for the GRID_
 NAMING_COLS parameter above for details on the format.
l GRID_NAMING_PREPEND_ZEROES - specifies whether or not to prepend zeroes to the
 start of grid column/row names. Use GRID_NAMING_PREPEND_ZEROES=NO to disable
 the prepending of zeroes.
l GRID_NAMING_SEPARATOR - specifies the separator string to use between pieces of a
 grid name. The default is an underscore (_).
 - 233 -
 Global Mapper Scripting Reference Section 14: Shared Parameters
 Specify Bounds for Operation
Built-in Variables
For any command that breaks up an operation in to multiple pieces using gridding, you can use
one of the special character sequences below in a parameter of the command to use a piece of
information about the grid cell being exported in the export (i.e. parts of grid cell filename). The
examples of what the values will be based on a current grid filename of
'C:\path\to\my\data\my_file_A1.dem' are listed:
 l %TILE_DIR% - full path to current file (value is 'C:\path\to\my\data\')
 l %TILE_FNAME_W_DIR% - full path and filename of current file (value is
 'C:\path\to\my\data\my_file_A1.dem')
 l %TILE_FNAME% - filename of current file (value is 'my_file_A1.dem')
 l %TILE_FNAME_WO_EXT% - filename of current file without extension (value is 'my_file_
 A1')
 - 234 -
 Global Mapper Scripting Reference Section 14: Shared Parameters
 Specify Bounds for Operation
l LAYER_BOUNDS_EXPAND - specifies that the operation should expand the used LAYER_
 BOUNDS bounding box by some amount. The amount to expand the bounding rectangle
 by should be specified in the current global projection. For example, if you have a UTM/-
 meters projection active and want to expand the bounds retrieved from the LAYER_
 BOUNDS parameter by 100 meters on the left and right, and 50 meters on the top and
 bottom, you could use LAYER_BOUNDS_EXPAND="100.0,50.0". You can also spe-
 cify a single value to apply to all 4 sides, or supply 4 separate values in the order
 left,top,right,bottom.
l SNAP_BOUNDS_TO_MULTIPLE - specifies that the top-left corner of the bounding box
 for the operation should be snapped to a multiple of the given value. For example, using
 SNAP_BOUNDS_TO_MULTIPLE=1 will snap the top-left corner to the nearest whole
 number. The values will always go smaller for X/easting/longitude and larger to
 Y/northing/latitude so you always get at least what is requested.
l SNAP_BOUNDS_TO_SPACING - specifies that the top-left corner of the bounding box for
 the operation should be snapped to a multiple of the resolution of the operation. For
 example, if you are exporting at 5 meter spacing, the top left corner will be snapped to
 the nearest multiple of 5. Use SNAP_BOUNDS_TO_SPACING=YES to enable or SNAP_
 BOUNDS_TO_SPACING=NO to disable. If not provided, the global setting for snapping
 exports to the nearest sample spacing boundary from the Advanced section of the Gen-
 eral tab of the Configuration dialog will be used.
l USE_EXACT_BOUNDS - specifies that the exact bounds that were defined in the com-
 mand should be used. Generally, when the bounds specified in a command are not the
 same as the data bounds, the command uses the intersection between the two. When
 USE_EXACT_BOUNDS=YES is specified, the command will use the bounds as specified,
 instead of the intersection.
 - 235 -
 Global Mapper Scripting Reference Section 15: Batch Mode Operation
 Batch variables
Note that your script files need to have an extension of .gms for this to work.
Batch variables
When running in batch mode you can define variables on the command line so they will be
available when running the script. You provide pairs of tokens on the command line, after the
file name. Each pair must look like:
-<var name> <var value>
or
/<var name> <var value>
This defines two variables that can be used in the script: var1=01 and var2=33. See the DEFINE_
VAR command for details on how to use variables.
Batch options
/showprogress - if present, instructs Global Mapper to display progress bars while processing a
script. This parameter only has an effect when running a script from the command line.
 - 236 -
 Global Mapper Scripting Reference Section 16: Sample Scripts
Sample Scripts
Crop, Merge, and Reproject 4 USGS DRGs into new GeoTIFF and JPEG files
GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL
// Import the four 24K DRGs that we want to merge. We use the CLIP_COLLAR option
// to indicate that we want the collar to be automatically removed from the
// DRGs when they are imported.
IMPORT FILENAME="C:\DATA\DRG\KANSAS CITY\O39094B2.TIF" \
 TYPE=AUTO ANTI_ALIAS=NO AUTO_CONTRAST=NO CLIP_COLLAR=AUTO TEXTURE_MAP=NO
IMPORT FILENAME="C:\DATA\DRG\KANSAS CITY\O39094A1.TIF" \
 TYPE=AUTO ANTI_ALIAS=NO AUTO_CONTRAST=NO CLIP_COLLAR=AUTO TEXTURE_MAP=NO
IMPORT FILENAME="C:\DATA\DRG\KANSAS CITY\O39094A2.TIF" \
 TYPE=AUTO ANTI_ALIAS=NO AUTO_CONTRAST=NO CLIP_COLLAR=AUTO TEXTURE_MAP=NO
IMPORT FILENAME="C:\DATA\DRG\KANSAS CITY\O39094B1.TIF" \
 TYPE=AUTO ANTI_ALIAS=NO AUTO_CONTRAST=NO CLIP_COLLAR=AUTO TEXTURE_MAP=NO
// Load a projection file to set the global projection to geographic (lat/lon)
// arc degrees with a datum of NAD83.
LOAD_PROJECTION FILENAME="C:\DATA\PRJ Files\geo_degrees_nad83.prj"
// Use the EXPORT_RASTER command to generate a new 8-bit per pixel GeoTIFF file
EXPORT_RASTER FILENAME="C:\DATA\EXPORTED DATA\merged_drg_8bpp.tif" \
 TYPE=GEOTIFF PALETTE=OPTIMIZED
// Now, use the EXPORT_RASTER command to generate a grayscale GeoTIFF file. Lets
// also create a world file for this one
EXPORT_RASTER FILENAME="C:\DATA\EXPORTED DATA\merged_drg_gray.tif" \
 TYPE=GEOTIFF PALETTE=GRAYSCALE GEN_WORLD_FILE=YES
// Create a JPEG file using the EXPORT_RASTER command. Also create a world file
// and a projection file to make it easier to load in other places.
EXPORT_RASTER FILENAME="C:\DATA\EXPORTED DATA\merged_drg.jpg"\
 TYPE=JPEG GEN_WORLD_FILE=YES GEN_PRJ_FILE=YES
Generate Contours from all USGS DEMs in a Folder and Export them to DXF and
Shape files
GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL
// Loop over all DEM files in a folder and convert them
DIR_LOOP_START DIRECTORY="C:\DATA\SDTS_DEM\24K\" FILENAME_MASKS="*.DEM.STDS.TAR.GZ" RECURSE_
DIR=NO
// Import an archived SDTS DEM file. Global Mapper will automatically
// determine that this is an archived SDTS DEM file and load it
// correctly.
IMPORT FILENAME="%FNAME_W_DIR%" ANTI_ALIAS=YES
// Generate 50 ft contours from the loaded DEM data.
GENERATE_CONTOURS INTERVAL=50 ELEV_UNITS=FEET
// Export the contours to a new DXF file. The created file will have
// 3D polyline features for the contours.
EXPORT_VECTOR FILENAME="%DIR%%FNAME_WO_EXT%_CONTOURS.DXF" TYPE=DXF GEN_PRJ_FILE=YES
// Export the contours to a 3D shape file.
EXPORT_VECTOR FILENAME="%DIR%%FNAME_WO_EXT%_CONTOURS.SHP" TYPE=SHAPEFILE \
SHAPE_TYPE=LINES GEN_3D_LINES=YES GEN_PRJ_FILE=YES
// Unload the loaded data
UNLOAD_ALL
// End the loop
DIR_LOOP_END
 - 237 -
 Global Mapper Scripting Reference Section 16: Sample Scripts
// Loop over all las files in a folder and classify them into ground points and non ground
points
DIR_LOOP_START DIRECTORY="%DATA_DIR%\" FILENAME_MASKS="*.las" RECURSE_DIR=NO
// Extract buildings
LIDAR_EXTRACT FILENAME=%FNAME% GRID_BIN_SIZE="-0.6" TYPE=BUILDING LIDAR_PLANE_MAX_OFFSET="0.25"
LIDAR_PLANE_MAX_ANGLE="25" SIMPLIFICATION="4"
 - 238 -
 Global Mapper Scripting Reference Section 16: Sample Scripts
LAYER_LOOP_START FILENAME="*"
SET_LAYER_OPTIONS FILENAME="%LAYER_FNAME_W_DIR%" HIDDEN=NO
EXPORT_VECTOR FILENAME="\output\%LAYER_DESC%.shp" TYPE=SHAPEFILE SHAPE_TYPE=LINES
EXPORT_VECTOR FILENAME="\output\%LAYER_DESC%.shp" TYPE=SHAPEFILE SHAPE_TYPE=POINTS
EXPORT_VECTOR FILENAME="\output\%LAYER_DESC%.shp" TYPE=SHAPEFILE SHAPE_TYPE=AREAS
SET_LAYER_OPTIONS FILENAME="%LAYER_FNAME_W_DIR%" HIDDEN=YES
LAYER_LOOP_END
 - 239 -
 Global Mapper Scripting Reference Section 16: Sample Scripts
//Import LAS
DEFINE_VAR NAME="LASDIR" PROMPT="DIR" ABORT_ON_CANCEL="YES" PROMPT_TEXT="LAS directory"
VALUE="%SCRIPT_FOLDER%"
DEFINE_VAR NAME="OUTDIR" VALUE="%LASDIR%CLASSIFIED"
SET_LOG_FILE USER_FILENAME="%OUTDIR%\%LOGFILE_NAME%"
LOG_MESSAGE 1- LiDAR control processing started at %DATE% %TIME%
LOG_MESSAGE
LOG_MESSAGE 2- Classifying ground points
LOG_MESSAGE
- 240 -