geoprimsField-grade geospatial math

Convert a cell from one index system to another

Reads a geohash, H3, S2, Plus Code, or map-tile reference and re-expresses that place in another of those systems, at the resolution whose cell size is closest to the source cell's.

Experimental: not yet fully verified. How results are checked

8a2a10728937fff

That place is 8a2a10728937fff in the target system (resolution 10).

Target resolution
Target cell size
Source cell size
Provenance
Computed by
indexing.convert.to-index 1.0.0, core 0.1.0
Model
Decode the source reference to its cell center and cell size, then encode that center in the target system at the resolution whose cell size is closest to the source's by ratio (log distance); cell size is the side of a square of the same area at this latitude
Accuracy
Exact encodings. The conversion routes through the source cell's center, so it is exact for the center and nearest-resolution for the size, never an exact tiling between systems.
Notes
1 shown with the answer
Cites
Uber Technologies and the H3 contributors, H3: A Hexagonal Hierarchical Geospatial Indexing System (API reference v4); Niemeyer, G., geohash.org, Geohash (public domain algorithm); Google, open-location-code project, Open Location Code: Specification; OpenStreetMap Wiki, Slippy map tilenames

Something look off?

Your values

Showing an example. Change anything.
Run many at once from a CSV

Loading…

How we got thisFormula, worked example, sources, and proof

Model: Decode the source reference to its cell center and cell size, then encode that center in the target system at the resolution whose cell size is closest to the source's by ratio (log distance); cell size is the side of a square of the same area at this latitude

Accuracy: Exact encodings. The conversion routes through the source cell's center, so it is exact for the center and nearest-resolution for the size, never an exact tiling between systems.

When to use this: Use this to join data keyed by one spatial index to data keyed by another: a geohash to the H3 cell that covers the same place, an S2 token to a map tile, a Plus Code to a geohash. Give the source reference, say which system it is in, and choose the target system; the result is the target cell nearest the source cell's size.

Limitations: No two of these systems tile the ground the same way, so the result is the nearest resolution, not an equivalent, and the two cell sizes can differ by tens of percent. The conversion uses the source cell's center, so a target cell may not fully contain the source cell near a boundary. Reversing the conversion need not return the original reference.

Worked example: A geohash to its H3 cell. Source: add-spatial-indexing-and-raster hierarchical-cells: decode then encode at matched size. It is golden test vector v001, and every build checks the tool still gives its answer within its tolerance.

You enter

Source system
geohash
Source reference
dr5regw
Target system
h3

You get

Target reference
8a2a10728937fff
Target resolution
resolution 10
Target cell size
122.7 m
Source cell size
133 m

Review: Not yet independently reviewed by a GIS professional.

Last verified: 2026-09-18, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.

Status: version 1.0.0, core 0.1.0. See this tool in the verification report.

Checked against: 7 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.

Sources

Experimental means this tool has not yet met the stable bar: at least 20 golden vectors, differential tests, and an independent worked example.