MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / build_join_index

Function build_join_index

nodedb-spatial/src/spatial_join.rs:92–101  ·  view source on GitHub ↗

Build an R-tree from a list of (entry_id, geometry) pairs for join.

(entries: &[(u64, Geometry)])

Source from the content-addressed store, hash-verified

90
91/// Build an R-tree from a list of (entry_id, geometry) pairs for join.
92pub 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)]

Callers 3

join_overlapping_squaresFunction · 0.85
join_no_overlapFunction · 0.85
join_with_dwithinFunction · 0.85

Calls 4

geometry_bboxFunction · 0.85
bulk_loadFunction · 0.85
collectMethod · 0.80
iterMethod · 0.45

Tested by 3

join_overlapping_squaresFunction · 0.68
join_no_overlapFunction · 0.68
join_with_dwithinFunction · 0.68