Commit 1e52f60
fix(h3t): render H3 hexagons crossing the antimeridian
H3 cells straddling ±180° rendered as a jagged tear/gap: h3-js
`h3ToGeoBoundary()` returns their vertices split between +179 and -179, so the
polygon spans ~358° of longitude and geojson-vt mis-tiles it.
Two parts, in the bundled `h3j-h3t` cell builders (addH3TSource / addH3JSource /
setH3JData):
1. fixTransmeridian (Nick Rabinowitz,
https://observablehq.com/@nrabinowitz/mapbox-utils): a boundary ring with any
arc > 180° lon has its negative-lon vertices shifted +360°, so it stays
continuous near +180° instead of wrapping the globe. Complete for the
non-tiled add_h3j_source / setH3JData.
2. For the tiled add_h3t_source, a crossing cell is fetched into more than one
{z}/{x}/{y} tile; each cell is normalized by ±360° onto the side of the
antimeridian the rendered tile sits on, so its halves draw in the correct
tiles and meet seamlessly. Pairs with an antimeridian-aware tile filter on
the h3t server that returns a crossing cell to both edge tiles.
No extra libraries; non-crossing cells are untouched.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 07eaee0 commit 1e52f60
2 files changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments