feat: Add globe view support for tile traversal#268
feat: Add globe view support for tile traversal#268espg wants to merge 8 commits intodevelopmentseed:mainfrom
Conversation
Expand __TEST_EXPORTS to expose helper functions (getOverlappingChildRange, getMetersPerPixel, rescaleEPSG3857ToCommonSpace, sampleReferencePointsInEPSG3857) and add 21 tests covering: - computeProjectedTileBounds for WebMercatorQuad and UTM31 - rescaleEPSG3857ToCommonSpace coordinate mapping and clamping - sampleReferencePointsInEPSG3857 interpolation - getOverlappingChildRange parent-child tile relationships - getMetersPerPixel zoom/latitude behavior - RasterTileNode.insideBounds AABB overlap logic - RasterTileNode.getBoundingVolume OBB computation (Mercator path) - RasterTileNode.children quadtree traversal Establishes regression baseline before globe view changes.
Remove the assert(false, "TODO") blocker in getBoundingVolume() and implement full globe view support in the tile traversal code: - Thread projectTo4326 through TileMatrixSetTileset → getTileIndices() → RasterTileNode (alongside existing projectTo3857) - Add _getGlobeBoundingVolume() which samples reference points in WGS84 and projects them into globe common space via viewport.projectPosition - Add sampleReferencePointsInWgs84() helper (parallel to the existing sampleReferencePointsInEPSG3857) - Return centerLatitude from getBoundingVolume() so LOD computation works in both Mercator and Globe views without calling worldToLngLat() - Handle globe-mode bounds conversion in getTileIndices() by projecting WGS84 bounds corners through the globe project function instead of lngLatToWorld() - Remove unused assert import Closes developmentseed#82
Provides a minimal example using deck.gl's GlobeView with COGLayer for visualizing COG imagery on a 3D globe. Includes a dark background sphere, debug mesh controls, and commented URLs for both mid-latitude and polar datasets.
|
I merged in master locally but seem to not be able to push to your branch. I seem to have some issues with the controller with this example; not sure whether that's anything in this PR, or if it's a bug with the deck.gl globe view controller at large. Screen.Recording.2026-03-06.at.10.07.00.AM_1080p.movDo you know of any large-scale imagery we could test this on? Something like MODIS that wraps around a large area of the globe? I'd like to see the tile traversal and triangle subdivision there. Edit: I tried this on the NLCD Landcover image used in the
You can see at the bottom it's not loading all the tiles it should be, leading to south texas getting cut off
It's even worse when you zoom in Screen.Recording.2026-03-06.at.10.16.15.AM_1080p.movWhereas if you look at the current iteration of that example in Web Mercator, all of south texas is shown.
Also, can you say roughly what percentage of this work is AI generated? |
|
To answer your question on AI, I don't speak typescript. I did test and debug issues locally and verified things manually, however, the didn't test any of this on large scale imagery. That's mostly because this was setup in the context of stac-map, which uses decj.gl-raster to render footprint previews. As far as know, for that use case we're only ever loading a single image for the item that you select... so that was the testing that was done. |
|
It looks like these are the standard projection issues that happen when trying to draw straight lines that interpolate from lat / lon corners without drawing them as curved arcs. The quick fix is to densify edges prior to projection. I went ahead and added this, |
|
I'm not sure why but I can't push to this branch. I resolved the merge conflict in #363 but I'm still hitting issues that I added in the screencast. We now have a |



Ported from #266.
Summary
projectTo4326through the tileset and computing bounding volumes in 3D globe common space viaviewport.projectPosition_getGlobeBoundingVolume()andsampleReferencePointsInWgs84()for globe-mode bounds conversion ingetTileIndices()centerLatitudeinstead of Mercator-specificworldToLngLat()globe-viewexample demonstratingGlobeView+COGLayerwith debug controlsThis is in response to the discussion in source-cooperative/source.coop#230, about the possibility of defaulting to a global viewer in the source.coop stac-map viewer.
Closes #82
Test plan
pnpm testindeck.gl-raster)globe-viewexample with NZ imagery URL — verify tiles render on the globecog-basicexample — verify no regression in Mercator rendering