When to use H3
Consider using H3 tiling when:
- Creating heatmaps of events (populations, counts, etc.)
- Wanting to compare datasets across resolutions & scale
- Working with sparse datasets
Example of buildings heatmap based on the Overture Buildings dataset:
Code
common = fused.load("https://github.com/fusedio/udfs/blob/main/public/common/")
@fused.udf
def udf(bounds: fused.types.Bounds = [-122.71963771127753,36.53196328805067,-120.70395948802646,38.082911654639275]):
res = bounds_to_res(bounds)
print(res)
releases = ['2024-02-15-alpha-0', '2024-03-12-alpha-0', '2024-08-20-0', '2024-09-18-0', '2024-10-23-0', '2024-11-13-0', '2024-12-18-0', '2025-01-22-0', '2025-03-19-1', '2025-04-23-0', '2025-05-21-0']
release1 = releases[-1]
df1 = common.read_hexfile(bounds, f"s3://fused-users/fused/sina/overture_overview/{release1}/hex{res}.parquet", clip=True)
return df1
@fused.cache
def bounds_to_res(bounds, res_offset=0, max_res=14, min_res=3):
z = common.estimate_zoom(bounds)
return max(min(int(3 + max(0, z - 3) / 1.7 + res_offset), max_res), min_res)
This example is based on ingested buildings datasets in H3
Converting Datasets to H3 tiles​
We've provided a few options for converting datasets to H3 tiles:
Type | Data Size | Hexagonification Type | H3 Output | Consideration |
---|---|---|---|---|
File to H3 | Small (< 100MB) | On the fly | Static Resolution | Easy to adjust. Can easily change field to hexagonify |
Dynamic Tile to H3 | Small (< 100MB) or Large (> 100MB) | On the fly | Dynamic Resolution | Easy to adjust. Can easily change field to hexagonify |
Ingesting Dataset to H3 | Large (> 100MB) | Pre-computed | Dynamic Resolution | Requires deciding on which variable to hexagonify ahead of time |
Example UDFs​
- Ookla Download Speed Heatmap: Visualize download speeds across the world.
- US Crop Viewer: Explore crops around the US
- Overture Release Difference Heatmap: Visually identify differences between 2 Overture Building dataset releases.