H3 grid path and distance
The grid distance between two cells (gridDistance) and the line of cells joining them (gridPathCells).
The cells are 2 steps apart.
| Cell |
|---|
| 892a8471487ffff |
| 892a8471483ffff |
| 892a847148bffff |
Provenance
- Computed by
- indexing.h3.grid-path 1.0.0, core 0.1.0
- Model
- H3 v4 local IJ coordinates (h3o 0.11)
- Accuracy
- Identical to H3 C; fails where H3 C fails (across pentagon distortion or very far apart)
- Notes
- None
- Cites
- Uber Technologies and the H3 contributors, H3: A Hexagonal Hierarchical Geospatial Indexing System (API reference v4); Hydronium Labs, h3o: a Rust implementation of H3
Something look off?
How we got thisFormula, worked example, sources, and proof
Model: H3 v4 local IJ coordinates (h3o 0.11)
Accuracy: Identical to H3 C; fails where H3 C fails (across pentagon distortion or very far apart)
When to use this: Use this to measure separation in cells rather than meters, and to draw the line of cells between two of them: the grid distance and the path, which is how movement, corridors, and step counts are expressed on an H3 grid. It is also how a corridor is built on the grid: the path's cells, widened by a ring or two, give a band between two places without any geometry work.
Limitations: Grid distance is a count of steps, not a distance on the ground, and the two only track each other within a resolution. Near the pentagons the path can fail to exist, which the result reports with the reason rather than returning a line that is not one. Both cells must be at the same resolution. The path is a grid line, not a route: it ignores terrain, roads, and obstacles, and between distant cells it can be long and is not guaranteed to exist.
Worked example: Across Pittsburgh at resolution 9. Source: H3 gridPathCells.
You enter
- From cell
- 892a8471487ffff
- To cell
- 892a847148bffff
You get
- Grid distance
- 2
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.
Changes
- 2026-09-19, changed: Eight more H3 tools are stable: the cell inspector, grid ring, grid path, parent, children, compact, uncompact, and edges. On 300 cells at every resolution, one in eight a pentagon, they match H3 C exactly, including every path H3 C refuses; cell areas agree to 2e-8 relative even at resolution 15. Results are unchanged. Changelog
Checked against: 20 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.
Sources
- H3: A Hexagonal Hierarchical Geospatial Indexing System (API reference v4), Uber Technologies and the H3 contributors, H3 4.x documentation. Indexing, inspection, traversal, hierarchy, directed edges, vertexes, and resolution tables. Read free.
- h3o: a Rust implementation of H3, Hydronium Labs, 0.11.0 (tested against H3 C). CellIndex, LatLng, Resolution. Read free.
Terms
- H3: H3 hexagonal hierarchical index
- A global grid of hexagons (and 12 pentagons) at 16 resolutions, each cell about one-seventh the area of its parent, named by a 15-character index. Source: H3 hexagonal index
H3 — H3 hexagonal hierarchical index
A global grid of hexagons (and 12 pentagons) at 16 resolutions, each cell about one-seventh the area of its parent, named by a 15-character index.
Source: H3 hexagonal index