Skip to content

docs(h3-hexagon-layer): add GeoJSON FeatureCollection example#10317

Open
SMC17 wants to merge 1 commit into
visgl:masterfrom
SMC17:docs-h3hexagonlayer-geojson-example
Open

docs(h3-hexagon-layer): add GeoJSON FeatureCollection example#10317
SMC17 wants to merge 1 commit into
visgl:masterfrom
SMC17:docs-h3hexagonlayer-geojson-example

Conversation

@SMC17
Copy link
Copy Markdown

@SMC17 SMC17 commented May 19, 2026

Description

When ingesting a GeoJSON FeatureCollection where each feature's properties carries the H3 cell ID (a common export pattern from geopandas, QGIS, h3-py, and custom spatial-index pipelines), the default getHexagon accessor (object => object.hexagon) silently returns undefined because GeoJSON parsers surface features as {type, geometry, properties} objects.

This adds a small worked example to the H3HexagonLayer docs page showing the getHexagon: d => d.properties.h3_id override so the pattern is discoverable without reading the source.

Motivation

The existing examples on the page assume the data shape [{hex, count}, …]. Many H3-cell pipelines emit GeoJSON instead, and the override needed for the H3HexagonLayer to render those is one line — but currently has to be derived rather than copied. This PR makes the recipe copy-pastable.

Tested against a real-world 1,665-feature GeoJSON FeatureCollection of H3 res-5 cells.

Change

  • docs/api-reference/geo-layers/h3-hexagon-layer.md — adds one new subsection ("Consuming H3 cells from a GeoJSON FeatureCollection") with a 13-line H3HexagonLayer example, immediately after the existing Tabs block and before ## Installation.

Docs-only; no code touched. +32 / -0 on the one file.

When ingesting a GeoJSON FeatureCollection where each feature's
properties carries the H3 cell ID (a common export pattern from
geopandas, QGIS, h3-py, and custom spatial-index pipelines), the
default getHexagon accessor (object => object.hexagon) silently
returns undefined because GeoJSON parsers surface features as
{type, geometry, properties} objects.

This adds a worked example to the H3HexagonLayer docs showing the
getHexagon: d => d.properties.h3_id override so the recipe is
discoverable without reading the source.

Tested against a 1,665-feature H3 res-5 FeatureCollection export.

Docs-only; no code touched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant