diff --git a/README.md b/README.md index e9b3aa2..32b5eb6 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ After installing Rust, download this repository. - `min`: Specify the minimum zoom level you want to output. - `max`: Specify the maximum zoom level you want to output. - `max-memory-mb`: Specify the number of MB of memory available for conversion. +- `quantize`: Perform quantization. - `--gzip-compress`: The output 3D Tiles are compressed using gzip. The file extension dose not change. In the repository root, the following commands can be executed. @@ -45,7 +46,8 @@ point_tiler --input app/examples/data/sample.las \ --output-epsg 4979 \ --min 15 \ --max 18 \ - --max-memory-mb 8192 \ + --max-memory-mb 8193 \ + --quantize \ --gzip-compress ``` diff --git a/app/src/main.rs b/app/src/main.rs index 026b395..b71e78e 100644 --- a/app/src/main.rs +++ b/app/src/main.rs @@ -23,6 +23,7 @@ use gzp::{ }; use itertools::Itertools as _; use log::LevelFilter; +use pcd_exporter::gltf::generate_glb; use pcd_parser::reader::csv::CsvPointReader; use pcd_parser::reader::las::LasPointReader; use pcd_parser::reader::PointReader; @@ -74,6 +75,9 @@ struct Cli { #[arg(long, default_value_t = 4 * 1024)] max_memory_mb: usize, + #[arg(long)] + quantize: bool, + #[arg(long)] gzip_compress: bool, } @@ -214,6 +218,7 @@ fn export_tiles_to_glb( output_path: &Path, min_zoom: u8, max_zoom: u8, + quantize: bool, gzip_compress: bool, ) -> std::io::Result> { let mut all_tiles = Vec::new(); @@ -258,7 +263,12 @@ fn export_tiles_to_glb( let glb_path = output_path.join(&tile_content.content_path); fs::create_dir_all(glb_path.parent().unwrap()).unwrap(); - let glb = generate_quantized_glb(decimated).unwrap(); + + let glb = if quantize { + generate_quantized_glb(decimated).unwrap() + } else { + generate_glb(decimated).unwrap() + }; if gzip_compress { let file = File::create(glb_path).unwrap(); @@ -372,6 +382,7 @@ fn main() { log::info!("min zoom: {}", args.min); log::info!("max zoom: {}", args.max); log::info!("max memory mb: {}", args.max_memory_mb); + log::info!("quantize: {}", args.quantize); log::info!("gzip compress: {}", args.gzip_compress); let start = std::time::Instant::now(); @@ -541,6 +552,7 @@ fn main() { &output_path, min_zoom, max_zoom, + args.quantize, args.gzip_compress, ) .unwrap();