Native Python ASPRS LAS read/write library
Project description
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
lazrsorlaszipbackend. - LAS/LAZ streamed/chunked reading/writting.
- COPC support over files.
- COPC support over https with
requestspackage. - CRS support via
pyprojpackage.
Examples
Directly read and write las
import laspy
las = 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)
import laspy
with 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
import laspy
with 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
import laspy
with 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.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file laspy-2.7.0.tar.gz.
File metadata
- Download URL: laspy-2.7.0.tar.gz
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f56feb5445e75d6ff12ee814aab6a35339290e75264ff277c6bf553f3025a3f5
|
|
| MD5 |
e3a00963f0ae82cf0b858a14953b1449
|
|
| BLAKE2b-256 |
9c5d5a540ac25dcc57fa77691363bb753363b192a3759aefef4b40e1250ddb17
|
File details
Details for the file laspy-2.7.0-py3-none-any.whl.
File metadata
- Download URL: laspy-2.7.0-py3-none-any.whl
- Upload date:
- Size: 86.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15f5344c62a1023461996bdf5d1ba5fdd813e96694a524fee712931134f3792f
|
|
| MD5 |
7e54e24a749f424eb80a18d6de71f24d
|
|
| BLAKE2b-256 |
edfbae27ebca327117e35cc717a3a87afdcbbf10d5aac52e405d16ebe777357e
|