GENERATE_CONTOURS
The GENERATE_CONTOURS command allows for the generation of contour lines (isolines of equal elevation) from any or all currently loaded elevation data. The following parameters are supported by the command.
- FILENAME - filename of the layer(s) to contour. If an empty value is passed in, all loaded terrain data will be used. This parameter can be listed more than once to specify multiple input files, like FILENAME="FILENAME_1" FILENAME="FILENAME_2".
- ELEV_UNITS - specify elevation units to use in export
- FEET - export in US feet
- METERS - export in meters
- INTERVAL - specifies the contour interval to use. This must be a whole number greater than 0. The units are specified with the ELEV_UNITS parameter described above. If you wanted to generate a contour file with an interval of 20 feet, you would use INTERVAL=20 ELEV_UNITS=FEET in the parameter list. If no interval is provided, a default one is guessed based on the elevation range of the loaded elevation data.
- GEN_FROM_TIN_AREAS - specifies that the contours should be generated from any loaded TIN (3D triangle) areas rather than from loaded terrain data. Add GEN_FROM_TIN_AREAS=YES to command to use TINs.
- MULT_MINOR - specifies how many contours apart every intermediate contour is. For example, use MULT_MINOR=5 to make every 5th contour an intermediate contour. So using INTERVAL=10 and MULT_MINOR=5 creates intermediate contours every 50 meters.
- MULT_MAJOR - specifies how many contours apart every major contour is. For example, use MULT_MAJOR=10 to make every 10th contour an intermediate contour. So using INTERVAL=10 and MULT_MINOR=10 creates major contours every 100 meters.
- MIN_ELEV - minimum elevation to consider for contours. Must be specified in conjunction with MAX_ELEV in order to restrict the range of contour generation to anything other than the full range of loaded elevation values. Units are specified by ELEV_UNITS parameter.
- MAX_ELEV - maximum elevation to consider for contours. Must be specified in conjunction with MIN_ELEV in order to restrict the range of contour generation to anything other than the full range of loaded elevation values. Units are specified by ELEV_UNITS parameter.
- SPATIAL_RES - specifies spacing of grid points used to determine contour position. A smaller grid spacing results in higher fidelity, but larger, contours. Typically you'll want to use the default value which is the minimum spatial resolution of all loaded data. Should be formatted as x_resolution,y_resolution. The units are the units of the current global projection. For example, if UTM was the current global projection and you wanted to use a grid with a 30 meter spacing, the parameter/value pair would look like SPATIAL_RES=30.0,30.0. You can also specify as a percentage of the default resolution by adding a percentage. For example to get half the detail, double the spatial resolution value, so you would use SPATIAL_RES="200%,200%".
- SPATIAL_RES_METERS - specifies spatial resolution to use in meters. The value in meters will automatically be converted to the current view/export projection units. For example, to do an export at 2.0 meter spacing (or as close as you can get to that in the current units), use SPATIAL_RES_METERS=2.0, or to do an export at 1.0 meters in X by 1.5 meters in Y, use SPATIAL_RES_METERS="1.0,1.5".
- SIMPLIFICATION - specifies the simplification threshold to use when generating the contours. This specifies how far off a straight line (in the units of the current projection) that a point has to be before it is kept. Generally you should not specify a simplification value as the default value of one tenth of the sample spacing works quite well. This is an option for advanced users only.
- SAMPLING_METHOD (elevation and raster only) - specifies the sampling method to use when resampling this layer. The following values are supported:
- DEFAULT - Use either automatic resampling based on export or layer resampling, depending on setting of global flag about whether to resample on export
- AUTO - Automatically select a resampling method based on how the export 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
- LAYER - Use the sampling method set for each layer
The list of SAMPLING_METHOD values for the IMPORT command can also be specified to use a particular sampling method for all layers being exported.
- Shared IMPORT SAMPLING_METHOD valuesThe following values are supported
- NEAREST_NEIGHBOR - use the nearest neighbor sampling method
- BILINEAR - use bilinear interpolation
- BICUBIC - use bicubic interpolation
- BOX_2X2 - use a 2x2 box average
- BOX_3X3 - use a 3x3 box average
- BOX_4X4 - use a 4x4 box average
- BOX_5X5 - use a 5x5 box average
- BOX_6X6 - use a 6x6 box average
- BOX_7X7 - use a 7x7 box average
- BOX_8X8 - use a 8x8 box average
- BOX_9X9 - use a 9x9 box average
- MAX_2X2 - use maximum value found in 2x2 box (for image layers, use brightest color)
- MAX_3X3 - use maximum value found in 3x3 box (for image layers, use brightest color)
- MAX_4X4 - use maximum value found in 4x4 box (for image layers, use brightest color)
- MAX_5X5 - use maximum value found in 5x5 box (for image layers, use brightest color)
- MAX_6X6 - use maximum value found in 6x6 box (for image layers, use brightest color)
- MAX_7X7 - use maximum value found in 7x7 box (for image layers, use brightest color)
- MAX_8X8 - use maximum value found in 8x8 box (for image layers, use brightest color)
- MAX_9X9 - use maximum value found in 9x9 box(for image layers, use brightest color)
- MED_2X2 - use median value found in 2x2 box
- MED_3X3 - use median value found in 3x3 box
- MED_4X4 - use median value found in 4x4 box
- MED_5X5 - use median value found in 5x5 box
- MED_6X6 - use median value found in 6x6 box
- MED_7X7 - use median value found in 7x7 box
- MED_8X8 - use median value found in 8x8 box
- MED_9X9 - use median value found in 9x9 box
- MIN_2X2 - use minimum value found in 2x2 box (for image layers, use darkest color)
- MIN_3X3 - use minimum value found in 3x3 box (for image layers, use darkest color)
- MIN_4X4 - use minimum value found in 4x4 box (for image layers, use darkest color)
- MIN_5X5 - use minimum value found in 5x5 box (for image layers, use darkest color)
- MIN_6X6 - use minimum value found in 6x6 box (for image layers, use darkest color)
- MIN_7X7 - use minimum value found in 7x7 box (for image layers, use darkest color)
- MIN_8X8 - use minimum value found in 8x8 box (for image layers, use darkest color)
- MIN_9X9 - use minimum value found in 9x9 box (for image layers, use darkest color)
- BLUR_3X3 - perform a Gaussian Blur using 3x3 kernel
- BLUR_5X5 - perform a Gaussian Blur using 5x5 kernel
- BLUR_7X7 - perform a Gaussian Blur using 7x7 kernel
- GEN_HEIGHT_AREAS - generate area features colored based on the current elevation shader in addition to generating contour lines. Use a value of YES to enable the generate of the height areas.
- NON_OVERLAPPING - with the GEN_HEIGHT_AREAS enabled NON_OVERLAPPING=YES will ensure the generated areas do not overlap. NON_OVERLAPPING=NO will create areas that overlap.
- GEN_SPOT_ELEVATIONS - generate spot elevations at min/max elevations. Use a value of YES to enable the generate of min/max spot elevation points.
- SINGLE_LEVEL_ONLY - specifies that the INTERVAL value is actually a value indicating the only height that a contour should be generated at. Use a value of YES to turn this functionality on.
- FILL_GAPS - specifies that small gaps in between and within the data sets being used to generate the contours will be filled in by interpolating the surrounding data to come up with an elevation for the point in question. This option is on by default, specify FILL_GAPS=NO to turn off.
- LAYER_DESC - specifies the name to assign to this layer. If no layer description is provided, the default name of "GENERATED CONTOURS" will be used.
- INC_UNIT_SUFFIX - specifies whether or not a unit suffix (either "m" or "ft") should be appended to the numeric label of generated features. By default this is enabled, so specify INC_UNIT_SUFFIX=NO to turn unit suffixes off. This is useful if the data the contours are being generated over doesn't actually represent elevation.
- SMOOTH_CONTOURS - specifies whether or not generated contour line and area features should have smoothing applied to improve appearance. This option is enabled by default. Use SMOOTH_CONTOURS=NO to disable smoothing.
- CREATE_ON_WAY_DOWN - specifies whether contours are created as the terrain passed from a higher elevation to a contour height (CREATE_ON_WAY_DOWN=YES) or the default way of being created when the terrain passes from a contour height to lower elevation values (CREATE_ON_WAY_DOWN=NO).
- MIN_CONTOUR_LEN - specifies that any closed contour lines less than the specified length (in meters) will be marked as deleted. This is useful for cleaning up contours in very rugged and detailed terrain, like from Lidar. The default is to keep all generated contour lines.
- FIND_PEAKS - specifies whether to find isolated peak points on the surface. Use FIND_PEAKS=YES to enable.
- MAX_PEAK_DIST - The maximum distance in meters between two points sharing a key contour.
- MIN_PEAK_SLOPE - specifies the minimum slope (in degrees) required between concentric contours to consider a local extrema to be a peak or depression.
- MIN_CONCENTRIC - The minimum number of concentric contours needed to define a candidate peak.
- MIN_SADDLE - The minimum amount of elevation drop between close peaks to recognize them as separate.
-
Specify Bounding Box for Operation
See also Specify Bounds for Operation
- GLOBAL_BOUNDS - specifies the combine bounds in units of the current global projection. There should be 4 values in a comma-delimited list following the parameter name. The values should be in order of minimum x, minimum y, maximum x, maximum y.
- GLOBAL_BOUNDS_SIZE - specifies the combine bounds in units of the current global projection. There should be 4 values in a comma-delimited list following the parameter name. The values should be in order of minimum x, minimum y, width in x, width in y.
- LAT_LON_BOUNDS - specifies the combine bounds in latitude/longitude degrees. There should be 4 values in a comma-delimited list following the parameter name. The values should be in order of west-most longitude, southern-most latitude, eastern-most longitude, northern-most latitude.
- LAYER_BOUNDS - specifies that the operation should use the bounds of the loaded layer(s) with the given filename. For example, to export to the bounds of the file "c:\test.tif", you would use LAYER_BOUNDS="c:\test.tif". Keep in mind that the file must be currently loaded.
- 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.
- SNAP_BOUNDS_TO_MULTIPLE - specifies that the top-left corner of the bounding box for the operation should be snapped to a multiple of the given value. For example, using SNAP_BOUNDS_TO_MULTIPLE=1 will snap the top-left corner to the nearest whole number. The values will always go smaller for X/easting/longitude and larger to Y/northing/latitude so you always get at least what is requested.
- SNAP_BOUNDS_TO_SPACING - specifies that the top-left corner of the bounding box for the operation should be snapped to a multiple of the resolution of the operation. For example, if you are exporting at 5 meter spacing, the top left corner will be snapped to the nearest multiple of 5. Use SNAP_BOUNDS_TO_SPACING=YES to enable or SNAP_BOUNDS_TO_SPACING=NO to disable. If not provided, the global setting for snapping exports to the nearest sample spacing boundary from the Advanced section of the General tab of the Configuration dialog will be used.
- 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 intersection between the two. When USE_EXACT_BOUNDS=YES is specified, the command will use the bounds as specified, instead of the intersection.
-
Cropping to Polygons/Areas
See also Cropping Operations to Polygons/Areas
- POLYGON_CROP_FILE - specifies the full path and filename or loaded layer description of a vector file/loaded layer containing one or more polygon features to which the operation should be cropped. If multiple polygons are found in the specified file the polygon which has the largest intersection with the data to be combined will be used as the crop polygon (see POLYGON_CROP_USE_ALL or POLYGON_CROP_USE_EACH for exceptions).
- POLYGON_CROP_FILE_PROJ - specifies the projection to use for the POLYGON_CROP_FILE. Use if the file doesn't have an associated projection file. See special Projection Specification for instructions.
- POLYGON_CROP_NAME - specifies the name of a polygon shape previously 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".
- 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.
- 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.
- 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.
- 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.
- 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 boundary of the polygon. Use POLYGON_CROP_BBOX_ONLY=YES to enable only cropping to the bounding box.
- 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.
- POLYGON_CROP_INT_DATA_BOUNDS - control how the bounding box for the export is determined if a crop polygon is specified. If this option is disabled, the export bounds will be the bounds of the crop area(s), even if they extend outside the data bounds, unless you explicitly specified a bounding box in the other parameters (i.e. LAYER_BOUNDS, GLOBAL_BOUNDS, etc.). If the option is enabled, the export bounds will be the intersection 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.
- POLYGON_CROP_NAME_ATTR - used to control the filenames generated 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.
- POLYGON_CROP_FOLDER_ATTR - used to control the filenames generated when cropping to multiple polygons using the POLYGON_CROP_USE_EACH parameter. See special Attribute Name parameter details.
- 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".
- 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.