Skip to content

Commit

Permalink
deps: bump e57rs
Browse files Browse the repository at this point in the history
  • Loading branch information
pnwatin committed Oct 27, 2023
1 parent 6217b09 commit 24463d3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ authors = ["pnodet <[email protected]>", "pnwa <[email protected]>"]
[dependencies]
anyhow = "1.0.75"
clap = { version = "4.4.5", features = ["derive"] }
e57 = "0.9.1"
e57 = "0.10.0"
serde_json = { version = "1.0.107" }
serde = { version = "1.0.188", features = ["derive"] }
las = "0.8.1"
Expand Down
11 changes: 7 additions & 4 deletions src/convert_pointcloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub fn convert_pointcloud(
)
.context("Unable to create path: ")?;

let mut writer = get_las_writer(&pointcloud.guid, path, max_cartesian)
let mut writer = get_las_writer(pointcloud.clone().guid, path, max_cartesian)
.context("Unable to create writer: ")?;

for p in las_points {
Expand Down Expand Up @@ -98,7 +98,6 @@ pub fn convert_pointcloud(
/// let output_path = String::from("path/to/output");
/// convert_pointclouds(e57_reader, output_path);
/// ```
pub fn convert_pointclouds(
e57_reader: E57Reader<BufReader<File>>,
output_path: &String,
Expand Down Expand Up @@ -155,8 +154,12 @@ pub fn convert_pointclouds(
)
.context("Unable to create path: ")?;

let mut writer = get_las_writer(guid, path, max_cartesian_mutex.lock().unwrap().to_owned())
.context("Unable to create writer: ")?;
let mut writer = get_las_writer(
Some(guid.to_owned()),
path,
max_cartesian_mutex.lock().unwrap().to_owned(),
)
.context("Unable to create writer: ")?;

for p in las_points_mutex.lock().unwrap().to_owned() {
writer.write(p).context("Unable to write: ")?;
Expand Down
5 changes: 3 additions & 2 deletions src/get_las_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn find_smallest_scale(x: f64) -> f64 {
}

pub(crate) fn get_las_writer(
guid: impl Into<String>,
guid: Option<String>,
output_path: PathBuf,
max_cartesian: f64,
) -> Result<las::Writer<BufWriter<File>>> {
Expand All @@ -34,7 +34,8 @@ pub(crate) fn get_las_writer(
y: transform,
z: transform,
};
builder.guid = Uuid::parse_str(&guid.into().replace("_", "-")).unwrap_or(Uuid::new_v4());
builder.guid = Uuid::parse_str(&guid.unwrap_or(Uuid::new_v4().to_string()).replace("_", "-"))
.unwrap_or(Uuid::new_v4());

let header = builder.into_header().context("Error encountered: ")?;

Expand Down

0 comments on commit 24463d3

Please sign in to comment.