Commit a56f239
feat: reprojector initial-triangulation seed + clamp Web Mercator meshes to ±85.051° (#574)
* docs(specs): add antimeridian crossing-tile (cut-in-two) design
Design for rendering imagery crossing ±180° in Web Mercator (issues #171,
#366). Splits a crossing tile at the antimeridian into west/east pieces so
each reprojects as a normal non-crossing tile — avoiding the proj4-rewrap
unwrap that prior attempts (#353/#374/#269) stumbled on. Generalizes the
RasterReprojector to accept a delaunator-shaped initial-triangulation seed
(subsuming #351 uvBounds / pole clamp), splits in _renderSubLayers into two
single-mesh RasterLayers, and uses a two-box bounding volume composing with
the merged world-copy traversal (#518).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs(specs): refine antimeridian spec — add test fixture, handle slanted cuts
- Use the vendored geotiff-test-data antimeridian.tif fixture (42x42 EPSG:4326,
crosses -180 at column 24) as the primary deterministic crossing test.
- Handle slanted (rotated-geotransform) cuts, not just vertical: any straight
cut yields convex pieces delaunator triangulates exactly; error only on
curved/concave cuts. createInitialConditions is therefore part of the MVP
crossing path.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(raster-reproject): add createInitialConditions (delaunator-backed seed)
Add the InitialTriangulation type and a tree-shakeable createInitialConditions
helper that builds a Delaunay seed from a UV point set. delaunator is confined
to its own module (initial-conditions.ts); delatin.ts does not import it and the
package is sideEffects:false, so it tree-shakes out for consumers that don't use
it. Foundation for antimeridian cut-in-two and the sub-domain capability in #351.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(raster-reproject): document delaunator seed pattern, don't ship a wrapper
Per review: a one-line delaunator wrapper isn't worth a runtime dependency.
Expose only the InitialTriangulation type and show the delaunator one-liner in
its docstring. delaunator moves to devDependencies — used by tests to validate
winding compatibility, not shipped to consumers.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs(specs): drop createInitialConditions wrapper from antimeridian design
raster-reproject exposes only the InitialTriangulation type + documents the
delaunator one-liner; delaunator is a dev/test dep (winding validation), not
shipped. Runtime seed-building for crossing tiles is the deck.gl-raster
builder's job (follow-up plan). Mark stage 1 done.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(raster-reproject): seed RasterReprojector from an initial triangulation
Generalize the constructor to accept an optional initialTriangulation seed
(delaunator's data shape), defaulting to a hardcoded unit-square seed so
behavior is unchanged and the package needs no runtime triangulation dep.
Refinement only ever splits existing triangles, so a sub-domain seed confines
the mesh to that region. Tests build seeds via delaunator (the documented
pattern) to validate winding compatibility + sub-domain confinement.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(raster-reproject): add rectangleSeed helper for sub-rectangle seeds
Build an axis-aligned 2-triangle rectangle seed for a UV sub-rectangle (no
delaunator, runtime-safe). UNIT_SQUARE_SEED is now rectangleSeed(0,0,1,1).
Used to clamp a mesh to a UV band — e.g. the valid Web Mercator latitude band
(#182 / #351) — and reused by the antimeridian vertical-cut case.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(deck.gl-raster): add webMercatorClampSeed (clamp mesh to ±85.051°)
Pure helper that returns a rectangleSeed clamping a north-up geographic tile's
reprojection mesh to the Web Mercator latitude band, or undefined when no clamp
is needed/possible (rotated/projected tiles, fully-polar tiles). Avoids the
degenerate near-pole triangles from #182 / #351. Unit-tested with synthetic
corner latitudes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(deck.gl-raster): clamp Web Mercator meshes to valid latitude band
Wire the reprojector seed through the render path: RasterLayer gains an
initialTriangulation prop (passed to RasterReprojector, regenerated on change);
getTileMetadata computes a per-tile _webMercatorReprojectorSeed via
webMercatorClampSeed; _renderSubLayers passes it in the Web Mercator branch
only (globe shows the poles, full mesh). Fixes the degenerate near-pole
triangles for EPSG:4326 imagery reaching ±90° (#182 / #351).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(deck.gl-raster): name clamp seed as initialTriangulation
Rename webMercatorClampSeed → webMercatorInitialTriangulation and the tile
metadata field _webMercatorReprojectorSeed → _webMercatorInitialTriangulation,
for consistency with the InitialTriangulation type and the
RasterLayer.initialTriangulation prop (drops the ad-hoc 'seed'/'ReprojectorSeed'
terms).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(deck.gl-raster): rename clamp fn to createInitialWebMercatorTriangulation
Verb-prefixed name for the builder (was webMercatorInitialTriangulation); the
tile metadata field stays _webMercatorInitialTriangulation.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(raster-reproject): rename rectangleSeed -> triangulateRectangle
Active verb name for the helper that triangulates a UV rectangle into an
InitialTriangulation; internal UNIT_SQUARE_SEED -> UNIT_SQUARE_TRIANGULATION;
test file renamed to match. Updates the deck.gl-raster clamp caller too.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor: apply triangulateRectangle rename across source + caller
Completes the rename (a657eb8 only moved the test file): rectangleSeed ->
triangulateRectangle in delatin.ts + index export + the renamed test, and the
deck.gl-raster web-mercator-clamp caller. UNIT_SQUARE_SEED -> UNIT_SQUARE_TRIANGULATION.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8a329b3 commit a56f239
12 files changed
Lines changed: 548 additions & 16 deletions
File tree
- dev-docs/specs
- packages
- deck.gl-raster
- src
- raster-tile-layer
- raster-tileset
- tests/raster-tileset
- raster-reproject
- src
- tests
Lines changed: 134 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
79 | 90 | | |
80 | 91 | | |
81 | 92 | | |
| |||
187 | 198 | | |
188 | 199 | | |
189 | 200 | | |
190 | | - | |
| 201 | + | |
| 202 | + | |
191 | 203 | | |
192 | 204 | | |
193 | 205 | | |
| |||
199 | 211 | | |
200 | 212 | | |
201 | 213 | | |
| 214 | + | |
202 | 215 | | |
203 | 216 | | |
204 | 217 | | |
| |||
238 | 251 | | |
239 | 252 | | |
240 | 253 | | |
| 254 | + | |
241 | 255 | | |
242 | 256 | | |
243 | 257 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
446 | 451 | | |
447 | 452 | | |
448 | 453 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
102 | 112 | | |
103 | 113 | | |
104 | 114 | | |
| |||
373 | 383 | | |
374 | 384 | | |
375 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
376 | 399 | | |
377 | 400 | | |
378 | 401 | | |
| |||
393 | 416 | | |
394 | 417 | | |
395 | 418 | | |
| 419 | + | |
396 | 420 | | |
397 | 421 | | |
398 | 422 | | |
0 commit comments