developmentseed / developmentseed/deck.gl-raster

Globe view: curvature-aware spherical reprojection (remove uniform-grid scaffold)

Open
#566 0 comments 0 reactions 1 assignee Claimed by @kylebarron View on GitHub
Dominant language
TypeScript
Stars
228
Forks
29
Avg merge
12h 27m
Merged PRs (30d)
4

Description

> Written by Claude on behalf of @kylebarron

## Context

The globe-view prototype (#563, part of #82) renders raster tiles on a 3D globe. The adaptive mesh reprojector (`RasterReprojector`, `packages/raster-reproject`) subdivides based on **reprojection error measured in pixel space**, which is blind to **sphere curvature**: for an EPSG:4326 source the source→lng/lat reprojection is the identity, so it emits 2 triangles whose flat chords cut through the sphere and visibly facet at low zoom.

## Current stopgap

Globe mode bypasses the adaptive mesh and builds a uniform `N×N` per-tile grid ([`packages/deck.gl-raster/src/globe-grid-mesh.ts`](https://github.com/developmentseed/deck.gl-raster/blob/main/packages/deck.gl-raster/src/globe-grid-mesh.ts)). This is an explicitly throwaway scaffold.

## The real fix

Make the reprojection error metric **curvature-aware**: measure the 3D deviation between the flat chord and the true sphere position at each candidate point (give the reprojector `viewport.projectPosition`, add a 3D-sag error term, keep lng/lat output) so it adaptively subdivides on the sphere. Then delete the grid scaffold and route globe through the reprojector again.

Note this is a genuinely different error definition, not a tweak: faceting is a **radial** deviation (the chord sags below the sphere), whereas the current pixel-space metric is **tangential** and collapses the radial dimension (the chord midpoint unprojects to ~the same lng/lat as the true point).

## Links

- Follow-up to #563; part of #82 (globe view).
- Related reprojector robustness issue: #366 (mesh divergence near ±180° in Web Mercator).
- Design notes: `dev-docs/specs/2026-05-21-globe-view-design.md`, `dev-docs/coordinate-systems.md` (Globe view section).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.