SET_OPT
The SET_OPT command provides a place to set general options that aren't layer-specific, like the Position Display Format (see POS_DISP_FORMAT below). Use the SET_VERT_DISP_OPTS command for options related to the display of terrain data. The functionality that used to be in the LOAD_TYPE_FILTER command is now found here as well. The following parameters are supported by the command:
- POS_DISP_FORMAT - specifies the Position Display Format to use. This is the same as the setting on the General tab of the Configuration dialog. This setting is used for things like CSV export with EXPORT_VECTOR and with the ADD_COORD_ATTRS parameter to the EDIT_VECTOR command. The following values are supported:
- DECIMAL - Lat/lon Degrees formatted as DD.DDDDDD N/S/E/W
- DECIMAL_PLAIN - Lat/lon Degrees formatted the same as DECIMAL except for no hemisphere letter at the end
- DMS - Lat/lon Degrees formatted as DD MM SS.SSSS N/S/E/W
- DM - Lat/lon Degrees formatted as DD MM.MMMM N/S/E/W
- MGRS - Position formatted as MGRS/USNG
- AREA_UNITS - specifies the units to use when storing area measurements. The following values are supported:
- ACRES
- HECTARES
- SQUARE FEET
- SQUARE KILOMETERS
- SQUARE METERS
- SQUARE MILES
- DISTANCE_UNITS - specifies the units to use when storing linear distance measurements. The following values are supported:
- METRIC - meters for shorter distances, kilometers for longer
- STATUTE - feet for shorter distances, miles for longer
- YARDS - yards for shorter distances, kilometers for longer
- NAUTICAL - feet for shorter distances, nautical miles for longer
- CHAINS - chains for shorter distances, miles for longer
- MEASURE_UNIT_TYPE - specifies how to handle measurement values of different sizes
- AUTO - automatically use base units for smaller measurements and large units for long (i.e. meters for shorter distances, kilometers for longer)
- BASE - always use base units, regardless of size. For example, always use meters for distance. Use this if you want to numerically compare values
- LARGE - always use large units, regardless of size. For example, always use kilometers for distance. Use this if you want to numerically compare values
- DRAW_AREAS - specifies whether or not area features are drawn. Use DRAW_AREAS=YES to enable.
- DRAW_LINES - specifies whether or not line features are drawn. Use DRAW_LINES=YES to enable.
- DRAW_POINTS - specifies whether or not point features are drawn. Use DRAW_POINTS=YES to enable.
- DRAW_LABELS - specifies whether or not feature labels are drawn. Use DRAW_LABELS=YES to enable.
- 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.
- 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.
- 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.
- 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.
- 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 maintaing the bounds, or 0 to use the default of keeping the spacing the same and growing the bounds slightly if needed.
- 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).
- 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).
- TEMP_FOLDER - specifies the base temp folder to use. Pass an empty string to reset to the default temp folder.
- LOG_LEVEL - specifies what level of messages are logged to the log file. 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.
- LOG_FILENAME - specifies the name of the file to log errors and warnings to (based on LOG_LEVEL).
- 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).
- 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.
- 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 +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.
-
MAX_THREAD_COUNT - defines the maximum number of threads to use for any given multi-threaded process. The default value of 0 means to use all available cores except for 1 (to keep the UI responsive). If you want to reduce the number of processor cores used you can customize a value here. This will slow processes that use multiple cores, but allow other applications to work more quickly. For example, using MAX_THREAD_COUNT=1 makes every Global Mapper process use only a single thread/core.
Specifying a Type/Lidar Filter/ shared Lidar Draw Mode
- FILENAME - full path to type filter GMF file to load
- FILTER_TYPE - specifies the type of features the filter file is for. The supported values area FILTER_TYPE=AREA, FILTER_TYPE=LINE, or FILTER_TYPE=POINT.
- LIDAR_FILTER - specifies a comma-separated list of Lidar class numbers 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 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".
- LIDAR_RETURN_FILTER - specifies a comma-separated list of Lidar return types to enable or disable. Provide a minus sign (-)to remove the type from the filter rather than add it. The filter starts off with the current filter settings, but you can add ALL to enable everything or NONE to clear the filter, then add or remove stuff after that. For example, to specify a return filter with only unknown and first returns, use LIDAR_RETURN_FILTER="NONE,0,1". To get one with everything but the first return, use LIDAR_RETURN_FILTER="ALL,-1". The numeric values have the following meanings:
- 0 - Unknown Returns
- 1 - First Return
- 2 - Second Return
- 3 - Last Return
- 4 - Single Return
- 5 - First of Many Returns
- 6 - Second of Many Returns
- 7 - Third of Many Returns
- 8 - Last of Many Returns
- LIDAR_DRAW_MODE - specifies the shared Lidar draw mode to use for any loaded layers that are set to use the shared global draw mode option if Global Mapper Pro is active. The following values are supported:
- COLOR - if the points have an associated RGB color, use that. Otherwise color by elevation.
- ELEV - color by elevation of the point using the current elevation shader.
- INTENSITY - color as a grayscale image by the intensity
- LIDAR_INTEN_SHADER - Specify the terrain shader to be used to color intensity value when using the INTENSITY draw mode option. If this parameter is provided with an empty value the terrain shader selected on the main toolbar will be used.
- CLASS - color by the point classification
- RETURN - color by the return number
- HEIGHT_ABOVE_GROUND - color by the height above ground
- POINT_SOURCE_ID - color by the point source ID
- BY_LAYER - color the point cloud based on the source layer
- COLOR - Use this parameter to specify a custom color, format RGB(R,G,B), to use when using the BY_LAYER draw mode option. If not specified, automatic color assignment will be used when coloring by source layer.
- POINT_INDEX - color by the point index (i.e. order of points in file)
- RETURN_HEIGHT_DELTA - color by the difference in height between first and last point in multi-return samples
- CIR - color as Color Infrared (requires Lidar to have RGB + NIR)
- NDVI - color by calculated NDVI value (requires Lidar to have RGB + NIR)
- NDWI - color by calculated NDWI value (requires Lidar to have RGB + NIR)
- DENSITY - color by point density
- WITHHELD - color withheld points
- KEY_POINT - color model key points
- OVERLAP - color overlap points
SAMPLE
Example: Set an export option to snap to spacing, do an export, then restore the previous value
// Enable the option to snap to a spacing interval and save old value SET_OPT MISC_OPT="EXPORT_BOUNDS_SNAP_SPACING" MISC_OPT_VALUE="1" MISC_OPT_OLD_VALUE_VAR="PREV_VAL_SPACING" // Do the export EXPORT_RASTER FILENAME="out.tif" TYPE=GEOTIFF // Restore the old setting SET_OPT MISC_OPT="EXPORT_BOUNDS_SNAP_SPACING" MISC_OPT_VALUE="%PREV_VAL_SPACING%"