This method closes the ENVIPointCloud object for writing. After calling Save, the ENVIPointCloud object is no longer available for data access; attempting to call any methods on the invalidated ENVIPointCloud object will result in an error. To access the data, re-open the point cloud file by calling OpenPointCloud (to build a project) or QueryPointCloud (to open the point cloud file, but not build a project).
Note: You must call Save when you are finished writing data to the new point cloud file, or the resulting ENVIPointCloud object will be left in an incomplete state (you cannot retrieve data from it).
Example
e = ENVI(/HEADLESS)
file = FILEPATH('DataSample.las', ROOT_DIR=e.ROOT_DIR, $
SUBDIRECTORY = ['data','lidar'])
pointcloudQuery = e.QueryPointCloud(file)
points = pointcloudQuery.GetPointsInRange(0, 1000, ALL_ATTRIBUTES=allAttributes)
File_Mkdir, 'C:\lidar\CreatedLasFiles'
newFile = 'C:\lidar\CreatedLasFiles\DataSampleSubset.las'
writer = ENVIPointCloud(newFile, /OVERWRITE)
writer.WritePoints, points, ALL_ATTRIBUTES=allAttributes
writer.Save
writer.Close
print, 'Points within queried range written to ', newFile
pointcloudQuery.Close
Syntax
ENVIPointCloud.Save [ERROR=variable]
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.
Version History
API Version
4.3
See Also
ENVIPointCloud, ENVI::OpenPointCloud