Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rust geometry transform tool #118

Merged
merged 2 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ path = "tools/dla/main.rs"
name = "point-cloud"
path = "tools/point-cloud/main.rs"

[[bin]]
name = "transform"
path = "tools/transform/main.rs"

[dependencies]
clap = {version="4.0", features=["derive"]}
hex = "0.4"
geo = "0.23"
kdtree = "0.6"
log = "0.4"
petgraph = "0.6"
rand = "0.8"
rand_distr = "0.4"
stderrlog = "0.5"
clap = {version="4.0", features=["derive"]}
wkb = "0.7"
wkt = "0.10"
1 change: 1 addition & 0 deletions generative/lib.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pub mod dla;
pub mod stdio;
pub mod wkio;
8 changes: 4 additions & 4 deletions generative/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use std::fs::File;
use std::io::{BufReader, BufWriter, Read, Write};
use std::path::PathBuf;

pub fn get_output_writer(output: Option<PathBuf>) -> Result<BufWriter<Box<dyn Write>>, String> {
pub fn get_output_writer(output: &Option<PathBuf>) -> Result<BufWriter<Box<dyn Write>>, String> {
match output {
Some(path) => match File::create(&path) {
Some(path) => match File::create(path) {
Err(why) => Err(format!(
"Couldn't create: '{}' because: '{}'",
path.display(),
Expand All @@ -16,9 +16,9 @@ pub fn get_output_writer(output: Option<PathBuf>) -> Result<BufWriter<Box<dyn Wr
}
}

pub fn get_input_reader(input: Option<PathBuf>) -> Result<BufReader<Box<dyn Read>>, String> {
pub fn get_input_reader(input: &Option<PathBuf>) -> Result<BufReader<Box<dyn Read>>, String> {
match input {
Some(path) => match File::open(&path) {
Some(path) => match File::open(path) {
Err(why) => Err(format!(
"Couldn't open: '{}' because: '{}'",
path.display(),
Expand Down
Loading