Skip to content

fix: return antimeridian-crossing cells to both edge tiles - #1

Merged
bbest merged 2 commits into
mainfrom
fix/antimeridian-tiles
Jul 1, 2026
Merged

fix: return antimeridian-crossing cells to both edge tiles#1
bbest merged 2 commits into
mainfrom
fix/antimeridian-tiles

Conversation

@bbest

@bbest bbest commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Hexagons straddling ±180° were returned to only one edge tile (centroid filter), so the far half — clipped at 180° — never rendered (a seam, most visible on a globe). The lng filter is now antimeridian-aware (h3_cell_to_lng ± 360 vs the buffered bbox), returning a crossing cell to both edge tiles; the client (h3j-h3t / mapgl add_h3t_source, walkerke/mapgl#211) normalizes each cell onto the side the rendered tile sits on. Golden wrap_tile_sql fixtures regenerated; 67 tests pass. Mirrors MarineSensitivity/server@6aa115f.

A hexagon straddling ±180° has its centroid on one side, so the tile centroid
filter returned it to only ONE edge tile; its far half (clipped at 180° in that
tile) never rendered, leaving a seam — most visibly on a globe projection.

Make the longitude filter antimeridian-aware: also match h3_cell_to_lng ± 360
against the (already buffered) tile bbox, so a crossing cell is returned to BOTH
edge tiles. The client (h3j-h3t / mapgl add_h3t_source) normalizes each cell onto
the side of the antimeridian the rendered tile sits on, so the halves meet
seamlessly.

Golden wrap_tile_sql fixtures regenerated; 67 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bbest
bbest merged commit 40062da into main Jul 1, 2026
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