Note:
This library was originally created at Jakarto because we needed a single library to easily create las files from pandas arrays. We found using the old laspy api a bit unintuitive, so we created this wrapper. Since laspy 2.0.0, this has been greatly improved. Someone looking for the simplest way to read and write las files could find jaklas useful, but I would encourage reading laspy's documentation also.
jaklas
jaklas is a thin wrapper around laspy to make reading and writing las files as
simple as possible.
The main use case is to write a pandas array to a las file in a single function call. The las file attributes (point offset, point scaling, file version, point format, etc.) are inferred depending on column names, datatype and point values.
The las writer supports any object implementing __getitem__ that has the
correct field names.
Installation
pip install jaklas
Testing
git clone git@github.com:jakarto3d/jaklas.git
cd jaklas
pip install -r requirements-dev.txt
python -m pip install .
pytest
Usage
jaklas.write writes a pandas dataframe (or a dict) to a las file.
The dataframe must have either (case insensitive):
- 'x', 'y' and 'z' columns
- or an 'xyz' column
and it can have other las attributes (case sensitive names taken from laspy):
- gps_time
- intensity
- classification
- red
- green
- blue
- edge_of_flight_line
- key_point
- nir
- number_of_returns
- overlap
- point_source_id
- raw_classification
- return_number
- return_point_wave_location
- scan_angle
- scan_angle_rank
- scan_direction_flag
- scanner_channel
- synthetic
- user_data
- wavepacket_index
- wavepacket_offset
- wavepacket_size
- withheld
- x_t
- y_t
- z_t
other column names will be written as extra dimensions.
Example
import jaklas
import pandas
data = {
'gps_time': [0, 1.232, 2.543, 3.741],
'intensity': [14578, 54236, 1425, 12543],
'X': [456, 234, 567, 432],
'Y': [10234, 10256, 10789, 10275],
'Z': [10, 11, 12, 13],
}
dataframe = pandas.DataFrame(data)
filename = 'example.las'
jaklas.write(dataframe, filename)
Note the upper case 'X', 'Y' and 'Z' point data are the real coordinates, not the scaled int32 ones like in the las file.
See jaklas.write docstring for more options like controlling offset and scaling.
Metadata
Release files for jaklas 0.4.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jaklas-0.4.4.tar.gz | 8.2 kB | Without provenance | Details for jaklas-0.4.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jaklas-0.4.4-py3-none-any.whl | Python 3 | none | any | Details for jaklas-0.4.4-py3-none-any.whl |
Total release size: 16.5 kB
Release files / jaklas-0.4.4.tar.gz
| Download URL | jaklas-0.4.4.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
44180816b23e30aef8c027377cd7d2e0a4687f8d9e079e3d575ffa415b7bffaa
|
|
BLAKE2b-256 checksum How to use checksums |
3d823432417863e2123d0c09cac65d0df7ab30ab0d46cb358934f5eb7bb3a7af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Release files / jaklas-0.4.4-py3-none-any.whl
| Download URL | jaklas-0.4.4-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f22af52c1ea3d0c121b9adccd0bb5895b3a00a287219f91c9e258b90c6638ff
|
|
BLAKE2b-256 checksum How to use checksums |
495819726fb8327a1bb5250b2531c6f60828716b918b4587f9fb656ee7f79d46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Security for jaklas 0.4.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.