pymccrgb.ioutils module

Convenience functions for loading point clouds in various formats

pymccrgb.ioutils.read_data(filename, usecols=None, userows=None, nrows=None)[source]

Loads a point cloud as numpy array

Parameters:
filename: str

Filename of text file containing point cloud

usecols: list

List of column indices (text file) or names (LAS file) to load Default: First six columns, e.g., (x, y, z, r, g, b)

userows: list

List of rows to load. Overrides nrows argument Default: All rows

nrows: int

Number of random rows to load. Ignored if userows is given. Default: Not used.

Returns:
A data array of shape (nrows x ncols)
pymccrgb.ioutils.read_las(filename, usecols=['X', 'Y', 'Z', 'Red', 'Green', 'Blue'], userows=None, nrows=None)[source]

Loads a point cloud from a LAS or LAZ file into a Numpy array

Theoretically, any file with a PDAL reader can be read with read_las

Parameters:
filename: str

Filename of LAS or LAZ file containing point cloud

usecols: list

List of column names to load Default: [‘X’, ‘Y’, ‘Z’, ‘Red’, ‘Green’, ‘Blue’]

userows: list

List of rows to load. Overrides nrows argument Default: All rows

nrows: int

Number of random rows to load. Ignored if userows is given. Default: Not used.

Returns:
A data array of shape (nrows x ncols)
pymccrgb.ioutils.read_txt(filename, usecols=range(0, 6), userows=None, nrows=None)[source]

Loads a point cloud from text file as numpy array

Parameters:
filename: str

Filename of text file containing point cloud

usecols: list

List of column indices to load Default: First six columns, e.g., (x, y, z, r, g, b)

userows: list

List of rows to load. Overrides nrows argument Default: All rows

nrows: int

Number of random rows to load. Ignored if userows is given. Default: Not used.

Returns:
A data array of shape (nrows x ncols)
pymccrgb.ioutils.write_dem(data, filename, resolution=1, radius=None)[source]
pymccrgb.ioutils.write_las(arr, filename)[source]
pymccrgb.ioutils.write_pdal(arr, filename, writer, header='X, Y, Z, Red, Green, Blue')[source]