Main Content

Lasfilereader

LAS or LAZ file reader

Description

一个Lasfilereader目的stores the metadata present in the LAS or LAZ file as read-only properties. The object function,ReadPointCloud,使用这些属性从文件读取点云数据。这Lasfilereader目的supports up to the LAS 1.4 specification.

一个LAS file contains a public header, which has lidar metadata, followed by lidar point records. Each point record contains attributes such as 3-D coordinates, intensity, and GPS timestamp.

这LAS file format is an industry-standard binary format for storing lidar data, developed and maintained by the American Society for Photogrammetry and Remote Sensing (ASPRS). The LAZ file format is a compressed version of the LAS file format.

创建

Description

例子

Lasreader= lasfilereader(文件名创建一个Lasfilereader通过读取LAS或LAZ文件中存在的元数据设置的属性的对象文件名。这文件名输入设置文件名财产。

特性

expand all

This property is read-only.

Name of the LAS or LAZ file, specified as a character vector or string scalar.

This property is read-only.

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

This property is read-only.

LAS或LAZ文件版本,指定为字符向量。

This property is read-only.

Range of coordinates along theX-axis, specified as a two-element real-valued row vector.

This property is read-only.

Range of coordinates along they-axis, specified as a two-element real-valued row vector.

This property is read-only.

Range of coordinates along thez-axis, specified as a two-element real-valued row vector.

This property is read-only.

Range of GPS timestamp readings, specified as a 1-by-2期间向量。

This property is read-only.

所有点激光返回的最大,,,,specified as a positive integer.

This property is read-only.

所有点分类值的最大值,指定为正整数。

This property is read-only.

Name of the hardware sensor system identifier that generated the LAS files, specified as a string scalar.

This property is read-only.

Name of the generating software, specified as a string scalar. This property specifies the generating software package used when the LAS file was created.

This property is read-only.

文件创建日期,指定为datetime目的。

This property is read-only.

LAS文件源标识符,指定为非负整数。值在0到65535范围内。如果此文件是从原始飞行线创建的,则定义飞行线号。值0指定未分配ID。使用ProjectIDandFileSourceID属性以唯一标识LAS文件中的每个点。

This property is read-only.

项目ID,,,,specified as a string scalar. This value is a globally unique identifier (GUID). Use theProjectIDandFileSourceID属性以唯一标识LAS文件中的每个点。

This property is read-only.

点数据记录格式ID,指定为非负整数。值在0到10范围内。有关更多信息,请参见Point Data Record Format

This property is read-only.

分类信息,指定为表。表的每一行都包含以下描述点类的信息:

  • Classification Value- 该类的唯一分类ID号,指定为正整数。

  • Class Name-Label associated with the class, specified as a string scalar.

  • Number of Points by Class-Number of points in the class, specified as a positive integer.

This property is read-only.

激光返回信息,指定为表。表的每一行都包含以下描述激光返回的信息:

  • Laser Return Number- 激光返回号,指定为正整数。

  • Number of Points by Return- 每个激光返回点数,指定为正整数。

This property is read-only.

Variable length record (VLR) or extended VLR information, specified as a table. Each row of the table contains this information describing a record:

  • Record ID-Record identification number, specified as a positive integer.

  • User ID- 与记录ID关联的用户标识,指定为字符串标量。

  • Description- 记录的描述,指定为字符串标量。

对象功能

ReadPointCloud Read point cloud data from LAS or LAZ file
readcrs 从LAS或LAZ文件读取坐标参考系统数据
readVLR 从LAS或LAZ文件中读取可变长度记录
hasCRSData 检查LAS或LAZ文件是否具有CRS数据
hasGPSData Check if LAS or LAZ file has GPS data
haswaveformdata 检查LAS或LAZ文件是否具有波形数据
hasNearIRData 检查LAS或LAZ文件是否具有近红外数据

Examples

collapse all

此示例显示了如何从LAS / LAZ文件中读取和可视化点云数据。

创建一个LasfilereaderLAZ文件的对象。然后,使用ReadPointCloudfunction to read point cloud data from the LAZ file and generate apointCloud目的。

创建一个Lasfilereader目的to access the LAZ file data.

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

Read point cloud data from the LAZ file using theReadPointCloud功能。

ptCloud = ReadPointCloud(lasreader);

可视化点云。

图PCSHOW(PTCLOUD.LOCATION)

图包含一个轴对象。轴对象包含类型散点的对象。

Segregate and visualize point cloud data based on classification data from a LAZ file.

创建一个Lasfilereader目的to access data from the LAZ file.

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

使用LAZ文件读取点云数据和关联的分类点属性ReadPointCloud功能。

[ptCloud,pointAttributes] = readPointCloud(lasReader,“属性”,,,,“分类”);

根据其分类属性为点上色。将标签图像重塑为点云的形状。

labels = label2rgb(pointAttributes.Classification); colorData = reshape(labels,[],3);

可视化颜色编码点云。

figure pcshow(ptCloud.Location,colorData)

图包含一个轴对象。轴对象包含类型散点的对象。

更多关于

expand all

版本历史记录

Introduced in R2020b

expand all