Main Content

lidarPointAttributes

Object for storing lidar point attributes

Description

The lidarPointAttributes object stores additional point attributes that are not stored in a pointCloud object. These attributes are associated to lidar data.

Creation

Use either lidarPointAttributes function or the readPointCloud function to create a lidarPointAttributes object. The readPointCloud function also creates a pointCloud object.

To create a lidarPointAttributes object using readPointCloud function, see the Read Attributes from LAS File example.

Description

example

attr = lidarPointAttributes(Name=Value) creates a lidarPointAttributes object with properties set using one or more name-value arguments.

Properties

expand all

This property is read-only.

Number of available point records in the file, specified as a nonnegative integer.

Classification numbers of each point, specified as an M-by-1 vector of nonnegative integers. M is equal to the number of available point records.

For LAS file point data record formats 0 to 5, the classification number ranges from 0 to 31.

Classification NumberClassification Type
0Created, never classified
1Unclassified
2Ground
3Low vegetation
4Medium vegetation
5High vegetation
6Building
7Low point (noise)
8Model key-point
9Water
10Reserved
11Reserved
12Overlap points
13 - 31Reserved

For LAS file point data record formats 6 to 10, the classification number ranges from 0 to 255.

Classification NumberClassification Type
0Created, never classified
1Unclassified
2Ground
3Low vegetation
4Medium vegetation
5High vegetation
6Building
7Low point (noise)
8Reserved
9Water
10Rail
11Road surface
12Reserved
13Wire guard (shield)
14Wire conductor (phase)
15Transmission tower
16Wire-structure connector (insulator)
17Bridge deck
18High noise
19 Overhead structure
20Ignored ground
21Snow
22Temporal exclusion
23- 63Reserved
64 - 255User-defined

These are standard class names and class-object mappings. The class definition and mapping might differ depending on the application that created the LAS or LAZ file.

Example: Classification=[0 255 128]' specifies the classification numbers for three points as 0, 255, and 128.

Data Types: uint8

Laser pulse return numbers of each point, specified as an M-by-1 vector of positive integers. M is equal to the number of available point records.

For LAS file point data record formats 0 to 5, the values are in the range 1 to 5, and for point data record formats 6 to 10, the values are in the range 1 to 15.

Example: LaserReturn=[10 15 1]' specifies the laser pulse return numbers for three points as 10, 15, and 1.

Data Types: uint8

Total number of returns for a pulse, specified as an M-by-1 vector of positive integers. M is equal to the number of available point records.

For LAS file point data record formats 0 to 5, the values are in the range 1 to 5, and for point data record formats 6 to 10, the values are in the range 1 to 15.

Example: NumReturns=[1 10 15]' specifies the total number of returns for three points as 1, 10, and 15.

Data Types: uint8

GPS time stamps of each point, specified as an M-by-1 duration vector in seconds. M is equal to the number of available point records.

Example: GPSTimeStamp=seconds(1:3)' specifies the GPS time stamps for three points as 1, 2, and 3 seconds.

Near infrared channel value of each point, specified as an M-by-1 vector of positive integers. M is equal to the number of available point records. Values must be in the range [0, 65535].

Example: NearIR=ones(3,1) specifies the near infrared channel values for three points as 1.

Data Types: uint16

Scan angle of each point, specified as an M-by-1 vector. Each value represents the rotational angle at which the point is captured in the laser system. The angle is negative to the left of the front of the sensor, positive to the right, and 0 degrees directly in front. M is equal to the number of available point records.

For LAS file point data record formats 0 to 5, the values are in the range –90 to 90, and for point data record formats 6 to 10, the value ranges from –180 to 180.

Example: ScanAngle=[0 -180 105]' specifies the scan angles for three points as directly ahead, 180 degrees to the left, and 105 degrees to the right.

Data Types: single

Point source ID of each point, specified as an M-by-1 vector of nonnegative integers. Each element defines the source from which a point originates. M is equal to the number of available point records.

A source is a grouping of temporally consistent data, such as a flight line for aerial systems. The values are in the range [0, 65535].

Example: PointSourceID=[0 1 65535]' specifies the point source IDs for three points as 0, 1, and 65535.

Data Types: uint16

Scanner channel of each point, specified as an M-by-1 vector of nonnegative integers. M is equal to the number of available point records.

For single channel systems the value is 0. The values are in the range [0, 3].

Example: ScannerChannel=[0 0 0]' specifies the scanner channels for three points as 0.

Data Types: uint8

Scan direction flag of each point, specified as an M-by-1 logical vector. M is equal to the number of available point records.

The value specifies the direction of scanner mirror motion during the capture of the corresponding point. Left-to-right motion is defined as positive, while right-to-left motion is defined as negative. A logical 1 (true) denotes a positive scan direction for the point, and a logical 0 (false) denotes a negative scan direction.

Example: ScanDirectionFlag=false(3,1) specifies the scan direction flags for three points as right-to-left.

Data Types: logical

Edge of flight line flag of each point, specified as an M-by-1 logical vector. M is equal to the number of available point records.

Logical 1 (true) indicates that the point lies on the edge of the flight line. Otherwise, the corresponding element is a logical 0 (false).

Example: EdgeOfFlightLineFlag=true(3,1) specifies that three points lie on the edge of the flight line.

Data Types: logical

