Read variable length record from LAS or LAZ file
Read VLR Data from LAZ File
lasFileReader object for a LAZ file. Then, use the
readVLR function to read variable length record (VLR) data from the LAZ file.
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
vlr = readVLR(lasReader,34737);
Display the VLR data.
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'
lasReader — LAS or LAZ file reader
LAS or LAZ file reader, specified as a
recordID — Record ID
Record ID, specified as a positive integer.
userID — User ID for VLR data
character vector | string scalar
User ID for the VLR data, specified as a character vector or string scalar. This value identifies the user that created the VLR data.
vlr — Variable length record
structure | array of structures
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 Headervalue 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 ID User ID Description 0 LASF_Spec
Data of the Classification Lookup record, returned as a character vector or string scalar.
ASCII data of the Text Area Description record, returned as a character vector or string scalar.
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.
ASCII data of the OGS Math Transform WKT record, returned as a character vector or string scalar.
ASCII data of the OGS Coordinate System WKT record, returned as a character vector or string scalar.
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
34736 LASF_Projection Data of the GeoDoubleParamsTag record, returned as a numeric vector of type
34737 LASF_Projection ASCII data of the GeoAsciiParamsTag record, returned as a character vector or string scalar.
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
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.
Version HistoryIntroduced in R2022a
R2022b: Specify user ID to read VLR data
You can additionally specify the user ID along with the record ID to read VLR data from a LAS or LAZ file.
R2022b: Returns both raw byte data and VLR data
vlr structure contains both
Data fields. Prior to R2022b, the
function returned only one of these two fields.