Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/laspy/laspy
Laspy is a pythonic interface for reading/modifying/creating .LAS LIDAR files matching specification 1.0-1.4.
https://github.com/laspy/laspy
copc las laz lidar point-cloud pointcloud python
Last synced: 1 day ago
JSON representation
Laspy is a pythonic interface for reading/modifying/creating .LAS LIDAR files matching specification 1.0-1.4.
- Host: GitHub
- URL: https://github.com/laspy/laspy
- Owner: laspy
- License: other
- Created: 2012-05-16T20:26:28.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T19:01:21.000Z (4 months ago)
- Last Synced: 2024-10-28T20:17:40.435Z (4 months ago)
- Topics: copc, las, laz, lidar, point-cloud, pointcloud, python
- Language: Python
- Homepage: https://laspy.readthedocs.io/en/latest/
- Size: 2.6 MB
- Stars: 458
- Watchers: 33
- Forks: 121
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: docs/contributing.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
# Laspy
Laspy is a python library for reading, modifying and creating LAS LiDAR
files.Laspy is compatible with Python 3.8+.
## Features
- LAS support.
- LAZ support via `lazrs` or `laszip` backend.
- LAS/LAZ streamed/chunked reading/writting.
- [COPC] support over files.
- [COPC] support over https with `requests` package.
- CRS support via `pyproj` package.[COPC]: https://github.com/copcio/copcio.github.io
## Examples
Directly read and write las
```Python
import laspylas = laspy.read('filename.las')
las.points = las.points[las.classification == 2]
las.write('ground.laz')
```Open data to inspect header (opening only reads the header and vlrs)
```Python
import laspywith laspy.open('filename.las') as f:
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)}")
```
Use the 'chunked' reading & writing features```Python
import laspywith laspy.open('big.laz') as input_las:
with laspy.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])```
Appending points to existing file
```Python
import laspywith laspy.open('big.laz') as input_las:
with laspy.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])
```API Documentation and tutorials are available at
[ReadTheDocs](https://laspy.readthedocs.io/en/latest/).## Installation
Laspy can be installed either with `pip`:
```
pip install laspy # without LAZ support
# Or
pip install laspy[laszip] # with LAZ support via LASzip
# Or
pip install laspy[lazrs] # with LAZ support via lazrs
```## Changelog
See [CHANGELOG.md](CHANGELOG.md)