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

Method nearest

nodedb-spatial/src/rtree/tree.rs:73–82  ·  view source on GitHub ↗

Nearest-neighbor search using incremental distance ordering.

(&self, query_lng: f64, query_lat: f64, k: usize)

Source from the content-addressed store, hash-verified

71
72 /// Nearest-neighbor search using incremental distance ordering.
73 pub fn nearest(&self, query_lng: f64, query_lat: f64, k: usize) -> Vec<NnResult> {
74 super::search::nearest(
75 &self.nodes,
76 self.root,
77 query_lng,
78 query_lat,
79 k,
80 self.is_empty(),
81 )
82 }
83
84 /// Get all entries (for persistence serialization).
85 pub fn entries(&self) -> Vec<&RTreeEntry> {

Callers 1

nearest_neighborFunction · 0.80

Calls 2

nearestFunction · 0.85
is_emptyMethod · 0.45

Tested by 1

nearest_neighborFunction · 0.64