Main Content

hasdata

Returns true if more data is available in blockedPointCloudDatastore

Since R2022a

    Description

    tf = hasdata(bpcds) returns a logical scalar, true or false, indicating the availability of data in the blockedPointCloudDatastore object bpcds. Use hasdata in conjunction with the read function to read all the data within the datastore. Call hasdata before calling read.

    example

    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]
               BlockSub: [1 1 1]
               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]
               BlockSub: [2 1 1]
               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 availability, returned as a logical 1 (true) or 0 (false).

    Version History

    Introduced in R2022a