laspy.point.format module¶
- class laspy.point.format.ExtraBytesParams(name: str, type: Union[str, dtype, Type[uint8]], description: str = '', offsets: Optional[Iterable[Union[number, float, int]]] = None, scales: Optional[Iterable[Union[number, float, int]]] = None)[source]¶
Bases:
object
All parameters needed to create extra bytes
- name¶
The name of the extra dimension
- type¶
The type of the extra dimension
- description¶
A description of the extra dimension
- offsets¶
The offsets to use if its a ‘scaled dimension’, can be none
- scales¶
The scales to use if its a ‘scaled dimension’, can be none
- class laspy.point.format.PointFormat(point_format_id: int)[source]¶
Bases:
object
Class that contains the informations about the dimensions that forms a PointFormat.
A PointFormat has ‘standard’ dimensions (dimensions defined in the LAS standard, each point format has its set of dimensions), but it can also have extra (non-standard) dimensions defined by the user)
>>> fmt = PointFormat(3) >>> all(dim.is_standard for dim in fmt.dimensions) True >>> dim = fmt.dimension_by_name("classification") # or fmt["classification"] >>> dim.max 31 >>> dim.min 0 >>> dim.num_bits 5
- property standard_dimensions: Iterable[DimensionInfo]¶
Returns an iterable of the standard dimensions
>>> fmt = PointFormat(0) >>> standard_dims = list(fmt.standard_dimensions) >>> len(standard_dims) 15 >>> standard_dims[4].name 'return_number'
- property dimension_names: Iterable[str]¶
Returns the names of the dimensions contained in the point format
- property standard_dimension_names: Iterable[str]¶
Returns the names of the extra dimensions in this point format
- property extra_dimension_names: Iterable[str]¶
Returns the names of the extra dimensions in this point format
- property size: int¶
Returns the number of bytes (standard + extra) a point takes
>>> PointFormat(3).size 34
>>> fmt = PointFormat(3) >>> fmt.add_extra_dimension(ExtraBytesParams("codification", "uint64")) >>> fmt.size 42
- property num_standard_bytes: int¶
Returns the number of bytes used by standard dims
>>> fmt = PointFormat(3) >>> fmt.add_extra_dimension(ExtraBytesParams("codification", "uint64")) >>> fmt.num_standard_bytes 34
- property num_extra_bytes: int¶
Returns the number of extra bytes
>>> fmt = PointFormat(3) >>> fmt.add_extra_dimension(ExtraBytesParams("codification", "uint64")) >>> fmt.num_extra_bytes 8
- property has_waveform_packet¶
Returns True if the point format has waveform packet dimensions
- dimension_by_name(name: str) DimensionInfo [source]¶
Returns the dimension info for the dimension by name
ValueError is raised if the dimension does not exist un the point format
>>> info = PointFormat(2).dimension_by_name('number_of_returns') >>> info.name == 'number_of_returns' True >>> info.num_bits == 3 True
>>> info = PointFormat(2).dimension_by_name('gps_time') Traceback (most recent call last): ... ValueError: Dimension 'gps_time' does not exist
- add_extra_dimension(param: ExtraBytesParams) None [source]¶
Add an extra, user-defined dimension