Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.


  >  Docs Center  >  ENVI API  >  Obsolete  >  E3DLidar::Init

E3DLidar::Init

E3DLidar::Init

The E3DLidar::Init function method initializes the E3DLidar object.

Note: Init methods are special lifecycle methods, and as such cannot be called outside the context of object creation. This means that in most cases, you cannot call the Init method directly. There is one exception to this rule: if you write your own subclass of this class, you can call the Init method from within the Init method of the subclass.

An E3DLidar object should only be created directly if creating a new .las file to write points to. To open an existing LiDAR file, call E3De::OpenLidar to return an E3DLidar object.

This method has been deprecated. Use ENVIPointCloud::Init instead.

Example


; Create a headless instance
e = E3De(/HEADLESS)
 
; Open existing data
file = FILEPATH('DataSample.las', ROOT_DIR=e.ROOT_DIR, $
  SUBDIRECTORY = ['DataSample'])
lidar = e.OpenLidar(file, AUXILIARY_URI='C:\lidar\DataSample')
 
; Query points to be written to file along with all point attributes
points = lidar.GetPointsInRect(593742.0d, 5289519.0d, 593800.0d, 5289650.0d, $
  ALL_ATTRIBS=allAttribs)
File_Mkdir, 'C:\CreatedLasFiles'
 
; Create the writer object. The call to E3DLidar implicitly calls E3DLidar::Init.
writer = E3DLidar('C:\CreatedLasFiles\DataSampleSubset.las', /OVERWRITE)
 
; write points to the file
writer.WritePoints, points, ALL_ATTRIBS=allAttribs, ERROR=error
 
; Save the file
writer.Save
 
; Close the writer object and any open lidar objects.
writer.Close
e.Close

Syntax


Obj = E3DLidar(filename [, ERROR=variable] [, LAS_SCALE_FACTOR=variable] [, LAS_OFFSET=variable] [, /OVERWRITE] [, SPATIALREF=E3DLidarspatialref])

Return Value


If successful, a reference to the E3DLidar object is returned. Otherwise, a NULL object reference is returned.

Arguments


Filename

The fully qualified filename to be written, including the .las extension.

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.

LAS_OFFSET (Init)

Set this keyword to a three-element array of doubles that specify the x, y, and z offsets used in the new LAS file being written. The offsets can effect the precision of the point positions stored in the LAS file. See the LAS specification on the ASPRS web site for more details. If this keyword is not set the default value for LAS_OFFSET is [0.0, 0.0, 0.0].

If copying points from an existing LAS file, the original offsets can be read from its E3DLasHeader and passed to LAS_OFFSET. See E3DLidar::GetLasHeader for more details.

LAS_SCALE_FACTOR (Init)

Set this keyword to a three-element array of doubles that specify the x, y, and z scale factors used in the new LAS file being written. The scale factors can effect the precision of the point positions stored in the LAS file. See the LAS specification for more details.

If this keyword is not set the default value for LAS_SCALE_FACTOR is [0.0000001, 0.0000001, 0.0000001] for LAS files using lat/lon coordinate system and [0.01, 0.01, 0.01] for all other coordinate systems.

If copying points from an existing LAS file, the original scale factors can be read from its E3DLasHeader and passed to LAS_SCALE_FACTOR. See E3DLidar::GetLasHeader for more details.

OVERWRITE (Init)

By default, if the LAS file specified by the filename parameter already exists, an error will be thrown. Set this keyword to enable overwriting an existing LAS file.

SPATIALREF (Init)

Set this property to an E3DLidarSpatialRef object to have the coordinate system information contained in the E3DLidarSpatialRef written to the .las file.

Note: If the coordinate system information is specified using the COORD_SYS_STR, it must have a corresponding EPSG code in the string (e.g., AUTHORITY["EPSG","2236"]), otherwise the coordinate system information will not be written to the LAS header.

Version History


3.2

Introduced

ENVI 5.3 Obsolete

See Also


E3DLidar, E3De::OpenLidar, E3DLasHeader, E3DLidar::GetLasHeader



© 2018 Harris Geospatial Solutions, Inc. |  Privacy Policy
My Account    |    Store    |    Contact Us