Coder Social home page Coder Social logo

jaklas's Introduction

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 [email protected]: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.

jaklas's People

Contributors

davidcaron avatar x-malet avatar tofull avatar arnaudvenet42 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.