Crate geohash_tools

Crate geohash_tools 

Source
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§

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

Statics§

GEOHASH_ID_RANGE
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_CHAR_INDEX
Rune of possible GeoHash characters. Values (char) are mapped to their relative index (usize) in the rune.
RUNE_INDEX_CHAR
Rune of possible GeoHash characters. Relative indexes (static str) in the rune are mapped to their values (char).

Functions§

geohash_id_range
Calculate the number of possible GeoHashes for a given precision.
geohash_to_int
Convert a GeoHash to an int.
The int range is based on the number of possible combinations of characters from the GeoHash rune.
int_to_geohash
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.