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:
- FILENAME - filename of the Lidar layer to update. If an empty value is passed in, all loaded Lidar layers will be updated. This parameter can be listed more than once to 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 updated.
- LIDAR_FILTER_NAME - specify name of filter previously defined with DEFINE_LIDAR_FILTER command to apply to Lidar points to get list of points to search
The following parameters allow doing a proximity search near other loaded Lidar points or line features. If no proximity search is specified, all Lidar points in the specified bounds will be operated on:
- 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.
- 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.
- 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.
- 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:
- LIDAR_CLASS - specifies the name of the Lidar class to apply to all matching Lidar points. This can either be the Lidar class number or the name of the Lidar class displayed in the user interface. For example, to set all points to type 2 (ground), use LIDAR_CLASS=2 or LIDAR_CLASS="Ground". This option requires a Global Mapper Pro license.
- DELETE_FEATURES - specifies whether or not to mark all matching features as deleted. Use DELETE_FEATURES=YES to enable.
- 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.
- 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.
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.
// Define a Lidar filter for all points DEFINE_LIDAR_FILTER NAME="LidarFilter_Vegetation" LIDAR_FILTER="3,4,5" DEFINE_LIDAR_FILTER NAME="LidarFilter_Building" LIDAR_FILTER="6" // Move all vegetation points within 2 meter of building points to new layer (mark as deleted in original layer) EDIT_LIDAR FILENAME="*" LIDAR_FILTER_NAME="LidarFilter_Vegetation" \ NEW_LAYER_NAME="Veg within 2m of Building" DELETE_FEATURES="YES" \ LIDAR_FILTER_NEAR_NAME="LidarFilter_Building" MAX_DIST="2.0" USE_3D_DIST="YES"