Build an R-tree from a list of (entry_id, geometry) pairs for join.
(entries: &[(u64, Geometry)])
| 90 | |
| 91 | /// Build an R-tree from a list of (entry_id, geometry) pairs for join. |
| 92 | pub fn build_join_index(entries: &[(u64, Geometry)]) -> RTree { |
| 93 | let rtree_entries: Vec<RTreeEntry> = entries |
| 94 | .iter() |
| 95 | .map(|(id, geom)| RTreeEntry { |
| 96 | id: *id, |
| 97 | bbox: geometry_bbox(geom), |
| 98 | }) |
| 99 | .collect(); |
| 100 | RTree::bulk_load(rtree_entries) |
| 101 | } |
| 102 | |
| 103 | /// Which spatial predicate to use for the join. |
| 104 | #[derive(Debug, Clone, Copy)] |