Classification flags, specified as a structure. The structure contains these fields:

  • Synthetic — An M-by-1 logical vector, where logical 1 (true) indicates that the point was generated synthetically. Otherwise, the point is specified as logical 0 (false).

  • Keypoint — An M-by-1 logical vector, where true indicates that the point is a model key-point. Otherwise, the point is specified as false.

  • Withheld — An M-by-1 logical vector, where true indicates that the point is withheld from the processing algorithm. Otherwise, the point is specified as false.

  • Overlap — An M-by-1 logical vector, where true indicates that the point lies within the overlap region of two or more swaths. Otherwise, the point is specified as false.

Example: ClassificationFlags=struct(Synthetic=true(3,1),Keypoint=false(3,1),Withheld=true(3,1),Overlap=false(3,1)) specifies the classification flags for three points as a structure.

Waveform data, specified as a structure. The waveform data is stored in point records and the corresponding variable length records of a LAS or LAZ file. The structure contains these fields:

FieldValueDescription
XtM-by-1 vector of type double

Defines the X component of parametric line equation. For more information, see Parametric line equation.

YtM-by-1 vector of type double

Defines the Y component of parametric line equation. For more information, see Parametric line equation.

ZtM-by-1 vector of type double

Defines the Z component of parametric line equation. For more information, see Parametric line equation.

ReturnPointLocationM-by-1 vector of type double

Each element represents the offset from the first digitized value to the location within the waveform packet at which the associated return pulse was detected. These values are represented in picoseconds.

BitsPerSampleM-by-1 vector of type doubleNumber of bits for each sample in the range 2 to 32 bits.
CompressionTypeM-by-1 vector of type doubleCompression algorithm for waveform packets. Value 0 represents no compression. Reserved for future use.
NumberOfSamplesM-by-1 vector of type doubleDefines the number of samples in decompressed waveform packet.
TemporalSpacingM-by-1 vector of type doubleDefines the temporal sample spacing in picoseconds.
DigitizerGainM-by-1 vector of type doubleDefines the digitizer gain to use to convert raw digitized value to an absolute digitizer voltage.
DigitizerOffsetM-by-1 vector of type doubleDefines the digitizer offset to use to convert raw digitized value to an absolute digitizer voltage.

Example: WaveformData=struct(Xt=[1 2 3]',Yt=[3 4 5]',Zt=[5 6 7]',ReturnPointLocation=[1 2 3]',BitsPerSample=[1 2 3]',CompressionType=[1 0 1]',NumberOfSamples=[10 25 32]',TemporalSpacing=[11 21 31]',DigitizerGain=[11 12 13]',DigitizerOffset=[21 22 23]') specifies the waveform data for three points as a structure.

User data, specified as an M-by-1 vector of integers. M is equal to the number of available point records. This value corresponds to the user data field of the point record data in the LAS file. Use this field at your discretion.

Example: UserData=[1 2 4]' specifies the user data for three points.

Examples

collapse all

Create a lasFileReader object for a LAS file. Then, use the readPointCloud function to read attributes from the LAS file and generate a lidarPointAttributes object.

Create a lasFileReader object to access the LAS file data.

path = fullfile(toolboxdir("lidar"),"lidardata", ...
    "las","aerialLidarData2.las");
lasReader = lasFileReader(path);

Read all points and point attributes from the LAS file to a pointCloud object and lidarPointAttributes object, respectively, by using the readPointCloud function.

[ptCloud,pointAttributes] = readPointCloud(lasReader,Attributes= ...
        ["Classification","LaserReturn","NumReturns", ... 
        "EdgeOfFlightLine","ScanAngle"]);

Display the point attributes.

disp(pointAttributes)
  lidarPointAttributes with properties:

                   Count: 78970
          Classification: [78970x1 uint8]
             LaserReturn: [78970x1 uint8]
              NumReturns: [78970x1 uint8]
            GPSTimeStamp: [0x0 duration]
                  NearIR: []
               ScanAngle: [78970x1 single]
           PointSourceID: []
          ScannerChannel: []
       ScanDirectionFlag: []
    EdgeOfFlightLineFlag: [78970x1 logical]
     ClassificationFlags: [1x1 struct]
            WaveformData: [1x1 struct]
                UserData: []

Specify attributes of the lidarPointAttributes object for three points.

classificationValues=[0 255 128]';
laserReturns=[10 15 1]';
numReturns=[1 10 15]';

Create a lidarPointAttributes object.

attr=lidarPointAttributes(Classification=classificationValues, ...
    LaserReturn=laserReturns,NumReturns=numReturns);

Display the point attributes.

disp(attr)
  lidarPointAttributes with properties:

                   Count: 3
          Classification: [3x1 uint8]
             LaserReturn: [3x1 uint8]
              NumReturns: [3x1 uint8]
            GPSTimeStamp: [0x0 duration]
                  NearIR: []
               ScanAngle: []
           PointSourceID: []
          ScannerChannel: []
       ScanDirectionFlag: []
    EdgeOfFlightLineFlag: []
     ClassificationFlags: [1x1 struct]
            WaveformData: [1x1 struct]
                UserData: []

Algorithms

The values of Xt, Yt, and Zt fields in WaveformData property define a parametric line equation for extrapolating points along the associated waveform. The position along the wave is given by:

X=X0+XtY=Y0+YtZ=Z0+Zt

where X, Y, and Z represent the spatial position of the derived point, X0, Y0, and Z0 define the position of the anchor point, Xt, Yt, and Zt define the position of the point at a distance of time t, in picoseconds, relative to the anchor point. The X, Y, and Z units are identical to the units of the coordinate system of the LAS data. If the coordinate system is geographic, the horizontal units are decimal degrees and the vertical units are in meters.

For more information, see the ASPRS LASER (LAS) File Format Exchange Activities page.

Version History

Introduced in R2022a