Decode a geohash to its center point (longitude, latitude).
(hash: &str)
| 146 | |
| 147 | /// Decode a geohash to its center point (longitude, latitude). |
| 148 | pub fn geohash_decode_center(hash: &str) -> Option<(f64, f64)> { |
| 149 | geohash_decode(hash).map(|bb| { |
| 150 | ( |
| 151 | (bb.min_lng + bb.max_lng) / 2.0, |
| 152 | (bb.min_lat + bb.max_lat) / 2.0, |
| 153 | ) |
| 154 | }) |
| 155 | } |
| 156 | |
| 157 | /// Direction for neighbor computation. |
| 158 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |