feat: Add globe view support for tile traversal#268
Open
espg wants to merge 7 commits intodevelopmentseed:mainfrom
Open
feat: Add globe view support for tile traversal#268espg wants to merge 7 commits intodevelopmentseed:mainfrom
espg wants to merge 7 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.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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