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

GeometryGraph and PreparedGeometry multi-threaded (Send) #1198

Open
wants to merge 17 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
Next Next commit
some checks on self interctin
  • Loading branch information
gauteh authored and urschrei committed Oct 28, 2024
commit 067fa06357dc41497223894a57d7a1eaa888c59e
2 changes: 1 addition & 1 deletion geo/src/algorithm/relate/geomgraph/geometry_graph.rs
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ where
(self.tree.as_ref().unwrap(), edges)
}

fn update_tree(&mut self) {
pub(crate) fn update_tree(&mut self) {
if self.tree.is_none() {
self.tree = Some(self.build_tree());
}
Original file line number Diff line number Diff line change
@@ -158,6 +158,7 @@ mod conversions {
impl<'a, F: GeoFloat> From<GeometryCow<'a, F>> for PreparedGeometry<'a, F> {
fn from(geometry: GeometryCow<'a, F>) -> Self {
let mut geometry_graph = GeometryGraph::new(0, geometry);
geometry_graph.update_tree(); // TODO: maybe unecessary

// TODO: don't pass in line intersector here - in theory we'll want pluggable line intersectors
// and the type (Robust) shouldn't be hard coded here.
Original file line number Diff line number Diff line change
@@ -50,9 +50,11 @@ impl<F: GeoFloat> EdgeSetIntersector<F> for SimpleEdgeSetIntersector {
segment_intersector: &mut SegmentIntersector<F>,
) {
let edges = graph.edges_mut();
let mut checks = 0;
for i in 0..edges.len() {
let (e0, e1) = edges.split_at_mut(i + 1);
let (e0, edge0) = e0.split_at_mut(i);
assert_eq!(edge0.len(), 1);
let edge0 = &mut edge0[0];

if check_for_self_intersecting_edges {
@@ -61,8 +63,12 @@ impl<F: GeoFloat> EdgeSetIntersector<F> for SimpleEdgeSetIntersector {

for edge1 in e0.iter_mut().chain(e1) {
self.compute_intersects(edge0, edge1, segment_intersector);
checks += 1;
}
}

println!("checks: {}", checks);
assert_eq!(checks, edges.len()*edges.len());
}

fn compute_intersections_between_sets<'a>(