readVLR
Description
Examples
Read VLR Data from LAZ File
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
lasReader
— LAS or LAZ file reader
lasFileReader
object
LAS or LAZ file reader, specified as a lasFileReader
object.
recordID
— Record ID
positive integer
Record ID, specified as a positive integer.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
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.
Data Types: char
| string
Output Arguments
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 theRecord 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 ID User ID Description 0 LASF_Spec Data of the Classification Lookup record, returned as a character vector or string scalar.
3 LASF_Spec ASCII data of the Text Area Description record, returned as a character vector or string scalar.
100-354 LASF_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.
2111 LASF_Projection ASCII data of the OGS Math Transform WKT record, returned as a character vector or string scalar.
2112 LASF_Projection ASCII data of the OGS Coordinate System WKT record, returned as a character vector or string scalar.
34735 LASF_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 theTIFFTagLocation
field.
34736 LASF_Projection Data of the GeoDoubleParamsTag record, returned as a numeric vector of type double
.34737 LASF_Projection ASCII 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 R2022aR2022b: 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
The output vlr
structure contains both
RawByteData
and Data
fields. Prior to R2022b, the
function returned only one of these two fields.
See Also
Functions
Objects
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)