Almost every enterprise dataset has a location in it somewhere. Cell towers and call records. Insured properties and flood zones. Delivery stops and service territories. Card transactions and store footprints. The questions that matter most often sound simple: which of these points fall inside which of those areas?
The trouble is that answering them at scale has traditionally been slow, expensive, or both. Many teams end up exporting data to a separate GIS tool, sampling it down, or precomputing answers overnight and hoping nobody asks a new question. None of that works when the business wants answers in seconds on the full dataset.
Yellowbrick takes a different approach: bring spatial analytics into the warehouse, and use the H3 hexagonal grid to make spatial joins behave like the fast, parallel joins the engine already does best.
Why spatial joins are hard
A normal join matches rows on equal keys. Customer ID equals customer ID. A massively parallel processing (MPP) engine handles that beautifully: hash the key, send matching rows to the same worker, and join in parallel.
A spatial join is different. The question isn't "are these two values equal?" but "do these two shapes overlap?" There is no key to hash. Without help, the engine has to compare every polygon against every other polygon or point. That's a cross join, and at enterprise volumes it can mean billions or trillions of geometric comparisons.
GEOGRAPHY types also don't partition or hash the way integers do, so they can't take full advantage of the parallelism that makes an MPP warehouse fast.
Enter H3
H3 is an open-source geospatial indexing system, originally developed at Uber, that divides the world into hexagonal cells. It's hierarchical: every cell has seven child cells below it, across 16 resolutions from continent-sized hexagons down to cells under a square meter.
The key property for analytics is simple. Every H3 cell has an integer ID. That means "is this point near that polygon?" can be turned into "do these two things share a cell ID?", which is an ordinary equality join. Integers sort, hash and distribute across workers exactly the way a parallel engine wants.
Hexagons have another advantage over square grids. Every neighbor of a hexagon sits the same distance from its center, which makes distance, adjacency and coverage calculations more consistent. That's one reason H3 has become a de facto standard for large-scale spatial analysis.
How Yellowbrick accelerates spatial joins
Yellowbrick integrates H3 directly into the query engine. When the optimizer sees a qualifying spatial join, it rewrites the query in three steps:
- Cover. Generate the set of H3 cells that cover each input geometry at a chosen resolution.
- Join. Match the two inputs on shared H3 cell IDs, a fast integer equality join that runs in parallel across the cluster.
- Confirm. Apply the original spatial predicate to the much smaller set of candidate pairs, so the results stay exact.
The H3 step is a filter, not an approximation. It throws out the vast majority of pairs that can't possibly intersect, then the precise geometry check runs only on what's left. You get the speed of an integer join and the accuracy of a true spatial test.
Just as important: the H3 cells are built dynamically at query time. There are no precomputed indexes to maintain and no schema changes. It works on base tables, views and subqueries.
What it looks like in practice
Say an insurer wants to know how much insured value sits inside each wildfire risk zone. Turning on the rewrite takes one setting:
SET enable_geospatial_join_rewrite = true;
SET geospatial_join_rewrite_resolution = 7;
SELECT z.zone_name,
z.risk_tier,
COUNT(*) AS policies,
SUM(p.insured_value) AS total_exposure
FROM wildfire_zones z
JOIN insured_properties p
ON ST_Intersects(z.boundary, p.location)
GROUP BY z.zone_name, z.risk_tier
ORDER BY total_exposure DESC; The SQL is exactly what an analyst would write anyway. The acceleration happens underneath. Analysts, BI tools and AI agents generating SQL don't need to know H3 exists.
For teams that want more control, Yellowbrick also exposes H3 functions directly, including H3_COVERAGE, H3_POINT_TO_CELL and H3_CELL_TO_HEXSTRING. A common pattern is rolling raw events up to hexagons for heat maps:
SELECT H3_CELL_TO_HEXSTRING(H3_POINT_TO_CELL(e.location, 8)) AS hex_id,
COUNT(*) AS dropped_calls
FROM network_events e
WHERE e.event_type = 'DROPPED_CALL'
AND e.event_time >= CURRENT_DATE - 7
GROUP BY 1
ORDER BY dropped_calls DESC; The output drops straight into mapping tools that understand H3, such as kepler.gl, with no geometry processing in between. For polygon sets queried over and over, such as sales territories or regulatory zones, teams can also materialize the H3 coverage as tables and reuse it.
Choosing a resolution
Resolution is the main tuning lever. Too coarse, and each cell matches too many candidates. Too fine, and every polygon explodes into an enormous number of cells. Yellowbrick's guidance is that performance is usually best when each polygon is covered by a few hundred H3 cells. Start there, then test against your own data.
A practical rule of thumb: city-scale territories tend to land in the middle resolutions, while building-level or street-level work needs finer ones.
Where this matters
- Telecommunications. Map dropped calls, coverage gaps and capacity hot spots against tower footprints, at the full volume of network events.
- Insurance. Calculate accumulated exposure inside flood, wildfire and wind zones, and re-run it the moment a catastrophe model changes.
- Financial services. Match transactions to merchant locations and branch catchments for fraud detection and site planning.
- Logistics and retail. Assign stops to service territories, measure delivery density and model store trade areas.
- Public sector and defense. Fuse sensor, asset and mission data over a common grid, in environments where data cannot leave controlled infrastructure.
Why do it in the warehouse
The value isn't only speed. When spatial analysis runs where the data already lives, location becomes just another dimension. It joins against customers, policies and transactions, under the same security, governance and access controls as everything else.
There's no export to a separate GIS system and no second copy of sensitive data. Nothing goes stale between overnight runs. For organizations that run Yellowbrick on premises or in their own private cloud, location data never has to leave their environment at all.
Spatial questions used to be the ones teams avoided asking because they took too long. With H3 built into the engine, they're just queries.
Ready to try it? Start with Yellowbrick and run your first accelerated spatial join on your own data.