H3 uses a hierarchical system where the world is divided into hexagonal cells at different resolutions, allowing for multi-resolution indexing.
- Resolution 0: The entire world is divided into 122 base hexagons.
- Higher resolutions (1-15): Each base hexagon is subdivided into smaller hexagons.
- Resolution 15: The smallest possible hexagons.
Each increase in resolution means:
- The hexagons get smaller.
- There are more hexagons covering the same area.
- The resolution number represents the granularity of the grid.
For example:
- Resolution 0: A single large hex covering a large portion of the Earth.
- Resolution 5: More hexagons dividing the same space.
- Resolution 10: Even smaller hexagons providing higher granularity.
- Every hexagon at a lower resolution can be subdivided into multiple child hexagons at a higher resolution.
- Each parent hexagon at resolution R contains 7 child hexagons at resolution R+1 (except for resolution 0, where it varies).
For example:
- A resolution 3 hexagon contains 7 resolution 4 hexagons inside it.
- A resolution 4 hexagon contains 7 resolution 5 hexagons, and so on.
This hierarchy allows:
- Efficient zooming in/out on geospatial data.
- Aggregation of data at different levels.
- A consistent spatial indexing system across different resolutions.
Let's take an example using San Francisco:
- At resolution 5, a hex might cover an entire neighborhood.
- At resolution 7, the same area is divided into smaller blocks.
- At resolution 10, you get individual buildings covered by hexagons.
Each hexagon at resolution R is subdivided into 7 child hexagons at resolution R+1 (except for the base resolution, which starts with 122 hexagons). This means there is a fixed, predictable relationship between resolutions.
- Resolution 0: The world is divided into 122 base hexagons.
- Resolution 1: Each of those 122 base hexagons is divided into 7 smaller hexagons.
- Resolution 2: Each hexagon at resolution 1 is again divided into 7 more hexagons.
- …
- Resolution 15: The smallest hexagon level.
This results in an exponential growth in the number of hexagons covering the same area.
If you start with 1 hexagon at resolution 0, the number of hexagons follows this pattern:
- Resolution 0 → 1 hexagon
- Resolution 1 → 7 hexagons
- Resolution 2 → 49 hexagons (7 × 7)
- Resolution 3 → 343 hexagons (7 × 7 × 7)
- Resolution 4 → 2,401 hexagons (7^4)
- Resolution 5 → 16,807 hexagons (7^5)
- …
- Resolution 15 → 7^15 hexagons (a massive number!)
- Any hexagon at resolution R has one parent at R-1.
- That parent hexagon has 7 children at R+1.
- The child hexagons are entirely contained within their parent.
This means that if you have a dataset at resolution 9, you can "zoom out" to resolution 5 by aggregating all child hexagons into their parent hexagons.
- Fixed growth ratio → Each hexagon generates 7 new hexagons at the next resolution.
- Set hierarchy → Every hexagon has one parent and 7 children (except for base resolution).
- Consistent spatial indexing → You can move between resolutions while keeping location relationships intact.
The area of a hexagon at a given resolution in H3 depends on the resolution level (R) and varies with latitude due to the Earth's curvature. However, for simplicity, Uber provides average hexagon areas for each resolution.
The area of a hexagon at resolution R follows a pattern where it shrinks exponentially as R increases.
- ( A_R ) = Area of a hexagon at resolution ( R ).
- ( A_0 ) = Area of a hexagon at resolution 0 (covering a large part of the Earth).
- ( 7^R ) = Since each hexagon is subdivided into 7 hexagons at the next resolution, the area decreases exponentially.
Here’s a table of approximate hexagon areas for different resolutions:
Resolution (R) | Avg. Hexagon Area (km²) | Avg. Hexagon Area (m²) |
---|---|---|
0 | 4,357,449.41 km² | 4.36 × 10^9 m² |
1 | 609,635.63 km² | 6.10 × 10^8 m² |
2 | 86,987.95 km² | 8.70 × 10^7 m² |
3 | 12,426.85 km² | 1.24 × 10^7 m² |
4 | 1,775.27 km² | 1.78 × 10^6 m² |
5 | 253.61 km² | 2.54 × 10^5 m² |
6 | 36.23 km² | 3.62 × 10^4 m² |
7 | 5.18 km² | 5.18 × 10^3 m² |
8 | 0.74 km² | 7.43 × 10^2 m² |
9 | 0.11 km² | 1.06 × 10^2 m² |
10 | 0.02 km² | 1.52 × 10^1 m² |
11 | 0.0023 km² | 2.17 × 10^0 m² |
12 | 0.0003 km² | 3.10 × 10^-1 m² |
13 | 0.00004 km² | 4.42 × 10^-2 m² |
14 | 0.000006 km² | 6.32 × 10^-3 m² |
15 | 0.0000008 km² | 9.03 × 10^-4 m² |
- At resolution 0, a hexagon covers a huge portion of the Earth (~4.36 million km²).
- At resolution 5, it's roughly the size of a city (~253 km²).
- At resolution 9, it's the size of a small neighborhood (~0.11 km²).
- At resolution 15, it's less than 1 m².
Would you like a Python script to compute the area for different resolutions dynamically? 🚀
Resolution (R) | Avg. Hexagon Area (km²) | Analogy (US Reference) |
---|---|---|
0 | 4,357,449 km² | About half the size of the United States 🇺🇸 (total land area is ~9.8 million km²). |
1 | 609,636 km² | About the size of Texas 🐄 (695,662 km²). |
2 | 86,988 km² | Roughly the size of Maine 🦞 (91,646 km²). |
3 | 12,427 km² | About the size of Connecticut + Rhode Island combined. |
4 | 1,775 km² | Around the size of Los Angeles County, CA 🌴. |
5 | 253 km² | A little smaller than Washington, D.C. 🏛️. |
6 | 36 km² | Close to the size of Manhattan, NY 🏙️. |
7 | 5.18 km² | Roughly the size of Disney World 🎢 (Florida, 6 km²). |
8 | 0.74 km² | Similar to Central Park, NYC 🌳 (3x the size of the National Mall in D.C.). |
9 | 0.11 km² | About 20 football fields 🏈. |
10 | 0.02 km² | Roughly the size of a big Walmart parking lot 🛒. |
11 | 0.0023 km² | About the size of a city block in NYC 🏢. |
12 | 0.0003 km² | Roughly the size of a suburban backyard 🏡. |
13 | 0.00004 km² | About half a basketball court 🏀. |
14 | 0.000006 km² | A two-car garage 🚗. |
15 | 0.0000008 km² | About the size of a kitchen table 🍽️. |
- Low resolutions (0-3) cover entire states or regions.
- Mid-range resolutions (4-8) cover cities, counties, and large parks.
- High resolutions (9-15) get down to neighborhoods, buildings, parking lots, and even household objects.
@jorgejesus oh cool haha just FYI this is ChatGPT generated, I was just persisting some notes via GitHub Gists. Also outta curiosity what do you mean by "fast consultation"?