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

Function decode_center

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

Source from the content-addressed store, hash-verified

334
335 #[test]
336 fn decode_center() {
337 // Encode a known point, then decode and verify roundtrip.
338 let hash = geohash_encode(13.405, 52.52, 9); // Berlin
339 let (lng, lat) = geohash_decode_center(&hash).unwrap();
340 assert!((lng - 13.405).abs() < 0.001, "lng: {lng}");
341 assert!((lat - 52.52).abs() < 0.001, "lat: {lat}");
342 }
343
344 #[test]
345 fn nearby_points_share_prefix() {

Callers

nothing calls this directly

Calls 2

geohash_encodeFunction · 0.85
geohash_decode_centerFunction · 0.85

Tested by

no test coverage detected