decode

Function decode 

Source
pub fn decode(geohash: String) -> GPSBoundInfo
Expand description

For each 5-bit chunk of the geohash, we calculate the midpoint of the current bound and then split the bound into two halves based on the value of the 5-bit chunk

Arguments:

  • geohash: The geohash string to decode.

Returns:

A GPSBoundInfo struct

Panics:

Panics when geohash String is invalid

ยงExamples

use geohash_rs;
let gps_bounds = geohash_rs::decode(String::from("wydm9qyc"));

assert_eq!(gps_bounds.latitude[0], 37.56654739379883);
assert_eq!(gps_bounds.latitude[1], 37.56671905517578);
assert_eq!(gps_bounds.longitude[0], 126.97826385498047);
assert_eq!(gps_bounds.longitude[1], 126.97860717773438);