ENVI::QueryPointCloud

The QueryPointCloud function method opens a single LAS file (.las, .laz, or .ntf); MrSID file (.sid); text file (.txt); or Terrasolid file (.bin).

This method differs from ENVI::OpenPointCloud in that it directly reads the file without processing it into an optimized file format. Because the data has not been optimized, the returned ENVIQueryPointCloud object does not have the ENVIPointCloud::GetPointsInCircle, ENVIPointCloud::GetPointsInPolygon, ENVIPointCloud::GetPointsInRect, or ENVIPointCloud::GetPointsInTile methods, but ENVIPointCloudQuery::GetPointsInRange is available. Also, ENVIPointCloudQuery cannot be used as input to the PointCloudFeatureExtraction task.

Example

; Start the application in headless mode

e = ENVI(/HEADLESS)

 

; Open a LAS file

file = FILEPATH('DataSample.las', ROOT_DIR=e.ROOT_DIR, $

SUBDIRECTORY = ['data','lidar'])

pointcloud = e.QueryPointCloud(file)

 

; Print number of points and extents

print, 'Number of points: ',pointcloud.NPOINTS

print, 'Data range: ',pointcloud.DATA_RANGE

 

; Close the query object

pointcloud.Close

Syntax

Result = ENVI.QueryPointCloud(URI [, ERROR=variable] [, TXT_FORMAT=value] [, TXT_SKIP_HEADER_LINES=value])

Return Value

This method returns a reference to an ENVIPointCloudQuery object.

Arguments

URI

A scalar string that is a fully-qualified path to a single point cloud file (.las, .laz, .txt, .ntf, .sid, or .bin).

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.

TXT_FORMAT

Use this keyword to specify the columns for text format point datasets. This is a 1-D array of strings where each entry in the array details the column type. The supported strings are: x, y, height, intensity, red, green, blue, ignore.

format = ['x', 'y', 'height', 'intensity', 'red', 'green', 'blue']

This keyword is ignored if the input point cloud files are not in .txt format.

TXT_SKIP_HEADER_LINES

Use this keyword to specify how many lines to skip from the beginning of the text file to get to the first point. Some text files have information at the beginning that describe what is in the file. Use TXT_SKIP_HEADER_LINES to skip over those lines to get to the first point. If this is not set correctly, it will not be possible to read from the text file. The default value is 0.

This keyword is ignored if the input point cloud files are not in .txt format.

Version History

ENVI 5.3

Introduced

API Version

4.2

See Also

ENVI, ENVIPointCloudQuery, ENVIPointCloud::GetPointsInRange, ENVI::OpenPointCloud