AlgoViz

H3 cells, rings and aggregation

medium 4 min

H3 groups positions into cells at chosen resolutions.

Video lesson · Chapter 1 of 5

Count deliveries without storing one pin on the map

0:00 / 3:54

Count pickups in hexagons, then dispatch a driver

1:10Reel

Theory

Read or listen first. About 1 min.

What it is

H3 assigns a location a cell ID at a chosen resolution. Counting pickups with the same ID produces a geographic aggregation that separate services can join on.

Group pickups by H3 cell

Eight coordinates at one indexing resolution.
Each dot is a pickup. Assign each coordinate to an H3 cell at one chosen resolution. The local patch is drawn schematically.

Why it exists

Stable buckets are useful for supply and demand dashboards. Dispatching a driver adds a different requirement because the customer’s radius can cross several cells.

Words to know

Resolution
The level of detail in the cell hierarchy that determines the typical cell size.

How it works

Step through the idea, or press Play.

Step 1 of 3

Assign cells. Map pickup coordinates to a common H3 resolution.

Understand it

Worked example

H3 cells, rings and aggregation in practice

Count trips by pickup cell before joining driver counts at the same resolution. For a radius query, collect enough neighboring cells to cover the area, then calculate actual distances.

Related case

Find every charger across a cell boundary

A driver near the edge of a grid cell requests chargers within 800 metres. The closest charger sits across the street in another cell.

Across the street, across the cell
Chargers on both sides of the streetABCOne cell misses charger B

Fetch intersecting cells and check candidates.

Sources