Hex Addressing
The AfriHex H3 grid - convert coordinates to human-readable hex codes (AF-GH-7-XXXX) and back, navigate the grid, and render hex map tiles.
Convert coordinates to hex code
Converts lat/lng coordinates to a human-readable hex code (e.g., `AF-GH-7-A3K9`).
Resolve hex code to location
Returns the full location details for a hex code.
Get child cells (zoom in)
Returns the ~7 child cells at the next finer resolution.
Get 6 adjacent cells
Returns the 6 neighboring hex cells at the same resolution.
Get all cells within k hops (kRing / grid disk)
Returns all hex cells within k hops of the origin cell. This is the H3
Get cell as GeoJSON polygon
Returns the hex cell boundary as a GeoJSON Feature for map overlays.
Batch convert coordinates to hex codes
Converts up to 1,000 coordinate pairs to hex codes in a single request.
GPS code to hex code
Resolves a GhanaPostGPS code via the V1 lookup flow, then computes the hex code
Hex code to GPS code
Decodes a hex code to coordinates, then reverse geocodes to find the nearest
Hex cells in viewport
Returns all hex cells within a bounding box as a GeoJSON FeatureCollection.
Get parent cell at a coarser resolution
Get parent cell at a coarser resolution
Grid distance between two hex cells
Returns the minimum number of hex grid hops between two cells. Both must be at the same resolution.
Shortest grid path between two hex cells
Returns all cells along the shortest path (inclusive of endpoints). Both cells must be at the same resolution. Maximum 1,000 cells.
Compact a set of hex cells
Replaces complete sets of child cells with their parent cell. All input cells must be at the same resolution. Maximum 10,000 cells.