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

Function nearby_points_share_prefix

nodedb-spatial/src/geohash.rs:345–351  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

343
344 #[test]
345 fn nearby_points_share_prefix() {
346 // Two nearby points should have a common prefix.
347 let h1 = geohash_encode(-73.985, 40.758, 8);
348 let h2 = geohash_encode(-73.986, 40.759, 8);
349 // At least first 5 chars should match (nearby in NYC).
350 assert_eq!(&h1[..5], &h2[..5], "h1={h1}, h2={h2}");
351 }
352
353 #[test]
354 fn neighbor_north() {

Callers

nothing calls this directly

Calls 1

geohash_encodeFunction · 0.85

Tested by

no test coverage detected