pylas.point.record module¶
Contains the classes that manages Las PointRecords Las PointRecords are represented using Numpy’s structured arrays, The PointRecord classes provide a few extra things to manage these arrays in the context of Las point data
-
class
pylas.point.record.
IPointRecord
[source]¶ Bases:
abc.ABC
Wraps the numpy structured array contained the points data
-
actual_point_size
¶ Shall return the actual size in bytes that ta points take in memory
-
point_size
¶ Shall return the point size as that will be written in the header
-
-
class
pylas.point.record.
PackedPointRecord
(data, point_format=None)[source]¶ Bases:
pylas.point.record.PointRecord
In the PackedPointRecord, fields that are a combinations of many sub-fields (fields stored on less than a byte) are still packed together and are only de-packed and re-packed when accessed.
This uses of less memory than if the sub-fields were unpacked However some operations on sub-fields require extra steps:
>>> #return number is a sub-field >>> from pylas import PointFormat >>> packed_point_record = PackedPointRecord.zeros(PointFormat(0), 10) >>> packed_point_record['return_number'][:] = 1 >>> np.alltrue(packed_point_record == 1) False
>>> packed_point_record = PackedPointRecord.zeros(PointFormat(0), 10) >>> rn = packed_point_record['return_number'] >>> rn[:] = 1 >>> packed_point_record['return_number'] = rn >>> np.alltrue(packed_point_record['return_number'] == 1) True
-
all_dimensions_names
¶ Returns all the dimensions names, including the names of sub_fields and their corresponding packed fields
-
classmethod
empty
(point_format)[source]¶ Creates an empty point record.
Parameters: point_format (pylas.PointFormat) – The point format id the point record should have Returns: Return type: PackedPointRecord
-
classmethod
from_stream
(stream, point_format, count)[source]¶ Construct the point record by reading the points from the stream
-
point_size
¶ Returns the point size in bytes taken by each points of the record
Returns: The point size in byte Return type: int
-
-
class
pylas.point.record.
PointRecord
(data, point_format: pylas.point.format.PointFormat)[source]¶ Bases:
pylas.point.record.IPointRecord
-
actual_point_size
¶ Returns the point size in bytes taken by each points of the record
Returns: The point size in byte Return type: int
-
copy_fields_from
(other_record)[source]¶ Tries to copy the values of the current dimensions from other_record
-
dimensions_names
¶
-
extra_dimensions_names
¶ Returns the names of extra-dimensions contained in the PointRecord
-
-
class
pylas.point.record.
UnpackedPointRecord
(data, point_fmt_id=None)[source]¶ Bases:
pylas.point.record.PointRecord
In the Unpacked Point Record, all the sub-fields are un-packed meaning that they are in their own array. Because the minimum size for the elements of an array is 8 bits, and sub-fields are only a few bits (less than 8) the resulting unpacked array uses more memory, especially if the point format has lots of sub-fields
-
point_size
¶ Shall return the point size as that will be written in the header
-