Skip to content
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
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rdp"
version = "0.13.6"
version = "0.14.0"
authors = ["Stephan Hügel <urschrei@gmail.com>"]
description = "An FFI wrapper for the Ramer–Douglas–Peucker and Visvalingam-Whyatt algorithms"
readme = "README.md"
Expand All @@ -13,7 +13,7 @@ edition = "2021"

[dependencies]
libc = "0.2.174"
geo = "0.30.0"
geo = "0.31.0"
geo-types = "0.7.13"
num-traits = "0.2.19"

Expand Down
4 changes: 2 additions & 2 deletions benches/benches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn bench_rdp(c: &mut Criterion) {
let points = include!("../src/mk_route.rs");
let ls: LineString<f64> = points.into();
b.iter(|| {
ls.simplify(&0.001);
ls.simplify(0.001);
});
});
}
Expand All @@ -18,7 +18,7 @@ fn bench_rdp_idx(c: &mut Criterion) {
let points = include!("../src/mk_route.rs");
let ls: LineString<f64> = points.into();
b.iter(|| {
ls.simplify_idx(&0.001);
ls.simplify_idx(0.001);
});
});
}
Expand Down
11 changes: 5 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub extern "C" fn simplify_rdp_ffi(
precision: libc::c_double,
) -> InternalArray {
let ls: LineString<_> = coords.into();
ls.simplify(&precision).into()
ls.simplify(precision).into()
}

/// FFI wrapper for RDP, returning simplified geometry **indices**
Expand All @@ -163,7 +163,7 @@ pub extern "C" fn simplify_rdp_idx_ffi(
precision: libc::c_double,
) -> InternalArray {
let ls: LineString<_> = coords.into();
ls.simplify_idx(&precision).into()
ls.simplify_idx(precision).into()
}

/// FFI wrapper for Visvalingam-Whyatt, returning simplified geometry **coordinates**
Expand All @@ -187,7 +187,7 @@ pub extern "C" fn simplify_visvalingam_ffi(
precision: libc::c_double,
) -> InternalArray {
let ls: LineString<_> = coords.into();
ls.simplify_vw(&precision).into()
ls.simplify_vw(precision).into()
}

/// FFI wrapper for Visvalingam-Whyatt, returning simplified geometry **indices**
Expand All @@ -211,7 +211,7 @@ pub extern "C" fn simplify_visvalingam_idx_ffi(
precision: libc::c_double,
) -> InternalArray {
let ls: LineString<_> = coords.into();
ls.simplify_vw_idx(&precision).into()
ls.simplify_vw_idx(precision).into()
}

/// FFI wrapper for topology-preserving Visvalingam-Whyatt, returning simplified geometry **coordinates**.
Expand All @@ -235,7 +235,7 @@ pub extern "C" fn simplify_visvalingamp_ffi(
precision: libc::c_double,
) -> InternalArray {
let ls: LineString<_> = coords.into();
ls.simplify_vw_preserve(&precision).into()
ls.simplify_vw_preserve(precision).into()
}

/// Free memory which has been allocated across the FFI boundary by:
Expand Down Expand Up @@ -279,7 +279,6 @@ pub extern "C" fn drop_usize_array(arr: InternalArray) {
mod tests {
use super::*;


use geo::{LineString, Point};

use std::ptr;
Expand Down
Loading