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.
Add an examples section to the documentation
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
================== | ||
Examples | ||
================== | ||
|
||
|
||
Filtering | ||
--------- | ||
|
||
This example shows how you can extract points from a file and write them into a new one. | ||
We use the classification field to filter points, but this can work with the other fields. | ||
|
||
.. code-block:: python | ||
import pylas | ||
las = pylas.read('pylastests/simple.las') | ||
new_file = pylas.create() | ||
new_file.points = las.points[las.classification == 1] | ||
new_file.write('extracted_points.las') | ||
Creating from scratch | ||
--------------------- | ||
|
||
This example shows how you can create a new LAS file from scratch. | ||
|
||
.. code-block:: python | ||
import pylas | ||
import numpy as np | ||
las = pylas.create() | ||
array = np.linspace(0.0, 15.0, 10000) | ||
las.x = array | ||
las.y = array | ||
las.z = array | ||
las.write('diagonal.las') | ||
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 |
---|---|---|
|
@@ -49,6 +49,7 @@ User Guide | |
intro | ||
installation | ||
basic | ||
examples | ||
|
||
API Documentation | ||
================= | ||
|
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