Point cloud writer to las file.
Project description
jaklas
jaklas is a thin wrapper around pylas
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
git clone git@github.com:jakarto3d/jaklas.git
cd jaklas
python -m pip install .
Testing
pip install -r requirements-dev.txt
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 pylas
):
- 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.
Project details
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
File details
Details for the file jaklas-0.3.2.tar.gz
.
File metadata
- Download URL: jaklas-0.3.2.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13ecb9a5dc1b8aefd8004619a4ee1c540f3fd00a76930627c7ea295c628eb05f |
|
MD5 | b07ff7caa59ca4ff6ef6f514d3ef69bd |
|
BLAKE2b-256 | 184946754a26c7725f6cece40db519c2ce529ddb4ad21bd8f8c83267e0d770db |
File details
Details for the file jaklas-0.3.2-py3-none-any.whl
.
File metadata
- Download URL: jaklas-0.3.2-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4ef2b51d8d2a93cc4355b6777901f2b5c6134fce814916c17448dc40f63e1d9 |
|
MD5 | a8ca3bf4717433f6923237d16a1460fe |
|
BLAKE2b-256 | c7a14a18c642f7c7b70f3c72705dc1a56836f501b0dd7032d120d177f8458c95 |