Skip to content

Generalize reprojection clamping at Web Mercator bounds #575

@kylebarron

Description

@kylebarron

#574 implements reprojection clamping for north-up images


Written by Claude on behalf of @kylebarron

Background

#574 added a Web Mercator pole-clamp: webMercatorClampSeed builds a rectangleSeed for the valid latitude band, piped through getTileMetadata_webMercatorReprojectorSeedRasterLayer.initialTriangulation. The RasterReprojector accepts an arbitrary InitialTriangulation (also #574), so the reprojection engine already supports non-rectangular seeds — nothing is missing there.

Gap

The seed builder only handles the easy case: webMercatorClampSeed produces an axis-aligned rectangle, which is only valid for north-up geographic tiles. For non-north-up (rotated geotransform) or non-geographic tiles that reach past ±85.051°, the valid band isn't a UV rectangle, so the builder returns undefined and the tile falls back to the full mesh (pre-#574 degenerate polar triangles / non-convergence).

The work is to compute the actual clamp region and pipe a non-rectangular seed through for those tiles — e.g. delaunator over the clamped region's boundary points (with centroid-filtering if the region is concave). No reprojector changes needed.

Shared with the antimeridian

The curved/slanted antimeridian cut needs the same thing — a non-rectangular seed built and piped for the crossing region (see dev-docs/specs/2026-05-27-antimeridian-crossing-tile-design.md). Same consumer-side construction, same engine.

Low priority — north-up global EPSG:4326 grids (the common near-polar case) are already handled by #574.


Written by Claude on behalf of @kylebarron

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions