trianglewins / ortho-cog-viewer and deck.gl-raster, case by case

Warp Mesh Casebook

A live copy of the warp that ortho-cog-viewer draws: a constant grid in screen space, each vertex inverse-projected to lon/lat, and the GPU interpolating texture coordinates linearly inside each triangle. The heat layer shows how far the interpolated texture lands from where it belongs, in screen pixels, measured at each triangle's centroid and edge midpoints.

A companion to Reprojection meshes for raster tiles, which measures the same questions headless. Away from singularities that error is small and even, as the constant-mesh model says. It grows where the inverse is not smooth: the pole, the horizon, the antimeridian. The cases come in two separate sets, one per mesher: the screen grid above, and source tiles as deck.gl-raster builds them, with level-of-detail tiles in lon/lat, each refined on its own until its error is under a fraction of a source pixel. Both use the same texture and the same error measure, so they can be compared directly. For deck.gl-raster's own account of its mesh, see its reprojection explainer. Pick a case, then flip the switches.

hover or touch the map
0.1250.52816
Error in screen px. Untinted: under 0.125 px, the gdalwarp default.

Drag to move the centre. The texture is a synthetic lon/lat raster: 10 degree graticule, 1 degree lines poleward of 75, the antimeridian in teal.

What ortho-cog-viewer gets right, and what is open

ChoiceVerdictWhy
Mesh in screen spacerightEvery vertex sits exactly where it is drawn, so neighbouring triangles always meet: no cracks, no T-junction gaps, no tiles to stitch. Error is in screen pixels by construction, which is the unit a viewer cares about.
UV by exact inverserightPicking and texture both come from the same inverse, so the only approximation is linear interpolation inside a triangle.
Per-triangle unwrap + REPEATrightFixes antimeridian smears for any display projection with no special case. Try the Antimeridian case with unwrap off.
Pole split into threerightExact at the pole itself, since u is arbitrary there. It only repairs the one triangle that holds the pole.
Round-trip validity + bisected rimrightProjection-agnostic and smooth at any grid size. Try the Horizon case with clipping off.
Fixed grid size (64)openNot error-driven. At 900 px a 64 grid is about 1 px off across the disc, 4 to 6 px within the outer tenth of the limb and 8 to 11 px in the ring of triangles around the pole (the fan fixes only the centre one). Error falls with the square of cell size, so the flat middle is cheap to fix; the singular parts need local refinement.
RefinementmissingBisecting screen triangles until the error test passes keeps the mesh in screen space, so new T-junctions cost nothing. For 0.25 px it took about 26,000 triangles on the polar globe and 10,500 on polar stereographic, against 8,192 for the grid.
Docs vs codestaleThe buildLayerGeometry comment in uv.ts still says pole triangles are dropped and leave a hole, and Next Steps still lists closing the pole hole. The README and fanAroundPole say the hole is gone.
Interrupted projectionsopenThe round-trip mask handles the open part of each gap, but near the equator a gap narrows to a point and a triangle with all corners valid can straddle it. In Goode at 900 by 450 px that leaves about 16 px of error at the tips, and refining to 0.25 px (55,000 triangles) still leaves 16 px.
Fetch across the antimeridianopenThe full source width is fetched when a view straddles 180 (Next Steps says so). Two windows would do.

Source tiles, the deck.gl-raster way

The tile mode follows deck.gl-raster's design as documented in its source, dev-docs and reprojection explainer, without using its code. Tiles are chosen so a source pixel is at most one screen pixel at the tile centre. Each tile starts from two triangles, and the error at the centroid and edge midpoints is measured forward in screen pixels against maxError (default 0.125) times one source pixel's size on screen. A bintree split stands in for Delatin's Delaunay insertion. Triangle shapes differ, but the picture does not, because only the error test decides what gets drawn.

ChoiceEffectWhat the cases show
Mesh in source lon/latstrengthTexture coordinates are exact at every vertex and never wrap inside a tile, so the pole and the antimeridian need no special triangles. A map-space quadtree over the same polar tile is about 3 px off.
Greedy error-driven refinementstrengthEvery triangle meets its tolerance. The density near the pole is what that accuracy costs in a lon/lat source.
Unit set per tiletrade-offThe tolerance follows the source pixel at each tile's centre, so it differs from tile to tile and across one tile. Polar tiles: 29,700 triangles against 26,500 with one screen pixel everywhere, at 900 px.
One mesh per tiletrade-offNeighbouring tiles disagree along shared edges: 256 T-junctions in the polar view. The cracks are under 0.06 px there, so they show as sparkle, not gaps. Forcing neighbours to split the same edges removes them for under 1% more triangles.
Pole guardtrade-offA 0.5 degree hole at each pole, kept from input-pixel error. With forward error it can go.
Interrupted projectionsstrengthLobe edges are meridians in source space, so splitting each tile at them and projecting each part into its own lobe is exact: Goode at 900 by 450 px meets 0.125 of a source pixel everywhere, including the gap tips. Projected whole, the same tiles smear across the gaps by up to about 200 px.
Box-shaped seedslimitFine for lon/lat bands and projection boxes. They cannot follow a curved domain such as the orthographic horizon.

Numbers in both tables come from this page's own code at a 900 px square view, with error measured at the centroid and three edge midpoints of each triangle, as deck.gl-raster does. The page reimplements both meshes from their sources (ortho-cog-viewer c35b303, deck.gl-raster 5b55894) and uses neither's code. Mesh area / map is the summed triangle area over the map's valid area: under 100% means holes, over 100% means overlapping smears.