diff --git a/geo/src/algorithm/relate/geomgraph/geometry_graph.rs b/geo/src/algorithm/relate/geomgraph/geometry_graph.rs index 53845da95..35bbf4076 100644 --- a/geo/src/algorithm/relate/geomgraph/geometry_graph.rs +++ b/geo/src/algorithm/relate/geomgraph/geometry_graph.rs @@ -72,7 +72,6 @@ where } fn build_tree(&self) -> RTree> { - println!("build tree"); let segments: Vec> = self .edges() .iter() diff --git a/geo/src/algorithm/relate/geomgraph/index/rstar_edge_set_intersector.rs b/geo/src/algorithm/relate/geomgraph/index/rstar_edge_set_intersector.rs index eed9986b5..8c767849a 100644 --- a/geo/src/algorithm/relate/geomgraph/index/rstar_edge_set_intersector.rs +++ b/geo/src/algorithm/relate/geomgraph/index/rstar_edge_set_intersector.rs @@ -26,8 +26,8 @@ where let edge_0 = &mut edges[segment_0.edge_idx]; segment_intersector.add_intersections_against_self( edge_0, - segment_0.edge_idx, - segment_1.edge_idx, + segment_0.segment_idx, + segment_1.segment_idx, ); } else { // XXX: use get_many_mut when available. @@ -42,9 +42,19 @@ where let edge_1 = &mut e1[mx - (mi + 1)]; if segment_0.edge_idx > segment_1.edge_idx { - segment_intersector.add_intersections(edge_1, mx, edge_0, mi); + segment_intersector.add_intersections( + edge_1, + segment_0.segment_idx, + edge_0, + segment_1.segment_idx, + ); } else { - segment_intersector.add_intersections(edge_0, mi, edge_1, mx); + segment_intersector.add_intersections( + edge_0, + segment_0.segment_idx, + edge_1, + segment_1.segment_idx, + ); } } } diff --git a/geo/src/algorithm/relate/geomgraph/index/simple_edge_set_intersector.rs b/geo/src/algorithm/relate/geomgraph/index/simple_edge_set_intersector.rs index c8524c0d3..c7ce3da46 100644 --- a/geo/src/algorithm/relate/geomgraph/index/simple_edge_set_intersector.rs +++ b/geo/src/algorithm/relate/geomgraph/index/simple_edge_set_intersector.rs @@ -50,11 +50,10 @@ impl EdgeSetIntersector for SimpleEdgeSetIntersector { segment_intersector: &mut SegmentIntersector, ) { 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); + debug_assert_eq!(edge0.len(), 1); let edge0 = &mut edge0[0]; if check_for_self_intersecting_edges { @@ -63,12 +62,8 @@ impl EdgeSetIntersector 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>(