Main Content

concatenate

Concatenate lidar point attributes array

Since R2024a

Description

example

ptAttrOut = concatenate(ptAttrs) concatenates an array of lidar point attributes ptAttrs into a single lidar point attribute object ptAttrOut.

Examples

collapse all

Create a lasFileReader object and read point cloud data and the associated classification point attributes from a LAZ file.

pcfile1 = fullfile(toolboxdir("lidar"),"lidardata", ...
    "las","aerialLidarData.laz");
lasReader1 = lasFileReader(pcfile1);
[ptCloud1,ptAttr1] = readPointCloud(lasReader1,Attributes="Classification");

Create another lasFileReader object and read point cloud data and the associated classification point attributes from a LAS file.

pcfile2 = fullfile(toolboxdir("lidar"),"lidardata", ...
    "las","aerialLidarData2.las");
lasReader2 = lasFileReader(pcfile2);
[ptCloud2,ptAttr2] = readPointCloud(lasReader2,Attributes="Classification");

Concatenate the data from the two point clouds into a single point cloud. Then, concatenate their lidar point attributes.

ptCloudOut = pccat([ptCloud1; ptCloud2]);
ptAttrOut = concatenate([ptAttr1; ptAttr2]);

Display the concatenated point clouds. Specify the color based on the concatenated classification attributes.

pcshow(ptCloudOut.Location,ptAttrOut.Classification);

Input Arguments

collapse all

Lidar point attributes, specified as an array of lidarPointAttributes objects.

Output Arguments

collapse all

Concatenated lidar point attributes, returned as a lidarPointAttributes object.

Note

If any property of an input lidarPointAttributes object contains an empty array, then the function does not concatenate that property and returns an empty array for that property in the concatenated output. For example, if some input lidarPointAttributes objects have values for the Classification property, but another one has an empty array, then the function returns an empty array for the Classification property of ptAttrOut.

Version History

Introduced in R2024a