pylas.lasdatas module¶
-
class
pylas.lasdatas.base.
LasBase
(*, header, vlrs=None, points=None)[source]¶ Bases:
object
LasBase is the base of all the different LasData classes. These classes are objects that the user will interact with to manipulate las data.
It connects the point record, header, vlrs together.
To access points dimensions using this class you have two possibilities
las = pylas.read('some_file.las') las.classification # or las['classification']
Note
using las[‘dimension_name’] is not possible with the scaled values of x, y, z
-
add_extra_dim
(name, type, description='')[source]¶ Adds a new extra dimension to the point record
Parameters:
-
point_format
¶
-
points
¶ returns the numpy array representing the points
Returns: Return type: the Numpy structured array of points
-
write
(destination, do_compress=None)[source]¶ Writes to a stream or file
When destination is a string, it will be interpreted as the path were the file should be written to, also if do_compress is None, the compression will be guessed from the file extension:
- .laz -> compressed
- .las -> uncompressed
Note
- This means that you could do something like:
# Create .laz but not compressed
las.write(‘out.laz’, do_compress=False)
# Create .las but compressed
las.write(‘out.las’, do_compress=True)
While it should not confuse Las/Laz readers, it will confuse humans so avoid doing it
Parameters:
-
write_to
(out_stream, do_compress=False)[source]¶ writes the data to a stream
Parameters: - out_stream (file object) – the destination stream, implementing the write method
- do_compress (bool, optional, default False) – Flag to indicate if you want the date to be compressed
-
x
¶ Returns the scaled x positions of the points as doubles
-
y
¶ Returns the scaled y positions of the points as doubles
-
z
¶ Returns the scaled z positions of the points as doubles
-