Skip to main content

Point cloud writer to las file.

Project description

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.

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

jaklas-0.4.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

jaklas-0.4.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file jaklas-0.4.0.tar.gz.

File metadata

  • Download URL: jaklas-0.4.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.5

File hashes

Hashes for jaklas-0.4.0.tar.gz
Algorithm Hash digest
SHA256 996c744b6a7d3d6e9f948c20078b9c8b3c8e4edcc77b5b0d9b3a9708fe32ae78
MD5 766bcebd8fa6b8987d55057281419704
BLAKE2b-256 5b39ca6b2b51162b87aaa3c10e4d5a4f9586c8ee11393750b0b2f29f80ebf15c

See more details on using hashes here.

File details

Details for the file jaklas-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: jaklas-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.5

File hashes

Hashes for jaklas-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4f207fae994c7b6ebc46e78a35f16461ef46a06815c08e6ea5f181170408d06
MD5 815421fc90526fbd08af35a5452164d5
BLAKE2b-256 ce7e36407affc3c0d7b6f4770a8d9fbec149a92c58b7f07c7b30fc18afc21350

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page