Main Content

read

Read data and metadata from blockedPointCloudDatastore

Since R2022a

    Description

    example

    b = read(bpcds) returns the data extracted from the blockedPointCloudDatastore object bpcds.

    [b,info] = read(bpcds) also returns info, a structure containing information about where in the blockedPointCloudDatastore the data is extracted from.

    Examples

    collapse all

    Create a blocked point cloud.

    pcfile = fullfile(toolboxdir("lidar"),"lidardata", ...
                           "las","aerialLidarData.laz");
    bpc = blockedPointCloud(pcfile,[300 300]);

    Create a blockedPointCloudDatastore from the blocked point cloud.

    bpcds = blockedPointCloudDatastore(bpc);

    Read data and metadata from the blockedPointCloudDatastore. Display the metadata.

    while hasdata(bpcds)
          [data,info] = read(bpcds);
          disp(info)
    end
                    ROI: [4.2975e+05 4.3005e+05 3.6798e+06 3.6801e+06 72.7900 125.8200]
               PCNumber: 1
        PointAttributes: [1x1 lidarPointAttributes]
              BlockSize: [300 300 53.0300]
    
                    ROI: [4.3005e+05 4.3035e+05 3.6798e+06 3.6801e+06 72.7900 125.8200]
               PCNumber: 1
        PointAttributes: [1x1 lidarPointAttributes]
              BlockSize: [300 300 53.0300]
    

    Input Arguments

    collapse all

    Blocked point cloud datastore, specified as a blockedPointCloudDatastore object.

    Output Arguments

    collapse all

    Data from the blockedPointCloudDatastore, returned as a cell array of block data. The length of the cell array is equal to the value of the ReadSize property of the blockedPointCloudDatastore object.

    Metadata from the blockedPointCloudDatastore, returned as a structure with these fields. If the value of the ReadSize property of the blockedPointCloudDatastore object is greater than 1, these fields are arrays.

    FieldDescription
    ROI

    ROI of the block, specified as a six-element numeric row vector in the order [xmin xmax ymin ymax zmin zmax].

    PCNumber

    Index into the bpcds.PointClouds array corresponding to the blockedPointCloud from which this block is read.

    PointAttributes

    Attributes for each point, specified as a lidarPointAttributes object.

    BlockSize

    Value of the BlockSize parameter.

    Version History

    Introduced in R2022a