pchandler.data_io.las

LAS/LAZ file-format handler class.

Classes

LasHandler

Handles LAS/LAZ file input and output.

class pchandler.data_io.las.LasHandler

Bases: AbstractIOHandler

Handles LAS/LAZ file input and output.

Supported file extensions:

  • .las

  • .laz

FORMATS: list[str] = ['.las', '.laz']
classmethod load(path, /, scalar_fields=None, remove_prefix=True, prefix='scalar_', force_no_numerical_shift=False, **pcd_kw)

Load a point cloud from a LAS/LAZ file.

Parameters:
  • path (str | Path) – Input LAS or LAZ file path.

  • scalar_fields (list[str]], default=None) – List of specific scalar fields to extract from the PLY file. Setting None will retrieve all scalar fields. Setting to [] will ignore scalar fields in the file.

  • remove_prefix (bool, default=True) – Flag to remove prefixes on scalar field names.

  • prefix (str, default="scalar_") – Prefix to strip from scalar field names if remove_prefix is True.

  • force_no_numerical_shift (bool, default=False) – Flag determining if the optimal shifts should be overridden and original coordinates used

  • config (dict)

Return type:

PointCloudData

classmethod save(pcd, path, /, scalar_fields=None, add_prefix=True, prefix='scalar_', revert_sf_types=False, scales=None, **config)

Save the point cloud data to a LAS/LAZ file.

Parameters:
  • pcd (PointCloudData) – Point cloud object

  • path (str | Path) – Path to save the LAS/LAZ file to. File extension must be “.las” or “.laz”.

  • scalar_fields (list[str], default=None) – List of specific scalar fields to extract from the PLY file. Setting None will retrieve all scalar fields. Setting to [] will ignore scalar fields in the file.

  • add_prefix (bool, default=False) – Flag to add prefixes on scalar field names

  • prefix (str, default="scalar_") – Prefix to strip from scalar field names if remove_prefix is True.

  • revert_sf_types (bool, default=False) – Flag to revert scalar field values to their original types or not

  • scales (Vector_3_T | None, default=None) – Scaling factors for (x,y,z). Relates to data precision and reducing memory footprint in file. Defaults to [0.0001, 0.0001, 0.0001] when None.

  • config (dict[str, Any])

Return type:

None