8 unstable releases (3 breaking)

0.4.2 Sep 14, 2023
0.4.1 Sep 5, 2023
0.4.0 Aug 25, 2023
0.3.1 Aug 23, 2023
0.1.1 Aug 16, 2023

#33 in Geospatial

Download history 31/week @ 2023-08-15 96/week @ 2023-08-22 14/week @ 2023-08-29 16/week @ 2023-09-05 33/week @ 2023-09-12 12/week @ 2023-09-19

75 downloads per month

MIT license

18KB
208 lines

E57 to LAS conversion

Crates.io No Unsafe Documentation License: MIT Dependencies

A utility to convert E57 point cloud files to LAS format. It is based on the E57 crate and the LAS crate.

About

e57_to_las is an open-source tool designed to convert point cloud files in the E57 format to the LAS format. The conversion retains all the relevant point data and associated metadata, making it easier for users to work with point cloud data in environments that primarily support LAS. We use is to convert E57 files to LAS for use in Potree for web-based point cloud visualization.

Features

  • Parallel processing using rayon for faster conversion.
  • Error handling to ensure corrupted or unsupported files do not halt the process.
  • Optional generation of station files (stations.json), containing spatial coordinates of station points. This is activated by enabling the stations feature flag, and the station points are calculated based on the transformation translations of the point clouds.

Usage

e57_to_las [OPTIONS]

To use this as a crate in your own project, add the following to your Cargo.toml:

[dependencies]
e57-to-las = "0.3.0"

You can then use it in your code as follows:

use e57_to_las::convert_file;

fn main() {
    let input_path = String::from("path/to/input.e57");
    let output_path = String::from("path/to/output/directory");
    let number_of_threads = 0; // 0 = max possible
    convert_file(input_path, output_path, number_of_threads);
}

Options

  • -p, --path <path>: The path to the input E57 file.
  • -o, --output <output>: The output directory for the converted LAS files (default: ./).
  • -T, --threads <threads>: Number of threads for parallel processing (default: 0 = max possible).

How It Works

  1. Reads the provided E57 file.
  2. Loops through the point clouds in the E57 file in parallel.
  3. For each point cloud, it writes the points to a corresponding LAS file.
  4. Optionally, after processing all point clouds, it calculates and writes the station points to stations.json in the output directory (only if stations feature is enabled).

Contribution

If you'd like to contribute to the development of this tool, please create an issue or pull request on our GitHub repository. All contributions are welcome!

Dependencies

Here are some of the main dependencies used:

  • rayon: Parallelism
  • clap: Command-line argument parsing
  • e57: E57 file format reader
  • las: LAS file format writer
  • uuid: For GUID processing
  • serde: For serialization and deserialization of data

License

Open-source MIT. See LICENSE for details.

Dependencies

~5.5MB
~101K SLoC