pylas.lasreader module

LasReader

class pylas.lasreader.LasReader(source: BinaryIO, closefd: bool = True, laz_backend: Union[pylas.compression.LazBackend, Iterable[pylas.compression.LazBackend], None] = None)[source]

Bases: object

The reader class handles LAS and LAZ via one of the supported backend

read_points(n: int) → Optional[pylas.point.record.ScaleAwarePointRecord][source]

Read n points from the file

If there are no points left to read, returns None.

Parameters:n (The number of points to read) – if n is less than 0, this function will read the remaining points
read() → pylas.lasdata.LasData[source]

Reads all the points not read and returns a LasData object

chunk_iterator(points_per_iteration: int) → pylas.lasreader.PointChunkIterator[source]

Returns an iterator, that will read points by chunks of the requested size

Parameters:points_per_iteration – number of points to be read with each iteration
Returns:
close() → None[source]

closes the file object used by the reader