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

Georust: Use pure rust libraries for shapes and geometries (RTree) #29

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
don't use prepared geoms
  • Loading branch information
gauteh committed Aug 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit d890564c7bea541f25eff56c2047605b3726299f
8 changes: 4 additions & 4 deletions src/shapes.rs
Original file line number Diff line number Diff line change
@@ -18,15 +18,15 @@ pub struct Gshhg {

#[derive(Clone)]
struct PolW {
p: PreparedGeometry<'static>,
p: Polygon,
e: AABB<Point<f64>>,
}

impl PolW {
pub fn from(p: Polygon) -> PolW {
PolW {
e: p.envelope(),
p: PreparedGeometry::from(p),
p: p,
}
}
}
@@ -51,8 +51,8 @@ impl PointDistance for PolW {
return false;
}

self.p.relate(point).is_covers()
// self.p.contains(point)
// self.p.relate(point).is_covers()
self.p.contains(point)
}

fn distance_2_if_less_or_equal(&self, _point: &Point<f64>, _max_distance: f64) -> Option<f64> {