The CreateLidarFromSubrect method allows the user to create a spatial subset of a LiDAR dataset. This can be useful when only a certain area of the dataset is required for processing. Another useful scenario is to split the dataset up for distributed processing; for example, using the ENVI Services Engine (ESE).
This method has been deprecated. Use the CreatePointCloudSubProject task instead.
Example
The following example opens a LAS file and creates a spatial subset.
e = E3De(/HEADLESS)
file = FILEPATH('DataSample.las', ROOT_DIR=e.ROOT_DIR, $
SUBDIRECTORY = ['DataSample'])
lidar = e.OpenLidar(file)
print, lidar.Total_Number_Of_Points
print, lidar.Data_Range
dataRange = lidar.Data_Range
dataRangeX = dataRange[3] - dataRange[0]
dataRangeY = dataRange[4] - dataRange[1]
subRect = [dataRange[0], dataRange[1], dataRange[0] + (dataRangeX * 0.5), dataRange[1] + (dataRangeY * 0.5)]
e.CreateLidarFromSubrect, lidar, 'C:\DataSampleSubset\DataSampleSubset.ini', subRect
lidar.Close
subsetLidar = e.OpenLidar('C:\DataSampleSubset\DataSampleSubset.ini')
print, subsetLidar.Data_Range
Syntax
E3De.CreateLidarFromSubrect(E3dlidar, URI, SubRect [, ERROR=variable] [, SPATIALREF=E3DLidarspatialref])
Arguments
E3dlidar
The E3DLidar object from which to generate the subrectangle. If this E3DLidar was opened with DIRECT_READ set then an error will be thrown.
URI
A scalar string that is a fully-qualified path and name of the new LiDAR subrectangle .ini file.
SubRect
A 4x1 array, [xMin, yMin, xMax, yMax], specifying the spatial subrectangle of the new LiDAR object.
If the sub rect dimensions are smaller than the 32x32 meter native tile boundary, then the subrectangle dimensions are scaled up to the native tile boundary.
Keywords
ERROR
Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.
When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.
See Manage Errors for more information on error handling in ENVI programming.
SPATIALREF
An instance of an E3DLidarSpatialRef. Use this keyword to specify the coordinate system of the subrectangle. If no SPATIALREF is supplied, UTM WGS84 is assumed.
Version History
3.2 SP1 |
Introduced |
ENVI 5.3 |
Obsolete |
See Also
E3De, E3DLidar, E3DLidarSpatialRef