GlobalMapper ScriptingReference
GlobalMapper ScriptingReference
bluemarblegeo.com
Copyright 1993-2020, Blue Marble Geographics, All Rights Reserved
Cont ent s
Looping Operations
DIR_LOOP_START 22
DIR_LOOP_END 23
VAR_LOOP_START 23
VAR_LOOP_END 25
LAYER_LOOP_START 25
LAYER_LOOP_END 26
Define data
DEFINE_SHAPE 28
DEFINE_TEXT_FILE 29
DEFINE_VAR 31
DEFINE_VAR_TABLE 35
END_VAR_TABLE 36
Display
DEFINE_PROJ 38
LOAD_PROJECTION 40
Projection Specification Values 40
SAVE_PROJECTION 42
DEFINE_SHADER 43
DEFINE_LAYER_STYLE 44
LOAD_STYLE_FILE 45
SET_OPT 45
Layer Management
COPY_LAYER_FILES 125
GENERATE_LAYER_BOUNDS 126
SET_LAYER_OPTIONS 127
SHIFT_LAYER 140
QUERY_LAYER_METADATA 143
UNLOAD_ALL 143
UNLOAD_LAYER 144
SPLIT_LAYER 144
SORT_LAYERS 145
EDIT_MAP_CATALOG 146
Lidar Analysis
EDIT_LIDAR 192
DEFINE_LIDAR_FILTER 195
Attribute Management
ADD_MEASURE_ATTRS 233
CALC_ATTR 234
CALC_ATTR_FORMULA 235
COPY_ATTRS 236
GENERATE_REPORT 238
JOIN_TABLE 239
Attribute Name Values 240
Raster Analysis
APPLY_FORMULA 242
PAN_SHARPEN 243
GENERATE_EQUAL_VAL_AREAS 246
Export
EXPORT_ANY 250
EXPORT_CLOUD 250
EXPORT_ELEVATION 251
EXPORT_METADATA 268
EXPORT_PACKAGE 269
EXPORT_PDF 276
EXPORT_PDF3D 281
EXPORT_RASTER 282
EXPORT_VECTOR 299
EXPORT_WEB 320
Shared Parameters
Cropping Operations to Polygons/Areas 327
Gridding/Tiling Operations into Smaller Chunks 329
Specify Bounds for Operation 332
Sample Scripts
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.
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 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. Custom 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 foe 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.
%DIR% 22
%FNAME_W_DIR% 22
%FNAME% 22
%FNAME_WO_EXT% 22
%PARENT_DIR% 22
%PARENT_DIRN% 22
%RECURSE_FOLDER% 22
%LAYER_DIR% 26
%LAYER_FNAME_W_DIR% 26
%LAYER_FNAME% 26
%LAYER_FNAME_WO_EXT% 26
%LAYER_PARENT_DIR% 26
%LAYER_DESC% 26
%TIMESTAMP% 31
%DATE% 31
%TIME% 31
%TIME_SINCE_START% 31
%TIME_SINCE_LAST_LOG% 31
%SCRIPT_FILENAME% 31
%SCRIPT_FOLDER% 31
%GM_MAJOR_VER% 31
%GM_FULL_VER_W_DATE% 31
%GM_FULL_VER_NO_DATE% 31
%left% 267
%right% 267
%top% 267
%bottom% 267
%left% 275
%right% 275
%top% 275
%bottom% 275
%left% 280
%right% 280
%top% 280
%bottom% 280
%left% 298
%right% 298
%top% 298
%bottom% 298
%left% 303
%top% 303
%bottom% 303
%SPLIT_ATTR% 307
%left% 331
%right% 331
%top% 331
%bottom% 331
%TILE_DIR% 331
%TILE_FNAME_W_DIR% 331
%TILE_FNAME% 331
%TILE_FNAME_WO_EXT% 332
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
- 10 -
Global Mapper Scripting Reference Section 1:General Overview
- 11 -
Global Mapper Scripting Reference Section 1:General Overview
- 12 -
Global Mapper Scripting Reference Section 1:General Overview
- 13 -
Global Mapper Scripting Reference Section 2:Common Scripting Tasks
GLOBAL_MAPPER_SCRIPT
The GLOBAL_MAPPER_SCRIPT must be the first command in the file for scripts
prior to v18. . Typically, the entire command line will look like:
GLOBAL_MAPPER_SCRIPT VERSION=1.00
l VERSION - specifies the version of the scripting language used. This parameter
is required. You should always use VERSION=1.00.
l ENABLE_PROGRESS - specifies whether or not any progress dialogs should
be displayed while this script is processing. This is enabled by default for scripts
run in the context of the main map view or when loading workspaces. Scripts run
in their own sandbox or from them command line disable progress by default.
Use ENABLE_PROGRESS=NO to disable the display of any progress dialogs
during the processing of this script.
l GM_VERSION - specifies the Global Mapper version that a workspace (.gmw)
file was saved from. This is in v16.2.2 and later. The format will be like GM_
VERSION="16.2.2".
l TIMESTAMP - specifies the time that the workspace was saved. This will be
saved in the ISO-8601 time format, like TIMESTAMP="2015-06-
03T13:08:39Z"
l SHOW_WARNINGS - specifies whether or not warning messages should be
displayed when you are done loading the workspace/script into the main map
- 14 -
Global Mapper Scripting Reference Section 2:Common Scripting Tasks
- 15 -
Global Mapper Scripting Reference Section 2:Common Scripting Tasks
This command may be disabled from within the application interface in the
Configuration 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 command 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:
Here is a sample that calls another .exe and stores the return code of the .exe to
the variable RESULT:
- 16 -
Global Mapper Scripting Reference Section 2:Common Scripting Tasks
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 following parameters are supported by the command.
l FILENAME - full path to sound file (like .wav) to play. If not specified the inform-
ation 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 parameters are supported by this
command:
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 different 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:
- 17 -
Global Mapper Scripting Reference Section 2:Common Scripting Tasks
If you would like to log messages to the command line (if running a script passed
on the command line), make sure to include LOG_TO_COMMAND_PROMPT-
T=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%
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 messages 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 USER_FILENAME - full path to log file to write messages from the LOG_
MESSAGE command. Use this if you want your own messages to go to a
different file than any automatically generated script messages. Pass in with
an empty value to reset the LOG_MESSAGE messages to go back to the
shared file.
EXAMPLE
- 18 -
Global Mapper Scripting Reference Section 2:Common Scripting Tasks
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.
IF COMPARE_STR="%VAR1%=val1"
// Additional script commands to be run when the condition
is true.
END_IF
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 state-
ments 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:
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
- 19 -
Global Mapper Scripting Reference Section 2:Common Scripting Tasks
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 conditions, the commands after the
ELSE will be run when all of the other conditions are false.
The user can specify multiple COMPARE_STR parameters, all of which must be
true to result in the subsequent commands being executed (logical AND). Use the
COMPARE_OP="ANY" parameter to specify that the subsequent commands
should be run if any one of the conditions is true (logical OR).
IF
If the comparison condition is true, perform the subsequent commands. The if state-
ment is a code block that must be closed with an END_IF.
- 20 -
Global Mapper Scripting Reference Section 2:Common Scripting Tasks
l ANY - With multiple comparisons, the result is true if one or more of the
individual conditions is true (logical OR)
l ALL - This is the default. All comparisons must be true for the command
following the if statement to be executed.
ELSE_IF
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 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
- 21 -
Global Mapper Scripting Reference Section 3:Looping Operations
DIR_LOOP_START
The DIR_LOOP_START command begins a loop of commands over all of the
folders within a directory (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 perform 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
- 22 -
Global Mapper Scripting Reference Section 3:Looping Operations
For a sample of the DIR_LOOP_START command in use, see the example at the
bottom of this reference.
l DIRECTORY - specifies the directory to search for files in. If you leave this
blank, the operation 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
l COMMON_ELEV - a filter with all Commonly Supported Elevation Grid
Formats
l COMMON_RASTER - a filter with all Commonly Supported Raster Formats
l COMMON_VECTOR - a filter with all Commonly Supported Vector Formats
l FILENAME_MASKS_EXCLUDE - space-separated list of filename masks to
exclude from matching. Any files that match the FILENAME_MASKS but also
match a FILENAME_MASKS_EXCLUDE mask will not be looped over.
l RECURSE_DIR - specifies whether the loop operation will search subdir-
ectories of the specified directory as well as the current one. Use RECURSE_
DIR=YES to enable. The default value is to NOT search subdirectories.
l LIST_FILENAME - specifies an explicit list of files to iterate over in order. 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 INDEX_VAR - specifies the name of a variable to initialize with the current loop
index. For example, specify INDEX_VAR="FILE_IDX", then you can use
%FILE_IDX% inside the loop. It will have values starting at 0 and incrementing
by 1.
DIR_LOOP_END
The DIR_LOOP_END command ends a loop of commands over all of the folders
within a directory. 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 coordinates. Note that it is possible to
- 23 -
Global Mapper Scripting Reference Section 3:Looping Operations
nest loops and use different variable names for each loop to build complex
filenames.
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 letters 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
commands 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 variable 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.
- 24 -
Global Mapper Scripting Reference Section 3:Looping Operations
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.
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"
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.
- 25 -
Global Mapper Scripting Reference Section 3:Looping Operations
Built-in Variables
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%"
- 26 -
Global Mapper Scripting Reference Section 3:Looping Operations
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" FORMAT=GEOTIFF
- 27 -
Global Mapper Scripting Reference Section 4:Define data
Define dat a
DEFINE_SHAPE 28
DEFINE_TEXT_FILE 29
DEFINE_VAR 31
DEFINE_VAR_TABLE 35
END_VAR_TABLE 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 feathering to polygonal boundaries.
SAMPLE
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
- 28 -
Global Mapper Scripting Reference Section 4:Define data
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 defin-
ition of vector features to be associated with a name. You can then use the associ-
ated 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 allow-
ing you to embed the definition of vector features directly within a script.
The associated name can also be used with the DIR_LOOP_START command
where the definition includes a list of filepaths.
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
- 29 -
Global Mapper Scripting Reference Section 4:Define data
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)
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
- 30 -
Global Mapper Scripting Reference Section 4:Define data
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 defin-
ing 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 command 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:
- 31 -
Global Mapper Scripting Reference Section 4:Define data
rather than
value.
l YES_NO - Display prompt with Yes and No buttons. The value is set to YES
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 selec-
tion (can be full path to provide a default folder too). You can use the VALUE
parameter to provide several defaults, including default folder, default
- 32 -
Global Mapper Scripting Reference Section 4:Define data
filename, and/or default file extension. 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 existing file or a new one. This is the current default.
l VALUE_ATTR - specifies the variable value should come from the features in
the specified layer that have a non-empty value for the specified attribute. See
VALUE_ATTR_MULTI for how to decide which feature to use. You should
provide a FILENAME parameter to indicate which layer(s) to check for the attrib-
ute, or none to check all of them. See special Attribute Name parameter details.
l VALUE_ATTR_MULTI - specifies which attribute to use when multiple features
are present for a VALUE_ATTR. The supported values are:
l FIRST - (default) use the first non-empty value encountered when going
through features in the order they are in the file
l MAX - use the maximum found numeric value
l MIN - use the minimum found numeric value
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.
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 filename, then another DEFINE_VAR with that previ-
ous 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'):
- 33 -
Global Mapper Scripting Reference Section 4:Define data
SAMPLE
For example you could use the following inside a directory loop to change the
output path:
- 34 -
Global Mapper Scripting Reference Section 4:Define data
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 demonstration), then loads
it.
Example to prompt the user for a filename, then define new variables that hold
pieces of the selected filename.
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.
- 35 -
Global Mapper Scripting Reference Section 4:Define data
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 filename
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.
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
DEFINE_VAR_TABLE NAME="state_codes"
st_code,st_abb,st_name
06,ca,"california,xyz"
- 36 -
Global Mapper Scripting Reference Section 4:Define data
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"
DEFINE_VAR_TABLE NAME="state_codes" \
FILENAME="C:\Temp\GlobalMapperWorkspaces\test_tabl e.csv"
END_VAR_TABLE
DEFINE_VAR NAME="st_abb5M" VALUE_TABLE="state_codes" VALUE_
COLUMN="st_abb" \
COMPARE_STR="st_code=09"
DEFINE_VAR NAME="st_name5M" VALUE_TABLE="state_codes"
VALUE_COLUMN="st_name" \
COMPARE_STR="st_code=09"
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
- 37 -
Global Mapper Scripting Reference Section 5:Display
Display
DEFINE_PROJ 38
LOAD_PROJECTION 40
Projection Specification Values 40
SAVE_PROJECTION 42
DEFINE_SHADER 43
DEFINE_LAYER_STYLE 44
LOAD_STYLE_FILE 45
SET_OPT 45
SET_VERT_DISP_OPTS 50
SET_VIEW 52
SAVE_CURRENT_VIEW 53
RESTORE_LAST_SAVED_VIEW 53
SET_BG_COLOR 53
SHOW_3D_VIEW 53
VIEW_LAYOUT(Deprecated) 53
MAP_LAYOUT 54
END_MAP_LAYOUT 54
DEFINE_PROJ
The DEFINE_PROJ command allows a projection (including datum) to be associ-
ated 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.
- 38 -
Global Mapper Scripting Reference Section 5:Display
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 Mapper 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 projection and the set it.
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
- 39 -
Global Mapper Scripting Reference Section 5:Display
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 PRJ Filename - the value is the full path to a PRJ file that specifies the projec-
tion to use.
l Defined Projection Name - the value is the name assigned to a projection previ-
ously defined with the DEFINE_PROJ command.
l EPSG Code - the value is an EPSG code, either just the raw code, or a code
with EPSG: in front of it, like 'EPSG:4326'.
l WKT PRJ String - the value is a WKT projection string.
l Zoned Projection Name - the value is the name of a zoned projection system or
of a predefined grid system with no parameters (i.e. British Grid, Swiss Grid,
etc.). For zoned projections, the zone to use will be automatically selected for the
- 40 -
Global Mapper Scripting Reference Section 5:Display
center location of the loaded data. The datum of the current projection will be
used as will the units of the current projection (or meters if the current projection
uses degrees). For example, PROJ="UTM" will select a UTM projection with the
appropriate zone for the center lat/lon of the loaded data. Here are some recog-
nized zoned projection names (or just use the name from the projection dialog):
l UTM - Universal Transverse Mercator (6-degree zones)
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"
- 41 -
Global Mapper Scripting Reference Section 5:Display
EPSG Code
Zoned Projection name - this will select the appropriate UTM zone for the
data.
SAVE_PROJECTION
The SAVE_PROJECTION command saves the current global projection to a PRJ
file. The following parameters are supported by the command.
- 42 -
Global Mapper Scripting Reference Section 5:Display
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.
SAMPLE
- 43 -
Global Mapper Scripting Reference Section 5:Display
0.0,RGB(255,0,0)
20.0,RGB(0,255,0)
50.0,RGB(0,0,255)
END_DEFINE_SHADER
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.
l NAME - specifies the name to associate with the style. Use this value in an
IMPORT command with the AREA_STYLE_NAME, LINE_STYLE_NAME, or
POINT_STYLE_NAME parameters.
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.
- 44 -
Global Mapper Scripting Reference Section 5:Display
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 create 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.
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:
- 45 -
Global Mapper Scripting Reference Section 5:Display
l HECTARES
l SQUARE FEET
l SQUARE KILOMETERS
l SQUARE METERS
l SQUARE MILES
units for long (i.e. meters for shorter distances, kilometers for longer)
l BASE - always use base units, regardless of size. For example, always use
meters for distance. Use this if you want to numerically compare values
l LARGE - always use large units, regardless of size. For example, always
use kilometers 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.
- 46 -
Global Mapper Scripting Reference Section 5:Display
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 (sorted 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_MiscOpt_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
bounding 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 mainta-
ing the bounds, or 0 to use the default of keeping the spacing the same and
growing the bounds slightly if needed.
l EXPORT_BOUNDS_SNAP_PIXEL - controls whether or not the top-left
corner of an export bounds will be snapped to align with the closest pixel of
the data being exported. Use MISC_OPT_VALUE="1" to enable this
snapping, or MISC_OPT_VALUE="0" to disable (the default).
l EXPORT_BOUNDS_SNAP_SPACING - controls whether or not the top-left
corner of an export bounds will be snapped to align with the closest sample
spacing boundary. 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
Values range from 0 for only critical errors to 4 to log everything, including
debug messages. 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 feature types to display based on zoom level. The valid range is -150 to
- 47 -
Global Mapper Scripting Reference Section 5:Display
+150. Values less than zero mean to draw feature types sooner than you
normally would based on classification. 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 1 - First Return
l 2 - Second Return
l 3 - Last Return
l 4 - Single Return
- 48 -
Global Mapper Scripting Reference Section 5:Display
color by elevation.
l ELEV - color by elevation of the point using the current elevation shader.
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)
SAMPLE
Example: Set an export option to snap to spacing, do an export, then restore the
previous value
LOAD_TYPE_FILTER
- 49 -
Global Mapper Scripting Reference Section 5:Display
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:
- 50 -
Global Mapper Scripting Reference Section 5:Display
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 highlight 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-
R=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.
l 1 - Average Maximum of Slope to All 8 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.
l 2 - Maximum Slope to 4 Non-Diagonal Adjacent Samples - This method
computes 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).
- 51 -
Global Mapper Scripting Reference Section 5:Display
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.
- 52 -
Global Mapper Scripting Reference Section 5:Display
spacing boundary from the Advanced section of the General tab of the Config-
uration dialog will be used.
l USE_EXACT_BOUNDS - specifies that the exact bounds that were defined in
the command should be used. Generally, when the bounds specified in a
command are not the same as the data bounds, the command uses the inter-
section between the two. When USE_EXACT_BOUNDS=YES is specified, the
command will use the bounds as specified, instead of the intersection.
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 command 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=RGB(255,255,255).
SHOW_3D_VIEW
The SHOW_3D_VIEW command displays the 3D view window with the loaded
data.
- 53 -
Global Mapper Scripting Reference Section 5:Display
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.
l FILENAME - specifies the name of a .gm_views file to use rather than embed-
ding it.
MAP_LAYOUT
The MAP_LAYOUT command defines onscreen map elements, including
margins, scale bar, legend, etc.
l FILENAME - specifies the name of a .gm_layout file to use rather than embed-
ding 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.
- 54 -
Global Mapper Scripting Reference Section 5:Display
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.
- 55 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
IMPORT
The IMPORT command imports a data file for later use. To determine the proper
import parameters, 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 parameters 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:
- 56 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
- 57 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
- 58 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
- 59 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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 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.
These parameters are shared across import and layer options commands to set
layer properties.
l HIDDEN - set to YES to cause this overlay to be hidden from view after it is
loaded. The default is to show the overlay.
l LAYER_DESC - specifies a description to use for the layer when displaying it in
the Overlay Control Center. This overrides the default description based on the
filename or other information within the file.
l LAYER_GROUP - specifies the name of the group for the layer in the Control
Center. To include multiple layers of grouping put the string <sub> in between
levels. For example to make a group with 2 levels of nesting, use LAYER_
GROUP="Top Level<sub>Next Level".
- 60 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
terrain
l CLAMP_TO_SEA_FLOOR - ignore z-values, and clamp the feature to the
l PERCENT - display the map when the map bounding box is a certain
- 61 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
- 62 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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 embed-
ded in the elevation value. Valid values are as follows:
l FEET - elevations in US feet
- 63 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
- 64 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
l MED_5X5 - (terrain layers only) use median value found in 5x5 box
l MED_6X6 - (terrain layers only) use median value found in 6x6 box
l MED_7X7 - (terrain layers only) use median value found in 7x7 box
l MED_8X8 - (terrain layers only) use median value found in 8x8 box
l MED_9X9 - (terrain layers only) use median value found in 9x9 box
l MIN_2X2 - (terrain layers only) use minimum value found in 2x2 box
l MIN_3X3 - (terrain layers only) use minimum value found in 3x3 box
l MIN_4X4 - (terrain layers only) use minimum value found in 4x4 box
l MIN_5X5 - (terrain layers only) use minimum value found in 5x5 box
l MIN_6X6 - (terrain layers only) use minimum value found in 6x6 box
l MIN_7X7 - (terrain layers only) use minimum value found in 7x7 box
l MIN_8X8 - (terrain layers only) use minimum value found in 8x8 box
l MIN_9X9 - (terrain layers only) use minimum value found in 9x9 box
l ANTI_ALIAS [DEPRECATED - use SAMPLING_METHOD instead] (elevation
and raster only) - specifies whether to remove jagged edges by making a subtle
transition between pixels. Turning off this option helps maintain the hard edges
of the pixels as they are rasterized. Use ANTI_ALIAS=YES to turn on. Anything
else turns it off.
l TRANSLUCENCY (elevation and raster only) - specifies the level of trans-
lucency (i.e. how "see-through" the layer is). Value values range from 0 to 512,
with 0 meaning the layer is completely transparent (i.e. invisible) and 512
meaning the layer is completely opaque (this is the default).
l IGNORE_ALPHA (raster only) - specifies that an embedded alpha channel in
an image should be ignored. This is useful for images that have incorrect alpha
channels. Use IGNORE_ALPHA=YES to enable.
l BLEND_MODE (elevation and raster only)- specify blend mode to use for
combining this overlay and any previously loaded overlays
l NO_BLEND - no blending is done, this is the default
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
- 65 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
l PSEUDO_NATURAL_COLOR_CIR_TO_NATURAL
l COLOR_TO_GRAYSCALE
l FEATHER_BLEND_EDGES (raster only) - specifies that the layer should be
feature-blended around one or more ledges. This is a numeric bitfield value. Add
(sum) the following values to enable blending on that edge:
l 1 - blend top edge
of values in each color band to the full range of 0-255. For imagery which
contains both black and white, this will have no affect.
- 66 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
- 67 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
collar
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
projection 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=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
- 68 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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 specified 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 simpli-
fied 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 polygon 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 particular 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.
The parameters below allow specifying how to create display labels for vector
layers.
l LABEL_FIELD - specifies the name of the attribute field to use as the label attrib-
ute 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, separ-
ate 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 characters, 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 display 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,
- 69 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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 settings.
l LABEL_PREFIX - specifies the prefix to prepend to attribute-based labels
l LABEL_SUFFIX - specifies the suffix to append to attribute-based labels
color by elevation.
l ELEV - color by elevation of the point using the current elevation shader.
- 70 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
l 1 - First Return
l 2 - Second Return
l 3 - Last Return
l 4 - Single Return
- 71 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
- 72 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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 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
SAMPLES
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 FILENAME="C:\data\Gardiner\Imagery.jp2"
TYPE="JPEG2000" \
HIDDEN="YES" CLIP_COLLAR="NONE" SAMPLING_METHOD="NEAREST_
NEIGHBOR" \
AUTO_CONTRAST="NO" CONTRAST_SHARED="YES" CONTRAST_
MODE="NONE" TEXTURE_MAP="NO" TRANSLUCENCY="512"
- 73 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
UNITS="METERS" \
LABEL_FIELD_FORCE_OVERWRITE="YES" LABEL_FIELD_SEP="0x20"\
LABEL_FIELD="NAME" CODE_PAGE="1252"
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 paramet-
ers 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 charac-
ters like '*' and '?' in the value to match on multiple files.
NOTE: All other parameters that are supported by the IMPORT command
are also supported by this command.
These parameters are shared across import and layer options commands to set
layer properties.
- 74 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
l HIDDEN - set to YES to cause this overlay to be hidden from view after it is
loaded. The default is to show the overlay.
l LAYER_DESC - specifies a description to use for the layer when displaying it in
the Overlay Control Center. This overrides the default description based on the
filename or other information within the file.
l LAYER_GROUP - specifies the name of the group for the layer in the Control
Center. To include multiple layers of grouping put the string <sub> in between
levels. For example to make a group with 2 levels of nesting, use LAYER_
GROUP="Top Level<sub>Next Level".
l ALLOW_SELECTION - set to NO to disable selection of features from this layer
using either the Feature Info or Digitizer Tools.
l ALLOW_EXPORT - set to NO to disable export from this layer.
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 elevation or raster. Also things like the coverages and tile sets for VPF
layers. To see how to set these if you are writing a script, load a file with the
settings that you want in the main user interface and then save a workspace,
then examine the IMPORT command in the .gmw file for that file and see how
the LOAD_FLAGS were set.
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 display-
able 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 values are supported:
l UNSPECIFIED - Altitude mode is determined by either the setting in the
terrain
- 75 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
l PERCENT - display the map when the map bounding box is a certain
- 76 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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 embed-
ded in the elevation value. Valid values are as follows:
l FEET - elevations in US feet
- 77 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
- 78 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
l MULTIPLY
- 79 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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
l FEATHER_BLEND_EDGES (raster only) - specifies that the layer should be
feature-blended around one or more ledges. This is a numeric bitfield value. Add
(sum) the following values to enable blending on that edge:
l 1 - blend top edge
- 80 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
channels when displaying the image. This is useful for multi-spectral imagery
which may have more than 3 color bands. The default band setup will be to use
the first three bands as follows: BAND_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)
of values 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 alter-
ation, 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 elevation 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 recog-
nized palette file to override the default colors in this layers palette or a palette
- 81 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
collar
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
projection 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
- 82 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
boundary and the north and south edges to a one degree boundary, use the
following: CLIP_COLLAR_BOUNDS=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 specified 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 simpli-
fied 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 polygon 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 particular 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.
The parameters below allow specifying how to create display labels for vector
layers.
l LABEL_FIELD - specifies the name of the attribute field to use as the label attrib-
ute 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
- 83 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
their labels replaced. If you want to build the label from multiple attributes, separ-
ate 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 characters, 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 display 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 settings.
l LABEL_PREFIX - specifies the prefix to prepend to attribute-based labels
l LABEL_SUFFIX - specifies the suffix to append to attribute-based labels
- 84 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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.
l INTENSITY - color as a grayscale image by the intensity
l CLASS - color by the point classification
l RETURN - color by the return number
l HEIGHT_ABOVE_GROUND - color by the height above ground
l POINT_SOURCE_ID - color by the point source ID
l POINT_INDEX - color by the index of the point in the cloud
l RETURN_HEIGHT_DELTA - color by the difference in height between first
and last return
l CIR - color as color infrared if NIR band present
l NDVI - color by calculated NDVI value if NIR band present
l NDWI - color by calculated NDWI value if NIR band present
l DENSITY - color by point density
l WITHHELD - color by withheld flag
l OVERLAP - color by overlap flag
l KEY_POINT - color by key point flag
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 disable 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
- 85 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
l 2 - Second Return
l 3 - Last Return
l 4 - Single Return
l 5 - First of Many Returns
l 6 - Second of Many Returns
l 7 - Third of Many Returns
l 8 - Last of Many Returns
l LIDAR_USE_INTEN_FOR_NIR - specifies that we should treat the intensity
value Lidar points as the NIR (near infrared) value if the point cloud has RGB
colors but no NIR values of its own. Use LIDAR_USE_INTEN_FOR_NIR=YES
to enable.
- 86 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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
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 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 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
IMPORT_ASCII
The IMPORT_ASCII command imports data from a generic ASCII text file for later
use. 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.
- 87 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
l POINT_AND_LINE - both point and line features (and optionally areas) will
be created from coordinate data in the file. Line features will be created
when coordinate data lines are back to back in the file. All individual coordin-
ate 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 eleva-
tion) will be used to create an elevation grid. The data will be triangulated
and gridded automatically, 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 location 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 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_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_ORDER parameter with a custom definition for the
column locations. The distances should be in meters and the bearings in
degrees relative to north.
- 88 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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)
coordinates. They actual values are the same as the DECIMAL format. The
ECEF coordinates 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
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/latitude 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 coordinate prefix is assumed.
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.
- 89 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
- 90 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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 eleva-
tion 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 projec-
tion 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-
S="1.0,1.5".
The following parameters are applicable when loading a file set as TYPE=DIST_
BEARING , TYPE=DIST_BEARING_LINE or TYPE=DIST_BEARING_SEGS
l START_POS - specifies the start position for distance-bearing files. The coordin-
ates must be given in the coordinate system of the layer. For example, if UTM if
the current projection, you might specify and easting/northing as follows:
START_POS="480000,4310000". You can also specify START_
POS="SELECTED" to use the location of a point feature selected with the Digit-
izer Tool as the position.
l DIST_BEARING_REL_TO- indicates the basis for the bearing angle. Valid
values are: TRUE_NORTH, MAG_NORTH, and GRID_NORTH. If this
parameter is not specified, the default is TRUE_NORTH.
l DIST_BEARING_UNIT- specifies the linear unit for the distance values. Both
the full name and abbreviation are valid. If this parameter is not specified, the
default is meters.
These parameters are shared across import and layer options commands to set
layer properties.
l HIDDEN - set to YES to cause this overlay to be hidden from view after it is
loaded. The default is to show the overlay.
- 91 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
terrain
l CLAMP_TO_SEA_FLOOR - ignore z-values, and clamp the feature to the
- 92 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
l PERCENT - display the map when the map bounding box is a certain
- 93 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
default projection uses the first valid option from the following, including a check
for linear versus angular numeric ranges:
l Projection of any files loaded from the same folder
l Last projection user selected on a projection dialog in this session
l Current view projection
l Projection from default.prj in global_mapper.exe path
l Projection from default.prj in User Settings File path
l Last projection user selected on a projection dialog in previous session of
GM
l Default UTM/15N/NAD83 projection
l USE_DEFAULT_POS - specifies that if no position data for a raster layer can be
automatically determined that a default position should be chosen so that it
displays. Use USE_DEFAULT_POS=YES to enable.
l PICTURE_POS - specifies that the image should be loaded as a 'picture point'
that displays the image when you select the point with the Feature Info Tool. The
value should contain the X and Y coordinates (in the projection specified for the
layer). For example to place 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 embed-
ded in the elevation value. Valid values are as follows:
l FEET - elevations in US feet
- 94 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
elevation value before applying 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 eleva-
tion 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, setting 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 custom shader.
RASTER PARAMETERS
Parameters for display of imagery. Some of the below parameters are also suppor-
ted for elevation layers.
- 95 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
l MAX_4X4 - (terrain layers only) use maximum value found in 4x4 box
l MAX_5X5 - (terrain layers only) use maximum value found in 5x5 box
l MAX_6X6 - (terrain layers only) use maximum value found in 6x6 box
l MAX_7X7 - (terrain layers only) use maximum value found in 7x7 box
l MAX_8X8 - (terrain layers only) use maximum value found in 8x8 box
l MED_2X2 - (terrain layers only) use median value found in 2x2 box
l MED_3X3 - (terrain layers only) use median value found in 3x3 box
l MAX_9X9 - (terrain layers only) use maximum value found in 9x9 box
l MED_4X4 - (terrain layers only) use median value found in 4x4 box
l MED_5X5 - (terrain layers only) use median value found in 5x5 box
l MED_6X6 - (terrain layers only) use median value found in 6x6 box
l MED_7X7 - (terrain layers only) use median value found in 7x7 box
l MED_8X8 - (terrain layers only) use median value found in 8x8 box
l MED_9X9 - (terrain layers only) use median value found in 9x9 box
l MIN_2X2 - (terrain layers only) use minimum value found in 2x2 box
l MIN_3X3 - (terrain layers only) use minimum value found in 3x3 box
l MIN_4X4 - (terrain layers only) use minimum value found in 4x4 box
l MIN_5X5 - (terrain layers only) use minimum value found in 5x5 box
l MIN_6X6 - (terrain layers only) use minimum value found in 6x6 box
l MIN_7X7 - (terrain layers only) use minimum value found in 7x7 box
l MIN_8X8 - (terrain layers only) use minimum value found in 8x8 box
l MIN_9X9 - (terrain layers only) use minimum value found in 9x9 box
l ANTI_ALIAS [DEPRECATED - use SAMPLING_METHOD instead] (elevation
and raster only) - specifies whether to remove jagged edges by making a subtle
transition between pixels. Turning off this option helps maintain the hard edges
of the pixels as they are rasterized. Use ANTI_ALIAS=YES to turn on. Anything
else turns it off.
l TRANSLUCENCY (elevation and raster only) - specifies the level of trans-
lucency (i.e. how "see-through" the layer is). Value values range from 0 to 512,
with 0 meaning the layer is completely transparent (i.e. invisible) and 512
meaning the layer is completely opaque (this is the default).
l IGNORE_ALPHA (raster only) - specifies that an embedded alpha channel in
an image should be ignored. This is useful for images that have incorrect alpha
channels. Use IGNORE_ALPHA=YES to enable.
l BLEND_MODE (elevation and raster only)- specify blend mode to use for
combining this overlay and any previously loaded overlays
l NO_BLEND - no blending is done, this is the default
l MULTIPLY
l SCREEN
l OVERLAY
l HARD_LIGHT
l COLOR_BURN
l COLOR_DODGE
l DARKEN
- 96 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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
l FEATHER_BLEND_EDGES (raster only) - specifies that the layer should be
feature-blended around one or more ledges. This is a numeric bitfield value. Add
(sum) the following values to enable blending on that edge:
l 1 - blend top edge
- 97 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
- 98 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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 specified TRANSPARENT_COLOR value to be treated as trans-
parent as well. The default value of 0 means that the colors have to exactly
match for the pixel to be treated as transparent. 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 following values are supported for cropping:
l NONE - no collar cropping is performed.
collar
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
projection 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=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
- 99 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
The parameters below allow specifying how to create display labels for vector
layers.
l LABEL_FIELD - specifies the name of the attribute field to use as the label attrib-
ute 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, separ-
ate 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
- 100 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
color by elevation.
l ELEV - color by elevation of the point using the current elevation shader.
- 101 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
l 1 - First Return
l 2 - Second Return
l 3 - Last Return
l 4 - Single Return
- 102 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
- 103 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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 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 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
SAMPLE
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.
- 104 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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_DIR_TREE
The IMPORT_DIR_TREE command imports all of the data files in a given direct-
ory tree that match a list of filename masks. The following parameters are suppor-
ted by the command. In addition, all of the option parameters for the IMPORT
command are also supported for this command.
These parameters are shared across import and layer options commands to set
layer properties.
l HIDDEN - set to YES to cause this overlay to be hidden from view after it is
loaded. The default is to show the overlay.
l LAYER_DESC - specifies a description to use for the layer when displaying it in
the Overlay Control Center. This overrides the default description based on the
filename or other information within the file.
l LAYER_GROUP - specifies the name of the group for the layer in the Control
Center. To include multiple layers of grouping put the string <sub> in between
- 105 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
levels. For example to make a group with 2 levels of nesting, use LAYER_
GROUP="Top Level<sub>Next Level".
l ALLOW_SELECTION - set to NO to disable selection of features from this layer
using either the Feature Info or Digitizer Tools.
l ALLOW_EXPORT - set to NO to disable export from this layer.
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 elevation or raster. Also things like the coverages and tile sets for VPF
layers. To see how to set these if you are writing a script, load a file with the
settings that you want in the main user interface and then save a workspace,
then examine the IMPORT command in the .gmw file for that file and see how
the LOAD_FLAGS were set.
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 display-
able 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 values are supported:
l UNSPECIFIED - Altitude mode is determined by either the setting in the
terrain
l CLAMP_TO_SEA_FLOOR - ignore z-values, and clamp the feature to the
- 106 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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 the screen size. For example, use ZOOM_DISPLAY-
Y="PERCENT,0.10,0" to display the map when its bounding box is at
least 10% of the screen size.
l PIXEL_SIZE - display the map when each display pixel is less than some
number of meters in size. For example, use PIXEL_SIZE="SCALE,10,0"
to display the map when the current display resolution is 10 meters per pixel
(or less/higher resolution).
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 value. For example, use ZOOM_DISPLAY="SCALE_
RANGE,25000,100000" to display the map when the current draw scale
is between 1:25000 and 1:100000.
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 PROJ_NAME (DEPRECATED use PROJ instead) - specifies the name of the
projection to use for this file (this will override any projection information stored
in the file). This name must have been defined with a prior DEFINE_PROJ
command.
l PROJ_FILENAME (DEPRECATED use PROJ instead)- specifies the name of
the projection (.prj) file to use for this file (this will override any projection inform-
ation stored in the file).
l PROJ_EPSG_CODE (DEPRECATED use PROJ instead) - specifies the
numeric EPSG projection code that defines the projection for this file (this will
override any projection information stored in the file). For example, use PROJ_
EPSG_CODE=26715 to define a UTM zone 15 projection with NAD27 as the
datum and meters as the units.
l PROMPT_IF_PROJ_UNKNOWN - set to NO if you don't want the user to be
prompted to select a projection if the projection of the file cannot be automat-
ically determined.
l USE_DEFAULT_PROJ - specifies that if no projection can be automatically
determined for a layer that the default projection selection should be used rather
than prompting the user. Use USE_DEFAULT_PROJ=YES to enable. The
default projection uses the first valid option from the following, including a check
for linear versus angular numeric ranges:
l Projection of any files loaded from the same folder
l Last projection user selected on a projection dialog in this session
- 107 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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 embed-
ded in the elevation value. Valid values are as follows:
l FEET - elevations in US feet
- 108 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
l ELEV_SCALE (elevation only) - specifies the scale value to apply to each eleva-
tion 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, setting 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 custom shader.
RASTER PARAMETERS
Parameters for display of imagery. Some of the below parameters are also suppor-
ted for elevation layers.
- 109 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
l MAX_6X6 - (terrain layers only) use maximum value found in 6x6 box
l MAX_7X7 - (terrain layers only) use maximum value found in 7x7 box
l MAX_8X8 - (terrain layers only) use maximum value found in 8x8 box
l MED_2X2 - (terrain layers only) use median value found in 2x2 box
l MED_3X3 - (terrain layers only) use median value found in 3x3 box
l MAX_9X9 - (terrain layers only) use maximum value found in 9x9 box
l MED_4X4 - (terrain layers only) use median value found in 4x4 box
l MED_5X5 - (terrain layers only) use median value found in 5x5 box
l MED_6X6 - (terrain layers only) use median value found in 6x6 box
l MED_7X7 - (terrain layers only) use median value found in 7x7 box
l MED_8X8 - (terrain layers only) use median value found in 8x8 box
l MED_9X9 - (terrain layers only) use median value found in 9x9 box
l MIN_2X2 - (terrain layers only) use minimum value found in 2x2 box
l MIN_3X3 - (terrain layers only) use minimum value found in 3x3 box
l MIN_4X4 - (terrain layers only) use minimum value found in 4x4 box
l MIN_5X5 - (terrain layers only) use minimum value found in 5x5 box
l MIN_6X6 - (terrain layers only) use minimum value found in 6x6 box
l MIN_7X7 - (terrain layers only) use minimum value found in 7x7 box
l MIN_8X8 - (terrain layers only) use minimum value found in 8x8 box
l MIN_9X9 - (terrain layers only) use minimum value found in 9x9 box
l ANTI_ALIAS [DEPRECATED - use SAMPLING_METHOD instead] (elevation
and raster only) - specifies whether to remove jagged edges by making a subtle
transition between pixels. Turning off this option helps maintain the hard edges
of the pixels as they are rasterized. Use ANTI_ALIAS=YES to turn on. Anything
else turns it off.
l TRANSLUCENCY (elevation and raster only) - specifies the level of trans-
lucency (i.e. how "see-through" the layer is). Value values range from 0 to 512,
with 0 meaning the layer is completely transparent (i.e. invisible) and 512
meaning the layer is completely opaque (this is the default).
l IGNORE_ALPHA (raster only) - specifies that an embedded alpha channel in
an image should be ignored. This is useful for images that have incorrect alpha
channels. Use IGNORE_ALPHA=YES to enable.
l BLEND_MODE (elevation and raster only)- specify blend mode to use for
combining this overlay and any previously loaded overlays
l NO_BLEND - no blending is done, this is the default
l MULTIPLY
l SCREEN
l OVERLAY
l HARD_LIGHT
l COLOR_BURN
l COLOR_DODGE
l DARKEN
l LIGHTEN
l DIFFERENCE
- 110 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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
l FEATHER_BLEND_EDGES (raster only) - specifies that the layer should be
feature-blended around one or more ledges. This is a numeric bitfield value. Add
(sum) the following values to enable blending on that edge:
l 1 - blend top edge
- 111 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
- 112 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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 specified TRANSPARENT_COLOR value to be treated as trans-
parent as well. The default value of 0 means that the colors have to exactly
match for the pixel to be treated as transparent. 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 following values are supported for cropping:
l NONE - no collar cropping is performed.
collar
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
projection 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=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
- 113 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
The parameters below allow specifying how to create display labels for vector
layers.
l LABEL_FIELD - specifies the name of the attribute field to use as the label attrib-
ute 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, separ-
ate 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
- 114 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
color by elevation.
l ELEV - color by elevation of the point using the current elevation shader.
- 115 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
l 1 - First Return
l 2 - Second Return
l 3 - Last Return
l 4 - Single Return
- 116 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
- 117 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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 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 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
SAMPLE
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 Geodatabase or Spatialite/SQLite.
- 118 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
SAMPLE
- 119 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
IMPORT_SPATIAL_DB
The IMPORT_SPATIAL_DB command allows the user to import spatial data from
a spatial database. 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 POSTGIS - PostGIS/PostgreSQL
- 120 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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 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 specify a single value to
apply to all 4 sides, or supply 4 separate values in the order left,top,right,bottom.
SAMPLES
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 supported 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 custom 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.
- 121 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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 resolution 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.
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. Typical values will be F32 for 32-bit floats, S32 for 32-bit signed integer, or
S16 for 16-bit signed integer.
By default the OSM tile naming schema is assumed, but you can use the paramet-
ers below to specify Google Maps or TMS tiling. If you specify a full custom URL in
OSM_BASE_URL then the tiling schema doesn't matter as much since the URL
defines the naming.
l SOURCE_TYPE - specifies the tile schema for the online source. This is suppor-
ted in v16.2.4 and later and takes precedence over the deprecated OSM_IS_
GOOGLE_MAPS and OSM_IS_TMS parameters. The acceptable values are:
l GMAP - Google Maps tiles
bottom up
l OSM_IS_GOOGLE_MAPS - add OSM_IS_GOOGLE_MAPS=YES to indicate
the source uses the Google Maps tiling scheme
l OSM_IS_TMS - add OSM_IS_TMS=YES to indicate the source uses the TMS
tiling scheme
Use the parameters below to define the bounding box to import from the source:
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 relative to the WGS84 datum. There should be 4 values in a comma-
delimited list following the parameter name. The values should be in order of
- 122 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
SAMPLE
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 command:
- 123 -
Global Mapper Scripting Reference Section 6:Import/ Open Data
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, south-
ern-most latitude, eastern-most longitude, 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 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 specify 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 resolution 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 supported by this command.
SAMPLE
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)"
- 124 -
Global Mapper Scripting Reference Section 7:Layer Management
Layer M anagement
COPY_LAYER_FILES 125
GENERATE_LAYER_BOUNDS 126
SET_LAYER_OPTIONS 127
SHIFT_LAYER 140
QUERY_LAYER_METADATA 143
UNLOAD_ALL 143
UNLOAD_LAYER 144
SPLIT_LAYER 144
SORT_LAYERS 145
EDIT_MAP_CATALOG 146
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 extrac-
ted 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.
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 parameter can be listed more than once to specify
multiple input files, like FILENAME="FILENAME_1" FILENAME-
E="FILENAME_2".
l TARGET_DIR - specifies the folder where the files will be copied to. If no
BASE_DIR parameter 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.
- 125 -
Global Mapper Scripting Reference Section 7:Layer Management
SAMPLE
GLOBAL_MAPPER_SCRIPT VERSION="1.00"
/* Copy all loaded layer files to a new folder */
COPY_LAYER_FILES TARGET_DIR="C:\NEW_DEMS" BASE_
DIR="c:\data\my_dems" OVERWRITE_EXISTING=YES
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:
created.
l POLYGON - A coverage polygon is calculated covering the features/valid
ing box is in the current projection rather than the native layer projection.
l MAX_VERTEX_COUNT - specifies the maximum number of vertices to
include in a polygonal coverage. The default is MAX_VERTEX_COUNT=32. If
the polygonal coverage has more than the specified maximum count the
polygon will be simplified until it has less vertices than the specified count.
- 126 -
Global Mapper Scripting Reference Section 7:Layer Management
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 parameter 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 selected in the Control Center.
These parameters are shared across import and layer options commands to set
layer properties.
l HIDDEN - set to YES to cause this overlay to be hidden from view after it is
loaded. The default is to show the overlay.
l LAYER_DESC - specifies a description to use for the layer when displaying it in
the Overlay Control Center. This overrides the default description based on the
filename or other information within the file.
l LAYER_GROUP - specifies the name of the group for the layer in the Control
Center. To include multiple layers of grouping put the string <sub> in between
levels. For example to make a group with 2 levels of nesting, use LAYER_
GROUP="Top Level<sub>Next Level".
l ALLOW_SELECTION - set to NO to disable selection of features from this layer
using either the Feature Info or Digitizer Tools.
l ALLOW_EXPORT - set to NO to disable export from this layer.
- 127 -
Global Mapper Scripting Reference Section 7:Layer Management
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 elevation or raster. Also things like the coverages and tile sets for VPF
layers. To see how to set these if you are writing a script, load a file with the
settings that you want in the main user interface and then save a workspace,
then examine the IMPORT command in the .gmw file for that file and see how
the LOAD_FLAGS were set.
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 display-
able 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 values are supported:
l UNSPECIFIED - Altitude mode is determined by either the setting in the
terrain
l CLAMP_TO_SEA_FLOOR - ignore z-values, and clamp the feature to the
l PERCENT - display the map when the map bounding box is a certain
- 128 -
Global Mapper Scripting Reference Section 7:Layer Management
l PIXEL_SIZE - display the map when each display pixel is less than some
number of meters in size. For example, use PIXEL_SIZE="SCALE,10,0"
to display the map when the current display resolution is 10 meters per pixel
(or less/higher resolution).
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 value. For example, use ZOOM_DISPLAY="SCALE_
RANGE,25000,100000" to display the map when the current draw scale
is between 1:25000 and 1:100000.
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 PROJ_NAME (DEPRECATED use PROJ instead) - specifies the name of the
projection to use for this file (this will override any projection information stored
in the file). This name must have been defined with a prior DEFINE_PROJ
command.
l PROJ_FILENAME (DEPRECATED use PROJ instead)- specifies the name of
the projection (.prj) file to use for this file (this will override any projection inform-
ation stored in the file).
l PROJ_EPSG_CODE (DEPRECATED use PROJ instead) - specifies the
numeric EPSG projection code that defines the projection for this file (this will
override any projection information stored in the file). For example, use PROJ_
EPSG_CODE=26715 to define a UTM zone 15 projection with NAD27 as the
datum and meters as the units.
l PROMPT_IF_PROJ_UNKNOWN - set to NO if you don't want the user to be
prompted to select a projection if the projection of the file cannot be automat-
ically determined.
l USE_DEFAULT_PROJ - specifies that if no projection can be automatically
determined for a layer that the default projection selection should be used rather
than prompting the user. Use USE_DEFAULT_PROJ=YES to enable. The
default projection uses the first valid option from the following, including a check
for linear versus angular numeric ranges:
l Projection of any files loaded from the same folder
l Last projection user selected on a projection dialog in this session
l Current view projection
l Projection from default.prj in global_mapper.exe path
l Projection from default.prj in User Settings File path
- 129 -
Global Mapper Scripting Reference Section 7:Layer Management
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 embed-
ded in the elevation value. Valid values are as follows:
l FEET - elevations in US feet
- 130 -
Global Mapper Scripting Reference Section 7:Layer Management
- 131 -
Global Mapper Scripting Reference Section 7:Layer Management
l MED_5X5 - (terrain layers only) use median value found in 5x5 box
l MED_6X6 - (terrain layers only) use median value found in 6x6 box
l MED_7X7 - (terrain layers only) use median value found in 7x7 box
l MED_8X8 - (terrain layers only) use median value found in 8x8 box
l MED_9X9 - (terrain layers only) use median value found in 9x9 box
l MIN_2X2 - (terrain layers only) use minimum value found in 2x2 box
l MIN_3X3 - (terrain layers only) use minimum value found in 3x3 box
l MIN_4X4 - (terrain layers only) use minimum value found in 4x4 box
l MIN_5X5 - (terrain layers only) use minimum value found in 5x5 box
l MIN_6X6 - (terrain layers only) use minimum value found in 6x6 box
l MIN_7X7 - (terrain layers only) use minimum value found in 7x7 box
l MIN_8X8 - (terrain layers only) use minimum value found in 8x8 box
l MIN_9X9 - (terrain layers only) use minimum value found in 9x9 box
l ANTI_ALIAS [DEPRECATED - use SAMPLING_METHOD instead] (elevation
and raster only) - specifies whether to remove jagged edges by making a subtle
transition between pixels. Turning off this option helps maintain the hard edges
of the pixels as they are rasterized. Use ANTI_ALIAS=YES to turn on. Anything
else turns it off.
l TRANSLUCENCY (elevation and raster only) - specifies the level of trans-
lucency (i.e. how "see-through" the layer is). Value values range from 0 to 512,
with 0 meaning the layer is completely transparent (i.e. invisible) and 512
meaning the layer is completely opaque (this is the default).
l IGNORE_ALPHA (raster only) - specifies that an embedded alpha channel in
an image should be ignored. This is useful for images that have incorrect alpha
channels. Use IGNORE_ALPHA=YES to enable.
l BLEND_MODE (elevation and raster only)- specify blend mode to use for
combining this overlay and any previously loaded overlays
l NO_BLEND - no blending is done, this is the default
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
- 132 -
Global Mapper Scripting Reference Section 7:Layer Management
l PSEUDO_NATURAL_COLOR_CIR_TO_NATURAL
l COLOR_TO_GRAYSCALE
l FEATHER_BLEND_EDGES (raster only) - specifies that the layer should be
feature-blended around one or more ledges. This is a numeric bitfield value. Add
(sum) the following values to enable blending on that edge:
l 1 - blend top edge
of values in each color band to the full range of 0-255. For imagery which
contains both black and white, this will have no affect.
- 133 -
Global Mapper Scripting Reference Section 7:Layer Management
- 134 -
Global Mapper Scripting Reference Section 7:Layer Management
collar
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
projection 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=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
- 135 -
Global Mapper Scripting Reference Section 7:Layer Management
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 specified 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 simpli-
fied 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 polygon 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 particular 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.
The parameters below allow specifying how to create display labels for vector
layers.
l LABEL_FIELD - specifies the name of the attribute field to use as the label attrib-
ute 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, separ-
ate 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 characters, 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 display 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,
- 136 -
Global Mapper Scripting Reference Section 7:Layer Management
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 settings.
l LABEL_PREFIX - specifies the prefix to prepend to attribute-based labels
l LABEL_SUFFIX - specifies the suffix to append to attribute-based labels
color by elevation.
l ELEV - color by elevation of the point using the current elevation shader.
- 137 -
Global Mapper Scripting Reference Section 7:Layer Management
l 1 - First Return
l 2 - Second Return
l 3 - Last Return
l 4 - Single Return
- 138 -
Global Mapper Scripting Reference Section 7:Layer Management
- 139 -
Global Mapper Scripting Reference Section 7:Layer Management
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 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.
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-
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' 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, such as COORD_OFFSET-
T="100000.0,200000.0".
l COORD_OFFSET_UNITS - String representing units to use to interpret value
obtained by "COORD_OFFSET". Accepts "M" (meters), "METERS", "FT",
"FEET", "KM", "MILES", "NM" (nautical miles), "DEGREES" (arc degrees) or
any other unit name from the projection dialog. Defaults to meters. e.g. COORD_
OFFSET_UNITS="FT"
- 140 -
Global Mapper Scripting Reference Section 7:Layer Management
- 141 -
Global Mapper Scripting Reference Section 7:Layer Management
Example: Shift a layer by 500 meters in the X direction and 300 meters in the Y
direction.
- 142 -
Global Mapper Scripting Reference Section 7:Layer Management
0.5),438118.080,4906109.990,20.60,438116.080,4906108.990,20
.10"
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 following parameters are supported
by this command:
l RESULT_VAR - specifies the name of the script variable where the metadata
will be stored.
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 command 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
UNLOAD_ALL
The UNLOAD_ALL command unloads all currently loaded data. This command
may be called with no parameters.
- 143 -
Global Mapper Scripting Reference Section 7:Layer Management
UNLOAD_LAYER
The UNLOAD_LAYER command allows you to unload all previous loaded layers
with a given filename. This is useful if you don't want to unload all previously
loaded layers just to get rid of a few of them.
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.
l SHOW_WARNINGS - specifies whether or not to show a warning if no layers
matching the FILENAME are found. Defaults to on, use SHOW_
WARNINGS=NO to disable.
SPLIT_LAYER
The SPLIT_LAYER command allows you to split a layer into multiple layers
based on some attribute value. The original layer is closed if there was any split
that happened.
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-
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' 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 gener-
ated for each set of attributes values in the input data. This can be a normal attrib-
ute 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 values 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 separator string directly. For example if you use
- 144 -
Global Mapper Scripting Reference Section 7:Layer Management
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-
E="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. 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 recog-
nized:
l LAYER_DESC_ASC - ascending order by layer description
drawn first)
l TYPE - sort by type (elevation first, then raster, then vector)
l MOVE_FRONT - move the matching layers to the front of the draw order
l SNWE
l SNEW
l WENS
l WESN
- 145 -
Global Mapper Scripting Reference Section 7:Layer Management
l EWNS
l EWSN
EDIT_MAP_CATALOG
The EDIT_MAP_CATALOG command allows you to work with map catalogs
(managed collections of map files), including create new map catalogs, adding
maps to existing map catalogs, and removing maps from existing map catalogs.
- 146 -
Global Mapper Scripting Reference Section 7:Layer Management
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"
EDIT_MAP_CATALOG FILENAME="%SCRIPT_FOLDER%catalog.gmc"
CREATE_IF_EMPTY=YES \
ADD_FILE="%SCRIPT_FOLDER%points.txt" ZOOM_
DISPLAY="PERCENT,0.10,0" \
TYPE="POINT_ONLY" COORD_DELIM="AUTO" COORD_FORMAT="DECIMAL"
- 147 -
Global Mapper Scripting Reference Section 7:Layer Management
COORD_ORDER="X_FIRST" \
INC_COORD_LINE_ATTRS="NO" COL_HEADERS="NO" INC_ELEV_
COORDS="YES"
- 148 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
CALC_VOLUMES
The CALC_VOLUMES command allows you to calculate the volume for each
area in the specified layer using the currently loaded terrain data.
l FILENAME - filename of the layer containing the areas to be used in the calcu-
lations. This parameter can be listed more than once to specify multiple input
files, like FILENAME="FILENAME_1" FILENAME="FILENAME_2".
l OUTPUT_FILENAME - specifies the path and file name of the output file for
volume statistics. 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 measure-
ments 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 calcu-
lations. This parameter is optional. The default is 0.
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
- 149 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
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 attributes.
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 following parameters are supported by the command:
- 150 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
l OUTPUT_FILENAME - specifies the path and file name of the output file for
volume statistics.
SPECIFY BOUNDS FOR O PERATION
See also Specify Bounds for Operation
- 151 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
spacing boundary from the Advanced section of the General tab of the Config-
uration dialog will be used.
l USE_EXACT_BOUNDS - specifies that the exact bounds that were defined in
the command should be used. Generally, when the bounds specified in a
command are not the same as the data bounds, the command uses the inter-
section between the two. When USE_EXACT_BOUNDS=YES is specified, the
command will use the bounds as specified, instead of the intersection.
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 combining 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 terrain layer.
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 following operations are supported:
l ADD - adds the values from the first layer to the second
- 152 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
l AVERAGE - saves the average of the values from the first and second
layers.
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 the values is missing, the sample is marked as invalid.
l DIVIDE - divides the value from the first layer by the value in the second
layer. If 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.
l FILTER_KEEP_FIRST_IF_SECOND_INVALID - saves the first layer value
if the second layer value is invalid
l FILTER_KEEP_FIRST_IF_GT_SECOND - saves the first layer value if the
second layer value is valid and the first layer value is greater than the
second layer value.
l FILTER_KEEP_FIRST_IF_LT_SECOND - saves the first layer value if the
second layer 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 location. This works with both raster and elevation data.
l COMPARE_VAL - provides a numeric value to compare against for some of the
combine operations above.
l LAYER_DESC - specifies the name to assign to the newly generated terrain
layer. If no layer description is provided, the default name of "Combined Eleva-
tion Grid" will be used.
l ELEV_UNITS - specify elevation units to use in new terrain layer
l FEET - export in US feet
- 153 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 154 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 155 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 156 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 157 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
resolution and bounds compare to the original layout for a layer. For
- 158 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 159 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 160 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 161 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 162 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 163 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 164 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 165 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
l FILL_GAPS - specifies that small gaps in between and within the data sets
being used to generate the watershed 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.
- 166 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 167 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
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 resol-
ution 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 General tab of the Configuration dialog will be used.
l USE_EXACT_BOUNDS - specifies that the exact bounds that were defined
in the command should be used. Generally, when the bounds specified in a
command are not the same as the data bounds, the command uses the inter-
section between the two. When USE_EXACT_BOUNDS=YES is specified,
the command will use the bounds as specified, instead of the intersection.
l CROPPING TO POLYGONS /AREAS
See also Cropping Operations to Polygons/Areas
- 168 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
a separate export for each polygons in that file rather than just the best-fit
polygon. See the POLYGON_CROP_BBOX_ONLY and POLYGON_
CROP_NAME_ATTR options for naming and other options when using this
parameter. Use POLYGON_CROP_USE_EACH=YES to enable. This
parameter also works with FEATHER_BLEND_EDGES. Use POLYGON_
CROP_USE_EACH=YES with FEATHER_BLEND_POLY_FILE or
FEATHER_BLEND_POLY to feather the edges of multiple polygons.
l POLYGON_CROP_EXCLUDE - specifies that the crop areas are actually
regions to exclude from the export rather than include. If you add
POLYGON_CROP_EXCLUDE=YES to the 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 parameter is specified that each export should just be
cropped to the bounding box of each polygon rather than the actual bound-
ary 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 bound-
ing 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 gener-
ated when cropping to multiple polygons using the POLYGON_CROP_
USE_EACH parameter. See special Attribute 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
sequentially numbered.
- 169 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
Shared Parameters
l SPATIAL_RES - specifies spacing of grid points used to calculate the water-
shed. 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_resol-
ution,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.
l SPATIAL_RES_METERS - specifies spatial resolution to use in meters. The
value in meters will automatically be converted to the current view/export projec-
tion 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
- 170 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
resolution 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 automatically
l LAYER - Use the sampling method set for each layer
l The list of SAMPLING_METHOD values for the IMPORT command can also
be specified to use a particular sampling method for all layers being expor-
ted/
l SHARED IMPORT SAMPLING_METHOD VALUES
THE FOLLOWING VALUES ARE SUPPORTED
l NEAREST_NEIGHBOR - use the nearest neighbor sampling method
l BILINEAR - use bilinear interpolation
l BICUBIC - use bicubic interpolation
l BOX_2X2 - use a 2x2 box average
l BOX_3X3 - use a 3x3 box average
l BOX_4X4 - use a 4x4 box average
l BOX_5X5 - use a 5x5 box average
l BOX_6X6 - use a 6x6 box average
l BOX_7X7 - use a 7x7 box average
l BOX_8X8 - use a 8x8 box average
l BOX_9X9 - use a 9x9 box average
l MAX_2X2 - (terrain layers only) use maximum value found in 2x2 box
l MAX_3X3 - (terrain layers only) use maximum value found in 3x3 box
l MAX_4X4 - (terrain layers only) use maximum value found in 4x4 box
l MAX_5X5 - (terrain layers only) use maximum value found in 5x5 box
l MAX_6X6 - (terrain layers only) use maximum value found in 6x6 box
l MAX_7X7 - (terrain layers only) use maximum value found in 7x7 box
l MAX_8X8 - (terrain layers only) use maximum value found in 8x8 box
l MED_2X2 - (terrain layers only) use median value found in 2x2 box
l MED_3X3 - (terrain layers only) use median value found in 3x3 box
l MAX_9X9 - (terrain layers only) use maximum value found in 9x9 box
l MED_4X4 - (terrain layers only) use median value found in 4x4 box
l MED_5X5 - (terrain layers only) use median value found in 5x5 box
l MED_6X6 - (terrain layers only) use median value found in 6x6 box
l MED_7X7 - (terrain layers only) use median value found in 7x7 box
l MED_8X8 - (terrain layers only) use median value found in 8x8 box
- 171 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
l MED_9X9 - (terrain layers only) use median value found in 9x9 box
l MIN_2X2 - (terrain layers only) use minimum value found in 2x2 box
l MIN_3X3 - (terrain layers only) use minimum value found in 3x3 box
l MIN_4X4 - (terrain layers only) use minimum value found in 4x4 box
l MIN_5X5 - (terrain layers only) use minimum value found in 5x5 box
l MIN_6X6 - (terrain layers only) use minimum value found in 6x6 box
l MIN_7X7 - (terrain layers only) use minimum value found in 7x7 box
l MIN_8X8 - (terrain layers only) use minimum value found in 8x8 box
l MIN_9X9 - (terrain layers only) use minimum value found in 9x9 box
l FILL_GAPS - specifies that small gaps in between and within the data sets
being used to generate the watershed 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 "Watershed" will be used.
l KEEP_ZERO_AT_ZERO - specifies whether or not to modify 0 (typically ocean)
values to allow flow to continue across expanses of 0 elevation. The default is to
enable this so 0 values don't change. If you want to model flow across 0
surfaces, add KEEP_ZERO_AT_ZERO=NO.
l SPECIFY BOUNDING BOX FOR O PERATION
See also Specify Bounds for Operation
- 172 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 173 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 174 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
they extend outside the data bounds, unless you explicitly specified a bound-
ing 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 gener-
ated when cropping to multiple polygons using the POLYGON_CROP_
USE_EACH parameter. See special Attribute 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
sequentially numbered.
l POLYGON_CROP_FOLDER_ATTR - used to control the filenames gener-
ated when cropping 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.
SAMPLES
Calculate the water rise from the area defined by "riverarea.shp" if the water was
to increase 20 ft.
- 175 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
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.
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-
E="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 trans-
mitter that the view shed analysis will be simulating. The value must contain the
height and a units abbreviation, 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:
- 176 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 177 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 178 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 179 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
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 gener-
ate a list of the 3D coordinates between two given points in the given elevation
units. The following parameters are supported by the command.
- 180 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
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 suppor-
ted 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 vector 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="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 gridded.
l ELEV_UNITS - specify elevation units to use for new grid
l FEET - US feet
l METERS - meters
l CENTIMETERS - centimeters
Requires a Lidar module 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 Lidar module 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 Lidar module 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 spacing results in higher fidelity, but larger, elevation grids. 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 use a grid with a 30 meter spacing, the parameter/ value pair would
- 181 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 182 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
l NDVI - grids the calculate NDVI (normalized difference vegetation index) for
l CLASS - grids the classification code of the Lidar points. The classi-
fication type that occurs the most in each cell is used, with unknown /
unclassified types only being used if no known types are found.
- 183 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
l 1 - First Return
l 2 - Second Return
l 3 - Last Return
l 4 - Single Return
- 184 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 185 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
exports to the nearest sample spacing boundary from the Advanced section
of the General tab of the Configuration dialog will be used.
l USE_EXACT_BOUNDS - specifies that the exact bounds that were defined
in the command should be used. Generally, when the bounds specified in a
command are not the same as the data bounds, the command uses the inter-
section between the two. When USE_EXACT_BOUNDS=YES is specified,
the command will use the bounds as specified, instead of the intersection.
l CROPPING TO POLYGONS /AREAS
See also Cropping Operations to Polygons/Areas
- 186 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 187 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
GENERATE_POINTS_FROM_ELEV_GRID
Creates a point feature at the center of each cell in the specified elevation grid
layer(s).
- 188 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 189 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
- 190 -
Global Mapper Scripting Reference Section 8:Terrain and 3D Analysis
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 gener-
ated when cropping to multiple polygons using the POLYGON_CROP_
USE_EACH parameter. See special Attribute 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
sequentially numbered.
l POLYGON_CROP_FOLDER_ATTR - used to control the filenames gener-
ated when cropping 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.
Example:
GENERATE_POINTS_FROM_ELEV_GRID FILENAME="elev_grid.gmg" \
LAYER_DESC="grid_points" \
POLYGON_CROP_FILE="CropAreas.shp" POLYGON_CROP_USE_ALL=YES
- 191 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
Lidar Analysis
EDIT_LIDAR 192
DEFINE_LIDAR_FILTER 195
LIDAR_CLASSIFY 197
LIDAR_COMPARE 204
LIDAR_EXTRACT 206
LIDAR_THIN 211
Lidar Advanced Filter Options 211
GENERATE_POINT_CLOUD 213
LIDAR_APPLY_COLOR 216
LIDAR_AUTO_FIT 217
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:
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 operated on:
- 192 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
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 default a 3D search is done. Add USE_3D_DIST="NO" to use
only a 2D (top-down) search.
l FILENAME_NEAR - filename of the Lidar and/or line layer(s) to search near if
MAX_DIST is provided. If no value is provided, the layer(s) specified with
FILENAME are used.
l LIDAR_FILTER_NEAR_NAME - specify name of filter previously defined with
DEFINE_LIDAR_FILTER command to apply to the Lidar points search near to
get the actual set of Lidar points to search near
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 Lidar module 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 O PERATION
See also Specify Bounds for Operation
- 193 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
- 194 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
SAMPLE
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:
- 195 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
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". If no LIDAR_FILTER is provided then all types currently enabled in the
shared global Lidar filter are used.
l 0 - Unknown Returns
l 1 - First Return
l 2 - Second Return
l 3 - Last Return
l 4 - Single Return
l 5 - First of Many Returns
l 6 - Second of Many Returns
l 7 - Third of Many Returns
l 8 - Last of Many Returns
- 196 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
source IDs to keep. If no list is provided all points are kept. For example, to
keep just points with a source ID of 5 or 6, use LIDAR_SOURCE_ID_
LIST="5,6".
SAMPLE
LIDAR_CLASSIFY
The LIDAR_CLASSIFY command allows for automatically identifying and classi-
fying ground-shot or building/high vegetation points from Lidar point clouds. The
following parameters are supported by the command:
- 197 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
l GRID_BIN_SIZE - specifies how many native spacings in size to make each bin
initially for the algorithm. 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. The default is GRID_BIN_SIZE="3.0" for classifying ground points and
GRID_BIN_SIZE="1.0" for non-ground (building/tree) points. 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_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 GRID_BIN_SIZE - specifies how many native spacings in size to make each bin
initially for the algorithm. 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. The default is GRID_BIN_SIZE="3.0" for classifying ground points and
GRID_BIN_SIZE="1.0" for non-ground (building/tree) points. 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".
- 198 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
- 199 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
- 200 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
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 maximum 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 O PERATION
See also Specify Bounds for Operation
- 201 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
- 202 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
you want to restrict the grid to only those points with scan angles between 0
and 30 degrees, you could add LIDAR_SCAN_ANGLE_RANGE="0,30".
l LIDAR_FILTER - specifies a comma-separated list of Lidar class numbers
to export. 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". 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 Return
- 203 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
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 LAYER_DESC - specifies the description to use for the layer created when
comparing point clouds. The new layer will contain the points that are differ-
ent.
- 204 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
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
- 205 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
An example script to delete duplicates with the same XYZ location, intensity, and
GPS time looks like:
Example script that compares two point clouds to find changes and saves them to
a new changed points layer
LIDAR_EXTRACT
The LIDAR_EXTRACT command allows for automatically extracting building
outlines, tree points/outlines, and linear powerlines from classified Lidar point
clouds. Building extraction requires classified building points, tree extraction
requires classified high vegetation points, and powerline extraction requires classi-
fied powerline points. The following parameters are supported by the command:
- 206 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
- 207 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
- 208 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
- 209 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
l 1 - First Return
l 2 - Second Return
l 3 - Last Return
l 4 - Single Return
- 210 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
- 211 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
l 1 - First Return
l 2 - Second Return
l 3 - Last Return
l 4 - Single Return
- 212 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
DIST parameter specifies how far from an exact match to a specified color that a
point color can be to be kept.
l LIDAR_DENSITY_RANGE - specifies the range of point densities in points per
square meter to include. Any Lidar points in regions with densities outside the
range are ignored. If you use two values then everything between the values is
used. If only one value is specified then all points in areas >= to the specified
value are used. For example, LIDAR_DENSITY_RANGE="1.0" means that all
points in areas with densities of 1.0 points per square meter or higher are used.
l LIDAR_SOURCE_ID_LIST - specifies a comma-separated list of point source
IDs to keep. If no list is provided all points are kept. For example, to keep just
points with a source ID of 5 or 6, use LIDAR_SOURCE_ID_LIST="5,6".
l LIDAR_INTENSITY_RANGE - filter to only the specified intensity values. The
value is a pair of integers representing the range of intensity values to be
included. Example: LIDAR_INTENSITY_RANGE=100,15. If only the first value
is provided, it will be considered the minimum intensity value, so all values
greater than that value will be included.
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 follow-
ing parameters are supported:
- 213 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
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 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 PINHOLE
l PINHOLE_RADIAL_1
l PINHOLE_RADIAL_3
l PINHOLE_BROWN_2
l PINHOLE_FISHEYE
l SFM_USE_GLOBAL - specifies that the 'Global' SfM (Structure-from-Motion)
algorithm should be used rather than the default 'Incremental' SfM algorithm. The
Global algorithm should be a bit faster than the Incremental method, but it
requires more image overlap and the results often aren't quite as good.
- 214 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
See the SAMPLING_METHOD parameter for the IMPORT for a complete list
of recognized values.
- 215 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
LIDAR_APPLY_COLOR
The LIDAR_APPLY_COLOR command applies RGB(I) colors to points in a point
cloud from a reference image. This command requires the LiDAR add-on license.
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 layers
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.
- 216 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
- 217 -
Global Mapper Scripting Reference Section 9:Lidar Analysis
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 distance), 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).
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 criteria are met. Default value is 20.
SAMPLE
This script will adjust the Lidar cloud 'SamMBESp2p" to the best-fit match to the
cloud 'NLD':
- 218 -
Global Mapper Scripting Reference Section 10:Edit Vector Data
EDIT_VECTOR 219
COMBINE_LINES 229
CROP_AREAS_TO_LINES 231
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.
- 219 -
Global Mapper Scripting Reference Section 10:Edit Vector Data
For example, to get all features with CLASS attribute less than 3, use
COMPARE_STR="CLASS<3".
l You can also use a wild card symbol (" *") to match any character. 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. Note that when you use a wild card,
only the "=" and "!=" comparison operators will result in a successful match.
l Instead of testing a specific attribute name, you can test whether any attrib-
combine multiple criteria for your search. SeeAttribute Name Values 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 sensit-
ive 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 attrib-
ute called CFCC, or ATTR_MISSING="CFCC" to select features that do not
have an attribute called CFCC. ATTR_EXISTS and ATTR_MISSING paramet-
ers 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 condi-
tions be met to include a feature (an AND operation), but if you would like to
match on a feature if at least one condition 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 opera-
tion, 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.
- 220 -
Global Mapper Scripting Reference Section 10:Edit Vector Data
l AREA_TYPE - specifies the name of the Global Mapper area type to assign to
matching area features.
l LINE_TYPE - specifies the name of the Global Mapper line type to assign to
matching line features.
l POINT_TYPE - specifies the name of the Global Mapper point type to assign to
matching point features.
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 Lidar module license.
l ATTR_VAL - specifies the attribute value to update and what value to assign to
it. The format is attr_name=attr_value. For example if you want to set the value of
an attribute named CFCC to A34, use ATTR_VAL="CFCC=A34". You can add
multiple ATTR_VAL parameters to a single command to provide multiple attrib-
ute/value pairs (or labels) to add/ update. If you would like to update the feature
label rather than an attribute, use <Feature Name> for your attribute name.
l ATTR_TO_DELETE - specifies the name of an attribute to delete from matching
features. You can include multiple instances of this attribute to delete multiple
values. To remove the feature label rather than an attribute, use <Feature
Name> for the attribute name.
l ATTR_TO_KEEP - specifies the name of an attribute to keep from matching
features. You can include multiple instances of this attribute to specify multiple
attributes to keep. You can also include wildcard characters, like * and ?, in the
attribute name.
l ATTR_TO_RENAME - specifies the name of an attribute to rename from match-
ing features and what to rename it to. You can include multiple instances of this
- 221 -
Global Mapper Scripting Reference Section 10:Edit Vector Data
attribute to rename multiple attributes. For example, to rename the attribute, CTY
to be COUNTY, add the parameter ATTR_TO_RENAME="CTY=COUNTY" to
your command.
l ATTR_TO_COPY - specifies the name of an attribute to copy the value of an
existing attribute or label to. You can include multiple instances of this parameter
to copy multiple attributes. For example, to create a new attribute named DISP_
LABEL from the feature label, use ATTR_TO_COPY="DISP_LABEL-
L=<Feature Name>" or to create a new attribute named DEPTH from the
value of an attribute named Z, use ATTR_TO_COPY="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 attribute 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 Field Options
for a list of the supported style attributes and values. For example to set all match-
ing 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).
- 222 -
Global Mapper Scripting Reference Section 10:Edit Vector Data
- 223 -
Global Mapper Scripting Reference Section 10:Edit Vector Data
Buffer Creation
- 224 -
Global Mapper Scripting Reference Section 10:Edit Vector Data
layer the features are being matched from. The offset should be specified as a
comma-delimited list of the X and Y offsets, such as COORD_OFFSET-
T="100000.0,200000.0".
l COORD_SCALE - specifies the scale factors to apply to any coordinates for the
features that match the specified criteria. Each coordinate will be multiplied by
these scale factor. The scale factors should be specified either as a single value
(the most common scenario) or as separate scale factors for the X and Y values,
like COORD_SCALE=1.00005 for a single value, or COORD_SCALE-
E=1.0045,1.0052 for separate X and Y coordinate scales.
l ROTATE_ANGLE - specifies the angle in degrees by which to rotate matching
features by clockwise around some point. The ROTATE_ABOUT parameter
specifies what point the feature coordinates are rotated about.
l ROTATE_ABOUT - if a non-zero ROTATE_ANGLE value is specified, specifies
the point that the features should be rotated about, with the default being about
the center of all matching features. The following values are supported:
l COMBINED_CENTER - rotates about the combined center of all matching
independently.
l Manually specified location - you can manually specify the X and Y coordin-
ates to rotate about (in the projection of the layer being rotated), like
ROTATE_ABOUT="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="<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 useful 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 matching area and line features. It can contain a horizontal threshold (e.g.,
SIMPLIFICATION="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 current projection) that a point has to be before it is kept. Vertices that
are this distance or further from the straight line will be kept. Vertices that are
closer than this distance from the straight line will be discarded.
- 225 -
Global Mapper Scripting Reference Section 10:Edit Vector Data
l The vertical threshold applies only to 3D data, and will be applied to the
vertex elevations. 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 difference 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 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 inter-
sections 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.
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 sequen-
tially (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 matching features should be created. Use CREATE_COVERAGE_
AREAS=YES to enable.
- 226 -
Global Mapper Scripting Reference Section 10:Edit Vector Data
- 227 -
Global Mapper Scripting Reference Section 10:Edit Vector Data
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':
Here is an example illustrating how to add evenly spaced points every 200 meters
along the features containing a CLASS attribute with a value of '1'. Point features
will also be created at the end point, and at each current vertex:
- 228 -
Global Mapper Scripting Reference Section 10:Edit Vector Data
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.
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 connecting 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 combining.
- 229 -
Global Mapper Scripting Reference Section 10:Edit Vector Data
- 230 -
Global Mapper Scripting Reference Section 10:Edit Vector Data
- 231 -
Global Mapper Scripting Reference Section 10:Edit Vector Data
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.
- 232 -
Global Mapper Scripting Reference Section 11:Attribute Management
At t ribut e M anagement
ADD_MEASURE_ATTRS 233
CALC_ATTR 234
CALC_ATTR_FORMULA 235
COPY_ATTRS 236
GENERATE_REPORT 238
JOIN_TABLE 239
Attribute Name Values 240
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.
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 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 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"
- 233 -
Global Mapper Scripting Reference Section 11:Attribute Management
units for long (i.e. meters for shorter distances, kilometers for longer)
l BASE - always use base units, regardless of size. For example, always use
meters for distance. Use this if you want to numerically compare values
l LARGE - always use large units, regardless of size. For example, always
use kilometers 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 number, or the value from another attrib-
ute of the feature.
l FILENAME - filename of the layer to update. If an empty value is passed in, all
loaded vector layers will be updated. 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 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
saves the result into the new attribute. The SEP_STR parameter defined
below is used to separate the second value from the source.
- 234 -
Global Mapper Scripting Reference Section 11:Attribute Management
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 Attrib-
ute Name parameter details.
l SOURCE_ATTR - specifies the attribute value to start with when creating the
new attribute. See special Attribute Name parameter details.
l VALUE_ATTR - specifies the attribute value to use as the 2nd value of the calcu-
lation. See special Attribute Name parameter details.
l VALUE - specifies the value to use as the 2nd value of the calculation. For
numeric operations 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 separ-
ator at all.
SAMPLE
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.
l FILENAME - filename of the layer to update. If an empty value is passed in, all
loaded vector layers will be updated. 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
- 235 -
Global Mapper Scripting Reference Section 11:Attribute Management
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 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 Attrib-
ute 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
numeric, or as string otherwise.
l NUMERIC - calculations are performed as numeric.
l STRING - calculations are performed as string.
l FORMULA specifies the formula to be used to create the new attribute values.
See the formula calculator reference documentation for details.
SAMPLE
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.
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 filename, so to match all layers, use *.
- 236 -
Global Mapper Scripting Reference Section 11:Attribute Management
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 filename, so to match all layers, use *.
l TO_TYPE - defines the type of features to copy attributes to. The following
values are supported:
l AREAS - copy attributes to areas
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 values are supported:
- 237 -
Global Mapper Scripting Reference Section 11:Attribute Management
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
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.
- 238 -
Global Mapper Scripting Reference Section 11:Attribute Management
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="FILENAME_2". You can also
pass in the value 'USER CREATED FEATURES' when running 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 results 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 attribute 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 criteria
for your search. See special Attribute Name parameter details for special attrib-
ute names to compare against.
l CASE_SENSITIVE - specifies whether or not text comparisons are case sensit-
ive 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 vector layer. The following parameters are supported by the command:
- 239 -
Global Mapper Scripting Reference Section 11:Attribute Management
except that the list 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 duplic-
ate 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
- 240 -
Global Mapper Scripting Reference Section 11:Attribute Management
- 241 -
Global Mapper Scripting Reference Section 12:Raster Analysis
Rast er Analysis
APPLY_FORMULA 242
PAN_SHARPEN 243
GENERATE_EQUAL_VAL_AREAS 246
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.
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-
E="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 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 documentation 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 get 32-bit floating point values if the output is a single band grid
and 8-bit per band for imagery output.
- 242 -
Global Mapper Scripting Reference Section 12:Raster Analysis
SAMPLE
GLOBAL_MAPPER_SCRIPT VERSION=1.00
APPLY_FORMULA FILENAME="*" OUTPUT_BIT_DEPTH="8" FORMULA="IF
(B1<90, B1*0.765+20, B1)"
PAN_SHARPEN
The PAN_SHARPEN command fuses a lower resolution color/multi-band image
with a higher resolution 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.
- 243 -
Global Mapper Scripting Reference Section 12:Raster Analysis
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
- 244 -
Global Mapper Scripting Reference Section 12:Raster Analysis
- 245 -
Global Mapper Scripting Reference Section 12:Raster Analysis
command are not the same as the data bounds, the command uses the inter-
section between the two. When USE_EXACT_BOUNDS=YES is specified,
the command will use the bounds as specified, instead of the intersection.
SAMPLE
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-
E="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 attribute will be saved with each area.
- 246 -
Global Mapper Scripting Reference Section 12:Raster Analysis
l ATTR_FORMAT - specifies a custom format string for creating the color attrib-
ute. 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. 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 O PERATION
See also Specify Bounds for Operation
- 247 -
Global Mapper Scripting Reference Section 12:Raster Analysis
- 248 -
Global Mapper Scripting Reference Section 12:Raster Analysis
command are not the same as the data bounds, the command uses the inter-
section between the two. When USE_EXACT_BOUNDS=YES is specified,
the command will use the bounds as specified, instead of the intersection.
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"
- 249 -
Global Mapper Scripting Reference Section 13:Export
Export
EXPORT_ANY 250
EXPORT_CLOUD 250
EXPORT_ELEVATION 251
EXPORT_METADATA 268
EXPORT_PACKAGE 269
EXPORT_PDF 276
EXPORT_PDF3D 281
EXPORT_RASTER 282
EXPORT_VECTOR 299
EXPORT_WEB 320
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
l LAST_LOADED - export to the same type as the last 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.
- 250 -
Global Mapper Scripting Reference Section 13:Export
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_ELEVATION
The EXPORT_ELEVATION command exports all currently loaded elevation data
to a file. The following parameters are supported by the command.
- 251 -
Global Mapper Scripting Reference Section 13:Export
- 252 -
Global Mapper Scripting Reference Section 13:Export
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 projec-
tion 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-
S="1.0,1.5".
l FORCE_SQUARE_PIXELS - if this value is set to YES, the spatial resolution of
the resultant elevation 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 (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
resolution 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 automatically
l LAYER - Use the sampling method set for each layer
l The list of SAMPLING_METHOD values for the IMPORT command can also
be specified to use a particular sampling method for all layers being expor-
ted.
l SHARED IMPORT SAMPLING_METHOD VALUES
THE FOLLOWING VALUES ARE SUPPORTED
l NEAREST_NEIGHBOR - use the nearest neighbor sampling
method
l BILINEAR - use bilinear interpolation
l BICUBIC - use bicubic interpolation
l BOX_2X2 - use a 2x2 box average
l BOX_3X3 - use a 3x3 box average
l BOX_4X4 - use a 4x4 box average
l BOX_5X5 - use a 5x5 box average
l BOX_6X6 - use a 6x6 box average
l BOX_7X7 - use a 7x7 box average
l BOX_8X8 - use a 8x8 box average
l BOX_9X9 - use a 9x9 box average
l MAX_2X2 - (terrain layers only) use maximum value found in 2x2
box
l MAX_3X3 - (terrain layers only) use maximum value found in 3x3
box
- 253 -
Global Mapper Scripting Reference Section 13:Export
l GEN_WORLD_FILE - specifies that a world file (TFW for TIF, JGW for JPG,
etc.) should be generated in addition to the grid file. Use GEN_WORLD_
FILE=YES to turn on.
l GEN_TAB_FILE - specifies that a MapInfo TAB file should be generated in
addition to the grid file. Use GEN_TAB_FILE=YES to turn on.
- 254 -
Global Mapper Scripting Reference Section 13:Export
- 255 -
Global Mapper Scripting Reference Section 13:Export
- 256 -
Global Mapper Scripting Reference Section 13:Export
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.
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 VOID_ELEV - pixel value to use for noData pixels.
G EOTIFF FIELDS
l BYTES_PER_SAMPLE - specifies how many bytes to use per elevation
sample in the vertical GeoTIFF file. Valid values are 2 bytes (16-bits) and 4
bytes (32-bits). If this value isn't specified, 2 bytes are used.
- 257 -
Global Mapper Scripting Reference Section 13:Export
- 258 -
Global Mapper Scripting Reference Section 13:Export
FLOAT_GRID FIELDS
l EXPORT_SLOPE - use to specify that slope values should be exported
rather than elevation 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 percent 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' (confidential), '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.
- 259 -
Global Mapper Scripting Reference Section 13:Export
- 260 -
Global Mapper Scripting Reference Section 13:Export
- 261 -
Global Mapper Scripting Reference Section 13:Export
- 262 -
Global Mapper Scripting Reference Section 13:Export
- 263 -
Global Mapper Scripting Reference Section 13:Export
- 264 -
Global Mapper Scripting Reference Section 13:Export
- 265 -
Global Mapper Scripting Reference Section 13:Export
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.
l TILING / G RIDDING PARAMETERS
See also Tiling/Gridding Export into Smaller Chunks
- 266 -
Global Mapper Scripting Reference Section 13:Export
- 267 -
Global Mapper Scripting Reference Section 13:Export
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".
SAMPLES
GLOBAL_MAPPER_SCRIPT VERSION=1.00
// Do export with elev/roughness layers separately
specified
EXPORT_ELEVATION TYPE="GWS" FILENAME="output.gws" \
ELEV_LAYER="*blue_springs*.dem*" ROUGHNESS_LAYER="Roughness
*"
// Do export with automatic layer selection
EXPORT_ELEVATION TYPE="GWS" FILENAME="output_auto.gws"
EXPORT_METADATA
The EXPORT_METADATA command exports the metadata for a specified load
layer. The following 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.
- 268 -
Global Mapper Scripting Reference Section 13:Export
EXPORT_PACKAGE
The EXPORT_PACKAGE command exports all currently loaded raster, vector,
and elevation data to a Global Mapper Package (GMP) file. The following paramet-
ers are supported by the command.
- 269 -
Global Mapper Scripting Reference Section 13:Export
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 LINES - export line features
l POINTS - export point 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 projec-
tion. 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 a Lidar
Module 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 SPECIFY BOUNDING BOX FOR O PERATION
See also Specify Bounds for Operation
- 270 -
Global Mapper Scripting Reference Section 13:Export
- 271 -
Global Mapper Scripting Reference Section 13:Export
exceptions).
l POLYGON_CROP_FILE_PROJ - specifies the projection to use for the
POLYGON_CROP_FILE. Use if the file doesn't have an associated projec-
tion file. See special Projection Specification for instructions.
l POLYGON_CROP_NAME - specifies the name of a polygon shape previ-
ously defined using the DEFINE_SHAPE command to which the export
should be cropped. The coordinates in the shape need to have been
provided in whatever projection the new terrain layer will be in (i.e. the
current projection). If you want to crop to any area features that are selected
with the Digitizer Tool in the user interface rather than a defined polygon,
use POLYGON_CROP_NAME="SELECTED".
l POLYGON_CROP_USE_ALL - specifies that if a POLYGON_CROP_FILE
is specified that contains multiple polygons, the operation will be cropped to
all polygons in that file rather than just the best-fit polygon.
l POLYGON_CROP_USE_EACH - specifies that if a POLYGON_CROP_
FILE is specified that contains multiple polygons, the operation will generate
a separate export for each polygons in that file rather than just the best-fit
polygon. See the POLYGON_CROP_BBOX_ONLY and POLYGON_
CROP_NAME_ATTR options for naming and other options when using this
parameter. Use POLYGON_CROP_USE_EACH=YES to enable. This
parameter also works with FEATHER_BLEND_EDGES. Use POLYGON_
CROP_USE_EACH=YES with FEATHER_BLEND_POLY_FILE or
FEATHER_BLEND_POLY to feather the edges of multiple polygons.
l POLYGON_CROP_EXCLUDE - specifies that the crop areas are actually
regions to exclude from the export rather than include. If you add
POLYGON_CROP_EXCLUDE=YES to the 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 parameter is specified that each export should just be
cropped to the bounding box of each polygon rather than the actual bound-
ary 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/-
- 272 -
Global Mapper Scripting Reference Section 13:Export
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 bound-
ing 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 gener-
ated when cropping to multiple polygons using the POLYGON_CROP_
USE_EACH parameter. See special Attribute 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
sequentially numbered.
l POLYGON_CROP_FOLDER_ATTR - used to control the filenames gener-
ated when cropping 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.
l TILING/G RIDDING EXPORT INTO SMALLER CHUNKS
See also Gridding/Tiling Operations into Smaller Chunks
- 273 -
Global Mapper Scripting Reference Section 13:Export
if you want to tile the export into cells that are 800 pixels wide by 600 pixels
tall, you would use GRID_TYPE_PIXEL_SIZE="800,600".
l GRID_TYPE_PIXEL_SIZE_MAX - specifies that the export should be
gridded into multiple tiles with each tile having the given maximum size in
pixels/samples. This works by calculating the number of rows and columns
needed to hold cells of the given pixel dimensions, then shrinking those
pixel dimensions down so that the tiles exactly cover the exported bounds.
The value should be specified as cell pixel width,cell pixel height. For
example, if you want to tile the export into cells that are at most 800 pixels
wide by 600 pixels tall, you would use GRID_TYPE_PIXEL_SIZE_
MAX="800,600".
l GRID_TYPE_ROWS_COLS - specifies that the export should be gridded
into multiple tiles with a given number of rows and columns of tiles. The
value should be specified as number of rows,number of columns. For
example, if you want to tile the export into a grid of 8 rows each 4 tiles
across, you would use GRID_TYPE_ROWS_COLS="8,4".
l GRID_OVERLAP - specifies how much to overlap tiles when gridding an
export into multiple tiles. This is a percentage value from 0 to 100 and only
applies when on of the GRID_TYPE_* parameters is used. For example, to
make your grid tiles overlap by 5% of the grid tile size, use GRID_OVERLAP-
P="5.0". The default value is 0.0, meaning that the tiles do not overlap.
l GRID_OVERLAP_NUM_PIXELS - indicates whether or not the value
specified in GRID_OVERLAP should be interpreted as a number of pixels
instead of a percentage. Use GRID_OVERLAP_NUM_PIXELS=YES to
specify that the value specified in the GRID_OVERLAP parameter should
be interpreted as a number of pixels. Use GRID_OVERLAP_NUM_
PIXELS=NO or omit this parameter to specify that the value is a percentage.
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
- 274 -
Global Mapper Scripting Reference Section 13:Export
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".
- 275 -
Global Mapper Scripting Reference Section 13:Export
EXPORT_PDF
The EXPORT_PDF command exports all currently loaded data to a PDF file. The
following parameters are supported by the command.
l LANDSCAPE
- 276 -
Global Mapper Scripting Reference Section 13:Export
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.
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 O PERATION
See also Specify Bounds for Operation
- 277 -
Global Mapper Scripting Reference Section 13:Export
- 278 -
Global Mapper Scripting Reference Section 13:Export
The value should be specified as cell width,cell height. For example, if you
are exporting in a metric projection and want to tile the export into cells that
are 10,000 meters wide by 5,000 meters tall, you would use GRID_TYPE_
CELL_SIZE="10000.0,5000.0".
l GRID_TYPE_PIXEL_SIZE - specifies that the export should be gridded into
multiple tiles with each tile having the given size in pixels/samples. The
value should be specified as cell pixel width,cell pixel height. For example,
if you want to tile the export into cells that are 800 pixels wide by 600 pixels
tall, you would use GRID_TYPE_PIXEL_SIZE="800,600".
l GRID_TYPE_PIXEL_SIZE_MAX - specifies that the export should be
gridded into multiple tiles with each tile having the given maximum size in
pixels/samples. This works by calculating the number of rows and columns
needed to hold cells of the given pixel dimensions, then shrinking those
pixel dimensions down so that the tiles exactly cover the exported bounds.
The value should be specified as cell pixel width,cell pixel height. For
example, if you want to tile the export into cells that are at most 800 pixels
wide by 600 pixels tall, you would use GRID_TYPE_PIXEL_SIZE_
MAX="800,600".
l GRID_TYPE_ROWS_COLS - specifies that the export should be gridded
into multiple tiles with a given number of rows and columns of tiles. The
value should be specified as number of rows,number of columns. For
example, if you want to tile the export into a grid of 8 rows each 4 tiles
across, you would use GRID_TYPE_ROWS_COLS="8,4".
l GRID_OVERLAP - specifies how much to overlap tiles when gridding an
export into multiple tiles. This is a percentage value from 0 to 100 and only
applies when on of the GRID_TYPE_* parameters is used. For example, to
make your grid tiles overlap by 5% of the grid tile size, use GRID_OVERLAP-
P="5.0". The default value is 0.0, meaning that the tiles do not overlap.
l GRID_OVERLAP_NUM_PIXELS - indicates whether or not the value
specified in GRID_OVERLAP should be interpreted as a number of pixels
instead of a percentage. Use GRID_OVERLAP_NUM_PIXELS=YES to
specify that the value specified in the GRID_OVERLAP parameter should
be interpreted as a number of pixels. Use GRID_OVERLAP_NUM_
PIXELS=NO or omit this parameter to specify that the value is a percentage.
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.
- 279 -
Global Mapper Scripting Reference Section 13:Export
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".
- 280 -
Global Mapper Scripting Reference Section 13:Export
l LANDSCAPE
- 281 -
Global Mapper Scripting Reference Section 13:Export
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
- 282 -
Global Mapper Scripting Reference Section 13:Export
- 283 -
Global Mapper Scripting Reference Section 13:Export
- 284 -
Global Mapper Scripting Reference Section 13:Export
l PALETTE
Specifies the palette/image type to use. If not specified, a 24-bit RGB image
- 285 -
Global Mapper Scripting Reference Section 13:Export
will be generated.
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 gener-
ated 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 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 optimized 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 recognize JPG-in-TIFF format files.
l MULTIBAND (BIL, BIP. BSQ, GEOTIFF, JPEG2000, 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.
- 286 -
Global Mapper Scripting Reference Section 13:Export
l BAND_BIT_DEPTH - specifies how many bits to use for each band of data for a
PALETTE=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 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 all loaded data will be
considered as input, with just the input-to-output band assignment being
updated.
l INC_VECTOR_DATA - specifies whether or not loaded vector data should be
rendered and exported to the generated image. Use a value of YES to indicate
that vector data should be used. Any other value will result in vector data NOT
being saved to the file.
l FILL_GAPS - specifies that small gaps in between and within the data sets
being exported will be filled in by interpolating the surrounding data to come up
with a color for the point in question. This option is off by default, specify FILL_
GAPS=YES to turn it on.
l ONLY_GENERATE_METADATA (GEOTIFF, JPEG, and PNG only) - specifies
that only metadata files like world files, TAB files, and PRJ files should be
created for this file. This is useful for things like generating world and TAB files
from GeoTIFF files without doing a whole new export. Just make the output
filename the same as the loaded file to create the metadata for.
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 raster file. Specify SAVE_SCALE_AND_
LEGEND=YES to enable this option.
l BG_TRANSPARENT (ECW, GEOTIFF, JPEG2000 and PNG only) - specifies
that any areas of no data/background should be marked as transparent. Use
BG_TRANSPARENT=YES to enable.
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 EXPORT_SCALE - specifies the scale to do the export at. You must also specify
a DPI value in order to use the EXPORT_SCALE parameter. For example to
export at 1:50,000 scale, use EXPORT_SCALE=50000.
- 287 -
Global Mapper Scripting Reference Section 13:Export
l JPEG - Use JPEG-in-TIFF (lossy) compression. Only works for 24-bit RGB
palette-based output.
l DEFLATE - Use Deflate/ZIP (lossless) compression on the output.
- 288 -
Global Mapper Scripting Reference Section 13:Export
quality value has been selected on the GeoTIFF export dialog in the user inter-
face the last used value there will be the default.
l TILE_SIZE - specifies that the GeoTIFF file should be exported with a tiled
organization and use the specified tile size. This tile size should be between 8
and 2048. Typical values are 64, 128, and 256.
l DISABLE_BIGTIFF - use to disable the automatic creation of BigTIFF-format
files for very large exports. Use DISABLE_BIGTIFF=YES to disable the
automatic BigTIFF support.
l TIFF_COPYRIGHT - specify text to store in TIFFTAG_COPYRIGHT tag.
l TIFF_DATETIME - specify text to store in TIFFTAG_DATETIME tag.
l TIFF_DOC_NAME - specify text to store in TIFFTAG_DOCUMENTNAME tag.
l TIFF_GT_CITATION - specify text to store in GeoTIFF GTCitationGeoKey
GeoTIFF tag.
l TIFF_IMAGE_DESC - specify text to store in TIFFTAG_IMAGEDESCRIPTION
tag.
l TIFF_PCS_CITATION - specify text to store in GeoTIFF PCSCitationGeoKey
GeoTIFF tag.
l TIFF_NO_GTIFF_HEADER - don't embed a GeoTIFF header in the file. Use
TIFF_NO_GTIFF_HEADER=YES to disable write of header.
G EOTIFF 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
palette-based output.
l DEFLATE - Use Deflate/ZIP (lossless) compression on the output.
- 289 -
Global Mapper Scripting Reference Section 13:Export
quality value has been selected on the GeoTIFF export dialog in the user inter-
face the last used value there will be the default.
l TILE_SIZE - specifies that the GeoTIFF file should be exported with a tiled
organization and use the specified tile size. This tile size should be between 8
and 2048. Typical values are 64, 128, and 256.
l DISABLE_BIGTIFF - use to disable the automatic creation of BigTIFF-format
files for very large exports. Use DISABLE_BIGTIFF=YES to disable the
automatic BigTIFF support.
l TIFF_COPYRIGHT - specify text to store in TIFFTAG_COPYRIGHT tag.
l TIFF_DATETIME - specify text to store in TIFFTAG_DATETIME tag.
l TIFF_DOC_NAME - specify text to store in TIFFTAG_DOCUMENTNAME tag.
l TIFF_GT_CITATION - specify text to store in GeoTIFF GTCitationGeoKey
GeoTIFF tag.
l TIFF_IMAGE_DESC - specify text to store in TIFFTAG_IMAGEDESCRIPTION
tag.
l TIFF_PCS_CITATION - specify text to store in GeoTIFF PCSCitationGeoKey
GeoTIFF tag.
l TIFF_NO_GTIFF_HEADER - don't embed a GeoTIFF header in the file. Use
TIFF_NO_GTIFF_HEADER=YES to disable write of header.
KML/KMZ FIELDS
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.
- 290 -
Global Mapper Scripting Reference Section 13:Export
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="04/21/2014" for April 21, 2014.
l CREATE_BSB_FILE - Flag to control whether or not a BSB file is created along-
side KAP. Use CREATE_BSB_FILE=NO to disable.
l INC_POLYNOMIAL - Flag to control whether or not the polynomial coordinate
transformation is included in the KAP file. Use INC_POLYNOMIAL=NO to
disable
RPF (CADRG/CIB) FIELDS
l FILENAME - Full path and name of a.toc file at root of data set export.
l MAP_NAME - The map name, usually a 6-character name
- 291 -
Global Mapper Scripting Reference Section 13:Export
l SERIES - The chart series 2-letter code from [Section 5.1.4, MIL-STD-2411-1].
The following list includes some commonly supported values (note that any 2-
letter code is supported):
l GN - 1:5M Scale GNC (Global Navigation Chart)
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 abbre-
viation (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, Section 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 unclas-
sified.
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 compressing 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 compressed result.
ADRG/ASRP FIELDS
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 supported for v1.1.
- 292 -
Global Mapper Scripting Reference Section 13:Export
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.
- 293 -
Global Mapper Scripting Reference Section 13:Export
- 294 -
Global Mapper Scripting Reference Section 13:Export
- 295 -
Global Mapper Scripting Reference Section 13:Export
- 296 -
Global Mapper Scripting Reference Section 13:Export
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.
l TILING / G RIDDING
See also Gridding/Tiling Operations into Smaller Chunks
- 297 -
Global Mapper Scripting Reference Section 13:Export
- 298 -
Global Mapper Scripting Reference Section 13:Export
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".
- 299 -
Global Mapper Scripting Reference Section 13:Export
- 300 -
Global Mapper Scripting Reference Section 13:Export
- 301 -
Global Mapper Scripting Reference Section 13:Export
- 302 -
Global Mapper Scripting Reference Section 13:Export
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 naming 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-
G=SEPARATE_COLS_FIRST parameter. The value of this field is a
comma-delimited list with the following field values:
l Naming type. Can have the following values:
l NUM - name using numbers in ascending order
l NUM_REVERSE - name using numbers in descending
order
l ALPHA - name using letters in ascending order
l ALPHA_REVERSE - name using letters in descending
order
l Starting value for numbering or lettering (i.e. '1', or 'A'). If the naming
type is numeric you can also specify %left% or %right% as the starting
value to use the left or right coordinate of the cell bounding box. For row
naming you can use %top% or %bottom%.
l Prefix string to use before the numeric or alphabetic value.
l Step value for numeric naming (default is '1')
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".
- 303 -
Global Mapper Scripting Reference Section 13:Export
- 304 -
Global Mapper Scripting Reference Section 13:Export
- 305 -
Global Mapper Scripting Reference Section 13:Export
- 306 -
Global Mapper Scripting Reference Section 13:Export
- 307 -
Global Mapper Scripting Reference Section 13:Export
value. If you need to match on a value that may contain a comma, use
FILENAME_ATTR instead.
l FILENAME_INCLUDE_ATTR_NAME - specifies that the attribute name
specified in the FILENAME_ATTR_LIST parameter should be included as part
of the filename when using SPLIT_BY_ATTR=YES to split your export into a
separate file for each set of attributes.
l MAKE_FNAME_LOWER - specifies that the generated filename should consist
only of lower-case letters. Typically used along with SPLIT_BY_ATTR=YES
when getting attribute values that are upper case and you want the filename to
be lower case.
SHAPEFILE PARAMETERS
l SPLIT_BY_LAYER (SHAPEFILE only) - specifies that the export should gener-
ate 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 features. 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 feature should be added as attributes to the DBF files exported with the
Shapefile This is disabled 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 elevation stored for each vertex/point will be the first
- 308 -
Global Mapper Scripting Reference Section 13:Export
A value of 0.0 will be used if no elevation could not be obtained via any of
the prior methods.
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
- 309 -
Global Mapper Scripting Reference Section 13:Export
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 distance/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 distances 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 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 (SIMPLE_ASCII 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
l EXPORT_ELEV - specifies whether or not a elevation value should be gener-
ated 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_ATTRS- specifies whether or not feature attributes should be written
to the text file just before the coordinates. 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 attributes and name of
the feature in the attribute list.
l A file name that identifies the layer containing default column names. If the
layer is 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"
- 310 -
Global Mapper Scripting Reference Section 13:Export
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 feature 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
- 311 -
Global Mapper Scripting Reference Section 13:Export
l POSTGIS - PostGIS/PostgreSQL
- 312 -
Global Mapper Scripting Reference Section 13:Export
tion Manager in the Global Manager user interface. All of the connections
defined in the Connection Manager are available for use in a script.
l SDB_TABLE_NAME - Each EXPORT_VECTOR command will output a single
database table. Use this parameter to specify the name of the database table
where the output will be stored. If the export uses gridding or splits the output by
attribute, then multiple tables will be exported. The name specified here will be
the base name, and will be modified for each output table based on the gridding
and split-by-attribute parameters. This is similar to how the gridding process
works when exporting a SHAPEFILE.
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.
l MP_COPY_ENTIRE_TEMPLATE (POLISH_MP only) - specifies that the entire
contents of a specified template file should be copied to the new file rather than
just the header portion of the template file.
l MP_IMAGE_ID (POLISH_MP only) - specifies the image ID value that should
be stored in the resultant .mp file. If you don't specify this value or you specify a
value of 0 a new value that has not been used before will automatically be gener-
ated.
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.
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 elevation 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
example, the elevation of a contour line or spot elevation.
l The first elevation obtained by searching the loaded elevation layers at the
position of the vertex/point.
- 313 -
Global Mapper Scripting Reference Section 13:Export
A value of 0.0 will be used if no elevation could be obtained via any of the
prior methods.
- 314 -
Global Mapper Scripting Reference Section 13:Export
pieces to avoid rendering issues in Google Earth on some machines. Use KML_
CHOP_FILLED_AREAS=FALSE to disable the chopping, which is automat-
ically done for filled areas with no borders.
l KML_FOLDER_ATTR (KML only) - specifies the name of a feature attribute to
use for the folder name in the generated KML file. By default, the export will
check for a KML_FOLDER attribute with the name of a folder to use.
l KML_HTML_DESC_TEXT (KML only) - specifies a HTML text string describing
what to use for the description for each feature exported to a KML file. To add a
quote mark inside your description text, use two single quotes ('') rather than a
double quote ("), as the latter would terminate the parameter value.
l KML_LINE_DISPLAY_ABOVE_TERRAIN (KML only) - specifies that LINE
features with associated elevation value should be displayed at height above
the terrain surface in Google Earth. Use KML_LINE_DISPLAY_ABOVE_
TERRAIN=YES to enable.
l KML_LINE_ELEVS_RELATIVE (KML only) - specifies that the elevation values
associated with 3D line features are relative to the terrain surface rather than
relative to sea level. Use KML_LINE_ELEVS_RELATIVE=YES to enable.
l KML_POINT_DISPLAY_ABOVE_TERRAIN (KML only) - specifies that point
features with associated elevation value should be displayed at height above
the terrain surface in Google Earth. Use KML_POINT_DISPLAY_ABOVE_
TERRAIN=YES to enable.
l KML_POINT_ELEVS_RELATIVE (KML only) - specifies that the elevation
values associated with 3D Point features are relative to the terrain surface rather
than relative to sea level. Use KML_POINT_ELEVS_RELATIVE=YES to
enable.
l KML_POINT_EXTRUDE (KML only) - specifies that 3D point features displayed
in Google Earth should be extruded from the surface by drawing a thin line from
the surface to the point. Use KML_POINT_EXTRUDE=YES to enable.
l INC_LAYER_ATTR - specifies whether or not displays labels should be expor-
ted for line and area features. Use INC_LAYER_ATTR=YES to enable or INC_
LAYER_ATTR=NO to disable. This is disabled by default.
l CODE_PAGE - specifies the code page to use for the KML export. The default
is UTF-8. Use the code page number, the ISO-8859-? string, or the text UTF-8
(number 65001).
LIDAR LAS/LAZ FIELDS
l ELEV_UNITS - specify elevation units to use in export
l FEET - export in US feet
l METERS - export in meters
- 315 -
Global Mapper Scripting Reference Section 13:Export
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 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 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 specified 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 expor-
ted 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 projec-
tion 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-
T="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".
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-
T="0.01,0.01,0.001" to specify precision of 100ths of units in X and Y and
- 316 -
Global Mapper Scripting Reference Section 13:Export
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 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.
LIDAR POINT FILTER O PTIONS
See also Lidar Point Filter Options
l 1 - First Return
l 2 - Second Return
l 3 - Last Return
- 317 -
Global Mapper Scripting Reference Section 13:Export
l 4 - Single Return
l 5 - First of Many Returns
l 6 - Second of Many Returns
l 7 - Third of Many Returns
l 8 - Last of Many Returns
l LIDAR_COLOR_FILTER - specifies a color to include in the grid. If no value is
provided then all colors are gridded. Otherwise, you can provide multiple
LIDAR_COLOR_FILTER parameters of the format LIDAR_COLOR_
FILTER="RGB(red,green,blue)" to specify colors to keep. The LIDAR_COLOR_
DIST parameter specifies how far from an exact match to a specified color that a
point color can be to be kept.
l LIDAR_DENSITY_RANGE - specifies the range of point densities in points per
square meter to include. Any Lidar points in regions with densities outside the
range are ignored. If you use two values then everything between the values is
used. If only one value is specified then all points in areas >= to the specified
value are used. For example, LIDAR_DENSITY_RANGE="1.0" means that all
points in areas with densities of 1.0 points per square meter or higher are used.
l LIDAR_SOURCE_ID_LIST - specifies a comma-separated list of point source
IDs to keep. If no list is provided all points are kept. For example, to keep just
points with a source ID of 5 or 6, use LIDAR_SOURCE_ID_LIST="5,6".
l LIDAR_INTENSITY_RANGE - filter to only the specified intensity values. The
value is a pair of integers representing the range of intensity values to be
included. Example: LIDAR_INTENSITY_RANGE=100,15. If only the first value
is provided, it will be considered the minimum intensity value, so all values
greater than that value will be included.
GPX FIELDS
l EXPORT_AREAS - specifies that area features should be exported to GPX
files as track lines. Use EXPORT_AREAS=YES to enable.
l EXPORT_ATTRS - specifies whether or not all feature attributes for waypoints
will be included as tags. Use EXPORT_ATTRS=YES to enable export.
l EXPORT_DESC - specifies that <desc> tags will be exported for waypoints.
Use EXPORT_DESC=NO to disable.
l EXPORT_ELEV - specifies whether or not a <ele> (elevation) value should be
generated for each waypoints/trackpoing. Use EXPORT_ELEV=NO to disable.
l EXPORT_SYM - specifies that <sym> (symbol) tags will be exported for waypo-
ints. Use EXPORT_SYM=NO to disable.
l EXPORT_TIME - specifies that <time> tags will be exported for waypoints and
track points when available. Use EXPORT_TIME=NO to disable.
O THER FORMATS FIELDS
l QUAD_NAME (DLGO only) - specifies the quadrangle name to store in the
- 318 -
Global Mapper Scripting Reference Section 13:Export
header of the DLG-O file. If not quadrangle name is specified, Global Mapper
will attempt to automatically determine one based on the loaded data.
l PRECISION (SVG only) - 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 CDF_MAJOR_CODE (CDF only) - specifies the default major attribute code to
use for features when exporting to a CDF format file (default is 32).
l CDF_MINOR_CODE (CDF only) - specifies the default minor attribute code to
use for features when exporting to a CDF format file (default is 45).
l CDF_USE_DEFAULT_CODE (CDF only) - specifies that the default attribute
code pair should be used for all features written to the CDF file and not just
those for which no attribute code pair could be automatically determined based
on the feature classification.
l INC_ELEV_ATTR (MAPINFO only) - specifies whether or not the elevation of a
feature should be added as an attribute to the exported files. Use INC_ELEV_
ATTR=YES to enable or INC_ELEV_ATTR=NO to disable. This is enabled by
default.
l INC_LAYER_ATTR (MAPINFO only) - specifies whether or not the layer
(description) of a feature should be added as an attribute to the exported file.
Use INC_LAYER_ATTR=YES to enable or INC_LAYER_ATTR=NO to
disable. This is enabled by default.
l VERSION (LOWRANCE_USR only) - specifies which version of USR file to
create. Must be 3 or 4. By default VERSION=3 is used.
l SAVE_XY_AS_TENTHS (SEGP1 only) - specifies that the X and Y values
should be multiplied by 10 when saved to the SEGP1 file
l SAVE_Z_AS_TENTHS (SEGP1 only) - specifies that the Z values should be
multiplied by 10 when saved to the SEGP1 file
l ATTR_TO_DELETE (OSM only) - provides an attribute to ignore/delete when
exporting to OSM XML files. You can provide multiple of these parameters to
ignore multiple attributes, like ATTR_TO_DELETE="MP_TYPE" ATTR_TO_
DELETE="RouteParam".
l Y_UP (STL, COLLADA, PLY, and OBJ only) - specifies that the STL file that is
created will use a "Y-Up" orientation; that is, Y values in exported coordinates
will represent latitudes and Z values will represent elevations.
l NO_PROMPTING (STL, COLLADA, PLY, and OBJ only) - specifies that the
3D export dialog is suppressed.
l CREATE_BINARY (STL only) - specifies that the STL file that is created will be
a binary STL file rather than a (much larger) ASCII text STL file.
- 319 -
Global Mapper Scripting Reference Section 13:Export
EXPORT_WEB
The EXPORT_WEB command exports all currently loaded data to a tiled web
format. The following 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 VIRTUAL_EARTH - Bing/Virtual Earth Tiles
l KML_RASTER - KML file with all data in a raster
l WORLDWIND - World Wind Tiles
l TMS - Tile Mapping Service tiles
l OSM - Open Street Maps Tiles
l MBTILES - MapBox MBTiles SQLite Database
l RMAPS - RMaps SQLite Database
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:
- 320 -
Global Mapper Scripting Reference Section 13:Export
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
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 SATELLITE - Satellite imagery
l HYBRID - Combination of ROADMAP and SATELLITE
l TERRAIN - Terrain 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
specified, 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\\pre-
fix_%y_%x.png" to create one folder per zoom level. The tiles will be created in
the path under the HTML filename path.
l TILE_SIZE - use this to override the default tile size for the selected TYPE. This
value specifies 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).
- 321 -
Global Mapper Scripting Reference Section 13:Export
The following parameters accept boolean values ("YES" or "NO") to turn on or off
the associated option (the default is no, but by listing the parameter it will be set to
yes).
- 322 -
Global Mapper Scripting Reference Section 13:Export
- 323 -
Global Mapper Scripting Reference Section 13:Export
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 resol-
ution 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 General tab of the Configuration dialog will be used.
l USE_EXACT_BOUNDS - specifies that the exact bounds that were defined
in the command should be used. Generally, when the bounds specified in a
command are not the same as the data bounds, the command uses the inter-
section between the two. When USE_EXACT_BOUNDS=YES is specified,
the command will use the bounds as specified, instead of the intersection.
l CROPPING TO POLYGONS /AREAS
See also Cropping Operations to Polygons/Areas
- 324 -
Global Mapper Scripting Reference Section 13:Export
a separate export for each polygons in that file rather than just the best-fit
polygon. See the POLYGON_CROP_BBOX_ONLY and POLYGON_
CROP_NAME_ATTR options for naming and other options when using this
parameter. Use POLYGON_CROP_USE_EACH=YES to enable. This
parameter also works with FEATHER_BLEND_EDGES. Use POLYGON_
CROP_USE_EACH=YES with FEATHER_BLEND_POLY_FILE or
FEATHER_BLEND_POLY to feather the edges of multiple polygons.
l POLYGON_CROP_EXCLUDE - specifies that the crop areas are actually
regions to exclude from the export rather than include. If you add
POLYGON_CROP_EXCLUDE=YES to the 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 parameter is specified that each export should just be
cropped to the bounding box of each polygon rather than the actual bound-
ary 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 bound-
ing 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 gener-
ated when cropping to multiple polygons using the POLYGON_CROP_
USE_EACH parameter. See special Attribute 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
sequentially numbered.
- 325 -
Global Mapper Scripting Reference Section 13:Export
- 326 -
Global Mapper Scripting Reference Section 14:Shared Parameters
- 327 -
Global Mapper Scripting Reference Section 14:Shared Parameters
- 328 -
Global Mapper Scripting Reference Section 14:Shared Parameters
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.
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"
- 329 -
Global Mapper Scripting Reference Section 14:Shared Parameters
- 330 -
Global Mapper Scripting Reference Section 14:Shared Parameters
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".
- 331 -
Global Mapper Scripting Reference Section 14:Shared Parameters
- 332 -
Global Mapper Scripting Reference Section 14:Shared Parameters
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 General tab of the Config-
uration dialog will be used.
l USE_EXACT_BOUNDS - specifies that the exact bounds that were defined in
the command should be used. Generally, when the bounds specified in a
command are not the same as the data bounds, the command uses the inter-
section between the two. When USE_EXACT_BOUNDS=YES is specified, the
command will use the bounds as specified, instead of the intersection.
- 333 -
Global Mapper Scripting Reference Section 15:Batch Mode Operation
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:
or
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.
"C:\Program Files\GlobalMapper17_64bit\global_mapper.exe"
"C:\Scripts\export.gms" /showprogress
- 334 -
Global Mapper Scripting Reference Section 16:Sample Scripts
Sample Script s
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
- 335 -
Global Mapper Scripting Reference Section 16:Sample Scripts
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
GLOBAL_MAPPER_SCRIPT VERSION=1.00
// Import the file to modify
IMPORT FILENAME="C:\Temp\export test\tiger_wyandotte_
sample.gmp"
// Assign the type "railroad" to all features with a CFCC
attribute with a value of A41
// and a display label with '74' in it somewhere.
- 336 -
Global Mapper Scripting Reference Section 16:Sample Scripts
GLOBAL_MAPPER_SCRIPT VERSION=1.00
// Query min and max values from metadata
QUERY_LAYER_METADATA METADATA_LAYER="SELECTED LAYERS"
METADATA_ATTR="MIN ELEVATION" RESULT_VAR="MIN_unit"
QUERY_LAYER_METADATA METADATA_LAYER="SELECTED LAYERS"
METADATA_ATTR="MAX ELEVATION" RESULT_VAR="MAX_unit"
//remove units from min and max values
DEFINE_VAR NAME="MIN" FORMULA="NUM('%MIN_unit%')"
DEFINE_VAR NAME="MAX" FORMULA="NUM('%MAX_unit%')"
//Normalize Terrain
APPLY_FORMULA LAYER_DESC="Normalized Terrain" FORMULA="
(B1-%MIN%)/(%MAX%-%MIN%)*100" OUTPUT_GRID=YES
GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL
DEFINE_VAR NAME="DATA_DIR" VALUE="%SCRIPT_FOLDER%"
SET_LOG_FILE FILENAME="%DATA_DIR%\log.txt" LOG_TO_COMMAND_
PROMPT=YES
- 337 -
Global Mapper Scripting Reference Section 16:Sample Scripts
// 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"
GLOBAL_MAPPER_SCRIPT VERSION=1.00
- 338 -
Global Mapper Scripting Reference Section 16:Sample Scripts
LIDAR_FILTER=%GRID_layer:filter%
VAR_LOOP_END
GLOBAL_MAPPER_SCRIPT VERSION="1.00"
LAYER_LOOP_START FILENAME="*" VAR_NAME_PREFIX="HIDE"
SET_LAYER_OPTIONS FILENAME="%HIDE_FNAME_W_DIR%" HIDDEN=YES
LAYER_LOOP_END
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
GLOBAL_MAPPER_SCRIPT VERSION="1.00"
DIR_LOOP_START DIRECTORY="C:\temp\Lidar" FILENAME_
MASKS=*las
IMPORT FILENAME=%FNAME_W_DIR% TYPE=LIDAR_LAS
GENERATE_ELEV_GRID FILENAME=%FNAME_W_DIR% ELEV_UNITS=METERS
GRID_ALG=BIN_AVG
SET_VERT_DISP_OPTS ENABLE_HILL_SHADING=YES SHADER_
NAME="Slope Shader"
EXPORT_RASTER FILENAME=C:\temp\Lidar\%FNAME_WO_EXT%
TYPE=KML KML_RASTER_FORMAT=JPG
UNLOAD_ALL
DIR_LOOP_END
GLOBAL_MAPPER_SCRIPT VERSION=1.00
//log file filename
- 339 -
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
- 340 -
Global Mapper Scripting Reference Section 16:Sample Scripts
DIR_LOOP_END
EDIT_VECTOR BUFFER_DIST="50.0"
EXPORT_VECTOR TYPE="KML" FILENAME="%CLIP_EXTENT%\%FNAME_W_
DIR%_50mBUFFER.kml"
- 341 -