Main Content

blockedPointCloudDatastore

Datastore for use with blocks from blockedPointCloud objects

Since R2022a

    Description

    A blockedPointCloudDatastore object manages a collection of point cloud blocks that belong to one or more blockedPointCloud objects.

    Creation

    Description

    example

    bpcds = blockedPointCloudDatastore(bpcs) creates a blockedPointCloudDatastore object that manages a collection of point cloud blocks of one or more blockedPointCloud objects, bpcs.

    The BlockSize property of the first element in bpcs is the default datastore block size.

    bpcds = blockedPointCloudDatastore(bpcs,Name=Value) specifies the BlockSize, BlockLocationSet, ReadSize and MinPoints properties of blockedPointCloudDatastore object by using one or more name-value arguments.

    Input Arguments

    expand all

    Blocked point clouds, specified as an array of blockedPointCloud objects.

    Properties

    expand all

    Blocks to include in the datastore, specified as a blockLocationSet object. The object specifies which blocks to include from the blocked point cloud bpcs. You can repeat or omit individual blocks. To obtain the default value, blockedPointCloudDatastore calls the selectBlockLocations function.

    You cannot change the BlockLocationSet property after creating the blockedPointCloudDatastore.

    Block size, specified as a three-element numeric row vector. The elements specify the size of each block in the X-, Y- and Z- dimensions, respectively.

    The default value is the block size of the first blockedPointCloud in bpcs.

    You cannot change the BlockSize property after creating the blockedPointCloudDatastore.

    Example: BlockSize=[50 30 40]

    Minimum number of points each block must contain, specified as a nonnegative scalar. The function discards blocks that contain fewer points than MinPoints.

    Blocked point clouds that supply blocks for the blockedPointCloudDatastore, specified as an array of blockedPointCloud objects. All elements of pointClouds must have the same number of dimensions and be of the same type.

    You cannot change the PointClouds property after creating the blockedPointCloudDatastore.

    Number of blocks to return in each call to the read function, specified as a positive integer. Each call to the read function reads at most ReadSize blocks.

    This property is read-only.

    Total number of blocks available, specified as a numeric scalar.

    Object Functions

    combineCombine data from multiple datastores
    hasdataReturns true if more data is available in blockedPointCloudDatastore
    numpartitionsNumber of datastore partitions
    partitionPartition blockedPointCloudDatastore
    previewPreview subset of data in datastore
    readRead data and metadata from blockedPointCloudDatastore
    readallRead all data from blockedPointCloudDatastore
    resetReset datastore to initial state
    shuffleShuffle data in datastore
    subsetCreate subset of datastore or FileSet
    transformTransform datastore

    Examples

    collapse all

    Create a blocked point cloud from a LAZ file, specifying the block size.

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

    Create a blocked point cloud datastore that contains the blocked point cloud.

    bpcds = blockedPointCloudDatastore(bpc);

    Read four blocks from the datastore.

    bpcds.ReadSize = 4;
    blocks = read(bpcds);

    Display the details of the four blocks.

    disp(blocks)
        {1x1 pointCloud}
        {1x1 pointCloud}
        {1x1 pointCloud}
        {1x1 pointCloud}
    

    Create a FileSet object containing multiple LAS files.

    fs = matlab.io.datastore.FileSet(...
       fullfile(toolboxdir("lidar"),"lidardata", ...
                    "las"),"FileExtensions",".las");

    Create an array of blockedPointCloud objects from the file set, and specify an adapter. Specifying an adapter means the blockedPointCloud function does not have to inspect each file to pick a suitable adapter.

    readAdapter = lidar.blocked.LAS();
    bpcs = blockedPointCloud(fs,[100 100],Adapter=readAdapter);

    Create a blocked point cloud datastore from the blockedPointCloud array.

    bpcds = blockedPointCloudDatastore(bpcs);

    Read all data from the blockedPointCloudDatastore.

    blocks = readall(bpcds);

    Version History

    Introduced in R2022a

    expand all