This repository has been archived by the owner on Aug 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge the two Installation section Remove the old example and put new ones
- Loading branch information
Showing
1 changed file
with
53 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,93 @@ | ||
pylas | ||
----- | ||
|
||
Another way of reading LAS/LAZ in Python. | ||
Another way of reading point clouds in the LAS/LAZ in Python. | ||
|
||
.. image:: https://readthedocs.org/projects/pylas/badge/?version=latest | ||
:target: https://pylas.readthedocs.io/en/latest/?badge=latest | ||
:alt: Documentation Status | ||
|
||
|
||
.. image:: https://travis-ci.org/tmontaigu/pylas.svg?branch=master | ||
|
||
|
||
Example | ||
------- | ||
Examples | ||
-------- | ||
|
||
Directly read and write las | ||
|
||
.. code:: python | ||
import pylas | ||
# Directly read and write las | ||
las = pylas.read('filename.las') | ||
las = pylas.convert(las, point_format_id=2) | ||
las.write('converted.las') | ||
las.points = las.points[las.classification == 2] | ||
las.write('ground.laz') | ||
Open data to inspect header (opening only reads the header and vlrs) | ||
|
||
.. code:: python | ||
import pylas | ||
# Open data to inspect header and then read | ||
with pylas.open('filename.las') as f: | ||
if f.header.point_count < 10 ** 8: | ||
las = f.read() | ||
print(las.vlrs) | ||
print(f"Point format: {f.header.point_format}") | ||
print(f"Number of points: {f.header.point_count}") | ||
print(f"Number of vlrs: {len(f.header.vlrs)}") | ||
Documentation is hosted on ReadTheDocs_ . | ||
Use the 'chunked' reading & writing features | ||
|
||
.. _ReadTheDocs: http://pylas.readthedocs.io/en/latest/index.html | ||
.. code:: python | ||
import pylas | ||
Installation | ||
------------ | ||
with pylas.open('big.laz') as input_las: | ||
with pylas.open('ground.laz', mode="w", header=input_las.header) as ground_las: | ||
for points in input_las.chunk_iterator(2_000_000): | ||
ground_las.write_points(points[points.classification == 2]) | ||
See the Installation_ section of the documentation: | ||
Appending points to existing file | ||
|
||
.. code:: python | ||
import pylas | ||
with pylas.open('big.laz') as input_las: | ||
with pylas.open('ground.laz', mode="a") as ground_las: | ||
for points in input_las.chunk_iterator(2_000_000): | ||
ground_las.append_points(points[points.classification == 2]) | ||
Documentation | ||
------------- | ||
|
||
Documentation is hosted on ReadTheDocs_ . | ||
|
||
.. _ReadTheDocs: http://pylas.readthedocs.io/en/latest/index.html | ||
|
||
.. _Installation: https://pylas.readthedocs.io/en/latest/installation.html | ||
|
||
Dependencies & Requirements | ||
--------------------------- | ||
|
||
Supported CPython versions are: 3.6, 3.7, 3.8, 3.9 | ||
|
||
pylas supports LAS natively,to support LAZ it needs one of its supported backend to be installed: | ||
pylas supports LAS natively, to support LAZ it needs one of its supported backend to be installed: | ||
|
||
- lazrs | ||
- laszip | ||
- lazrs | ||
- laszip | ||
|
||
|
||
Installation | ||
------------ | ||
|
||
:: | ||
.. code-block:: shell | ||
pip install pylas | ||
pip install pylas # without LAZ support | ||
# Or | ||
pip install pylas[laszip] # without LAZ support via LASzip | ||
# Or | ||
pip install pylas[lazrs] # without LAZ support via lazrs | ||
See the Installation_ section of the documentation for details: | ||
|
||
.. _Installation: https://pylas.readthedocs.io/en/latest/installation.html | ||
|