Function geohash::neighbor

source ·
pub fn neighbor(
    hash_str: &str,
    direction: Direction
) -> Result<String, GeohashError>
Expand description

Find neighboring geohashes for the given geohash and direction.

§Examples

let geohash_str = "9q60y60rhs";

let neighbor = geohash::neighbor(geohash_str, Direction::N).expect("Invalid hash string");

assert_eq!(neighbor, "9q60y60rht".to_owned());