Geohash Encoder

Encode a latitude/longitude pair into a geohash string of the requested base32 length.

Description

Encode latitude and longitude into a base32 geohash at a selected character precision.

Geohash Encoder encode latitude and longitude into a base32 geohash at a selected character precision.

Use this for compact location keys, coarse spatial grouping, cache keys, and examples of hierarchical grid indexing.

When to use Geohash Encoder

Use this for compact location keys, coarse spatial grouping, cache keys, and examples of hierarchical grid indexing.

How it works

The algorithm alternately bisects longitude and latitude ranges, packs comparison bits five at a time, and maps each group to the geohash base32 alphabet.

Interpreting the result

Keep the input units, direction conventions, encoding, and ordering rules visible when reusing the result. Preserve the full returned value for downstream calculations and round only for presentation.

Assumptions and limitations

A geohash denotes a cell rather than preserving the exact point. Prefix proximity is useful but not a complete distance measure, especially across cell boundaries.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies