Skip to main content

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:

TypeData SizeHexagonification TypeH3 OutputConsideration
File to H3Small (< 100MB)On the flyStatic ResolutionEasy to adjust. Can easily change field to hexagonify
Dynamic Tile to H3Small (< 100MB) or Large (> 100MB)On the flyDynamic ResolutionEasy to adjust. Can easily change field to hexagonify
Ingesting Dataset to H3Large (> 100MB)Pre-computedDynamic ResolutionRequires deciding on which variable to hexagonify ahead of time

Example UDFs​