Main Content

readVLR

Read variable length record from LAS or LAZ file

Since R2022a

Description

example

vlr = readVLR(lasReader,recordID) reads the variable length record vlr from the specified record recordID of the LAS or LAZ file reader lasReader.

vlr = readVLR(lasReader,recordID,userID) specifies the user ID of the variable length record.

Examples

collapse all

Create a lasFileReader object for a LAZ file. Then, use the readVLR function to read variable length record (VLR) data from the LAZ file.

Create a lasFileReader object to access the LAZ file data.

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

Read VLR data from the LAZ file using the readVLR function.

vlr = readVLR(lasReader,34737);

Display the VLR data.

disp(vlr)
       RecordID: 34737
         UserID: 'LASF_Projection'
    Description: 'GeoTIFF GeoAsciiParamsTag'
    RawByteData: [78 65 68 56 51 32 47 32 85 84 77 32 122 111 110 101 32 49 54 78 32 43 32 86 69 82 84 95 67 83 124 78 65 68 56 51 124 78 65 86 68 56 56 32 104 101 105 103 104 116 124]
           Data: 'NAD83 / UTM zone 16N + VERT_CS|NAD83|NAVD88 height'

Input Arguments

collapse all

LAS or LAZ file reader, specified as a lasFileReader object.

Record ID, specified as a positive integer.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

User ID for the VLR data, specified as a character vector or string scalar. This value identifies the user that created the VLR data.

Data Types: char | string

Output Arguments

collapse all

Variable length record, returned as a structure or an array of structures. Each structure contains these fields:

  • RecordID — Record ID of the VLR, returned as a positive integer.

  • UserID — User ID that created the VLR, returned as a string scalar.

  • Description — Text description of the VLR, returned as a string scalar.

  • RawByteData — Raw bytes of data stored in the VLR, returned as an integer vector. The length of the vector is equal to the Record Length After Header value in the corresponding VLR header.

  • Data — Parsed data for standard VLR records. The value of this field depends on the contents of the VLR corresponding to its record ID and user ID. This table lists some standard record ID and user ID combinations.

    Record IDUser IDDescription
    0LASF_Spec

    Data of the Classification Lookup record, returned as a character vector or string scalar.

    3LASF_Spec

    ASCII data of the Text Area Description record, returned as a character vector or string scalar.

    100-354LASF_Spec

    Data of the Waveform Packet Descriptor record, returned as a structure containing these fields:

    • BitsPerSample — Number of bits for each sample in the range 2 to 32 bits.

    • CompressionType — Compression algorithm for waveform packets. Value 0 represents no compression. Reserved for future use.

    • NumberOfSamples — Number of samples in decompressed waveform packet.

    • TemporalSpacing — Temporal sample spacing in picoseconds.

    • DigitizerGain — Digitizer gain to use to convert raw digitized value to an absolute digitizer voltage.

    • DigitizerOffset — Digitizer offset to use to convert raw digitized value to an absolute digitizer voltage.

    2111LASF_Projection

    ASCII data of the OGS Math Transform WKT record, returned as a character vector or string scalar.

    2112LASF_Projection

    ASCII data of the OGS Coordinate System WKT record, returned as a character vector or string scalar.

    34735LASF_Projection

    GeoTiff key values of the GeoKeyDirectoryTag record, returned as a structure containing these fields:

    • KeyDirectoryVersion — Key directory version number, returned as 1.

    • KeyRevision — Key revision number, returned as 1.

    • MinorRevision — Minor revision number, returned as 0.

    • NumberOfKeys — Number of keys, returned as a scalar.

    • KeyEntries — Structure for each key containing these fields:

      • KeyID — Key ID for each GeoTIFF data.

      • TIFFTagLocation — Location of the data for the specified key ID.

      • Count — Number of characters in GeoAsciiParamsTag string value. Otherwise it returns 1.

      • ValueOffset — Value depends on the TIFFTagLocation field.

    34736LASF_ProjectionData of the GeoDoubleParamsTag record, returned as a numeric vector of type double.
    34737LASF_ProjectionASCII data of the GeoAsciiParamsTag record, returned as a character vector or string scalar.

Note

When you specify a valid combination of record ID and user ID, the Data field is nonempty. Otherwise, the function interprets the binary contents of the VLR and returns only RawByteData, leaving the Data field empty.

For more information on the VLR header, or the various types of records, see the ASPRS LASER (LAS) File Format Exchange Activities page.

Data Types: struct

Version History

Introduced in R2022a

expand all