Expand description

geohash-tools

geohash-tools is a collection of functions for manipulating GeoHashes in Rust.
You can find more about geohash algorithm on Wikipedia.

Constants

Length of rune of possible GeoHash characters -1 to represent the largest index in the rune.
Length of rune of possible GeoHash characters.

Statics

Number of possible GeoHashes for a given precision. All common ranges (0 through 12) are calculated at compile time and can be accessed by using the precision as the index.
Rune of possible GeoHash characters. Values (char) are mapped to their relative index (usize) in the rune.
Rune of possible GeoHash characters. Relative indexes (static str) in the rune are mapped to their values (char).

Functions

Calculate the number of possible GeoHashes for a given precision.
Convert a GeoHash to an int.
The int range is based on the number of possible combinations of characters from the GeoHash rune.
Convert a the previous generated GeoHash int, the geohash_id, back to the GeoHash.
The precision that was used at the time of encoding is needed to correctly convert back to the original GeoHash.