Skip to content

feat: Add antimeridian crossing support to RasterReprojector#269

Open
espg wants to merge 2 commits intodevelopmentseed:mainfrom
englacial:feat/antimeridian
Open

feat: Add antimeridian crossing support to RasterReprojector#269
espg wants to merge 2 commits intodevelopmentseed:mainfrom
englacial:feat/antimeridian

Conversation

@espg
Copy link

@espg espg commented Feb 26, 2026

Ported from #266. Needed for default globe discussed on source-cooperative/source.coop#230.

Summary

  • Detect antimeridian (±180°) crossing from initial corner vertices in RasterReprojector — when a tile's WGS84 longitudes span >180°, normalize them to a continuous range (e.g., [170, 190] instead of [170, -170]) so mesh triangles don't wrap the wrong way around the globe
  • Apply longitude offset to subsequent vertices during mesh refinement
  • Add 5 new unit tests for antimeridian handling

Closes #171

Test plan

  • All unit tests pass (pnpm test in raster-reproject)
  • Run cog-basic example — verify no regression in standard rendering

espg added 2 commits February 26, 2026 13:15
Detect when a tile's output positions span the ±180° meridian and
normalize longitudes to a continuous range (e.g., [170, 190] instead
of [170, -170]). This prevents mesh triangles from spanning 340° of
longitude and ensures correct GPU-side interpolation for tiles near
the date line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support images spanning the antimeridian

1 participant