Spatial indexing
H3 cells, geohashes, map tiles, and Plus Codes.
Not yet independently reviewed by a GIS professional.
Spatial indexes turn a location into a short key you can store, join, and search. This section covers H3 hexagons, S2 cells, geohashes, Plus Codes, and web map tiles, and converts one place between them. Developers and GIS analysts use them to bucket points, join datasets by cell, and plan map caches. If you are not sure which system fits, start with the cross-index tool, which shows one place in each at a matched cell size. Pitfall: every key names an area, not a point, and its size depends on the resolution you choose.
No tools here match . or .
Convert
See allMoving between indexing systems: one place in each, at resolutions chosen to match a cell size.
- One place in every index, at a matched cell size
A point written as an H3 cell, an S2 cell, a geohash, a Plus Code, a map tile, a Maidenhead locator, and an MGRS reference, each at the resolution whose cell is closest to the size you name, with the size it actually has there.
Geohash
See allGeohash encoding, decoding, and neighbors.
- Geohashes covering an area
Every geohash at a precision that touches a bounding box or polygon, or only those whose centers fall inside, for indexing or querying an area.
- Geohash decoder
The center, bounding box, and error margins of a geohash.
- Geohash encoder
The geohash for a latitude and longitude at precision 1 to 12, with the cell's size and bounds.
- Geohash neighbors
The 8 geohash cells around a geohash, wrapping across the antimeridian; past a pole there is no neighbor.
H3
See allUber's H3 hexagonal grid.
- H3 cell inspector
Everything about an H3 cell: center (cellToLatLng), boundary (cellToBoundary), resolution, base cell, pentagon and Class III checks, area, and decimal form.
- H3 local IJ for a cell (cellToLocalIj)
The local IJ coordinates of a cell as seen from an origin cell: two whole numbers on the grid H3 unfolds around that origin.
- H3 cell set outline (cellsToMultiPolygon)
The outline of a set of H3 cells: the boundary between the set and everything outside it, as polygons with their holes, in GeoJSON.
- H3 children cells
The finer H3 cells inside a cell (cellToChildren), their count, and the center child.
- H3 compact
Replaces every complete group of 7 sibling cells with their parent, repeatedly, for the smallest set covering the same area (compactCells).
- H3 edges and vertexes
The directed edges (with lengths and neighbors) and vertexes of an H3 cell (originToDirectedEdges, cellToVertexes).
- H3 grid disk (k-ring)
All H3 cells within k steps of a cell (gridDisk); fewer than 3k(k+1)+1 when a pentagon is nearby.
- H3 grid path and distance
The grid distance between two H3 cells (gridDistance) and the line of cells joining them (gridPathCells).
- H3 grid ring
The H3 cells exactly k steps from a cell (gridRing), the hollow ring.
- H3 cell for a point
The H3 cell containing a latitude and longitude at resolution 0 to 15 (latLngToCell), with the cell's center and area.
- H3 cell at local IJ (localIjToCell)
The H3 cell at local IJ coordinates around an origin cell, undoing cellToLocalIj.
- H3 parent cell
The coarser H3 cell that contains a cell (cellToParent), and the cell's position among that parent's children.
- H3 polygon fill (polygonToCells)
The H3 cells that fill a polygon (with holes, across the antimeridian) at a resolution, by an explicit containment mode: cell centers inside, whole cells inside, or any overlap.
- H3 resolution chooser
The H3 resolution whose average cell is closest to a target area or edge length, with the full resolution table (122 base cells, 12 pentagons at each resolution).
- H3 uncompact
Expands a mixed-resolution set of H3 cells to one resolution (uncompactCells).
Plus Code
See allOpen Location Codes (Plus Codes).
- Plus Code decoder
The center and area of a Plus Code; a short code needs a nearby reference point to recover the full code.
- Plus Code encoder
The Plus Code (Open Location Code) for a latitude and longitude at code length 2 to 15, with the area it covers.
- Shorten a Plus Code
The shortest form of a full Plus Code that still recovers uniquely near a reference point (such as the nearest town).
S2
See allS2 cells: a point to a cell id or token at any level, what a cell covers, and the cells across its edges.
- S2 cell details
Everything about an S2 cell: its center, its four corners, the face and level, its exact area against the average for that level, and its parent and children.
- S2 cells covering a region
The S2 cells that cover a latitude and longitude rectangle, or a circle around a point, within a level range and a cell budget.
- S2 cell for a point
The S2 cell containing a latitude and longitude at a level from 0 to 30, with its token, its 64-bit id, the face it sits on, and its area.
- S2 edge neighbours
The four cells across an S2 cell's edges, at the same level, wrapping onto the next cube face where the cell lies on a face edge.
Tile
See allWeb map tiles and ground resolution.
- Map tile bounds
The latitude and longitude bounds of a z/x/y tile or quadkey, with its XYZ, TMS, and quadkey forms; detect mode shows both y conventions.
- Map tiles covering a box
Every z/x/y tile at a zoom that touches a latitude and longitude box, across the antimeridian when west is greater than east, for pre-caching or download planning.
- Map tile parent and children
The parent tile one zoom out and the four children one zoom in of a z/x/y tile or quadkey, in XYZ or TMS numbering.
- Map tile for a point (XYZ, TMS, quadkey)
The web map tile containing a point at a zoom: XYZ, TMS, and quadkey, with the ground resolution.
- Map ground resolution and scale
Meters per pixel and map scale for a Web Mercator zoom level at a latitude, for 256 or 512 pixel tiles.