Repository navigation
feat(geotiff): let assembleTiles stitch clipped edge tiles - #753
Merged
Merged
Conversation
assembleTiles required the output to be a whole number of tiles, so it only accepted edge tiles fetched with `boundless: true`, padded out to the full tile size. MultiCOGLayer will switch to `boundless: false` so it stops drawing that padding, and it stitches its coarser bands with assembleTiles, so the last column and row may now hold clipped tiles. Each tile must still exactly fill its place in the grid. A tile smaller than its place used to leave a silent gap of zeros; it now throws, as does a full-size tile in a clipped column or row. Co-Authored-By: Claude Opus 5.5 <[email protected]>
kylebarron
added a commit
that referenced
this pull request
Oct 21, 2026
before (black border): <img width="2800" height="1724" alt="before-fit" src="https://github.com/user-attachments/assets/e42d808f-47a2-4593-9a76-5946aec0a98b" /> after: <img width="2800" height="1724" alt="after-fit" src="https://github.com/user-attachments/assets/d129b0e3-8bb5-4649-b14c-a357161a3669" /> before: <img width="2800" height="1724" alt="3-before-20m-corner" src="https://github.com/user-attachments/assets/dac357ee-9498-4210-977c-a1ca556ea766" /> after: <img width="2800" height="1724" alt="4-after-20m-corner" src="https://github.com/user-attachments/assets/b54ac9bb-2a70-4029-a86f-dd52a507770f" /> before and after for mollweide example (still broken 😄 ) <img width="2800" height="1724" alt="5-before-mollweide" src="https://github.com/user-attachments/eassets/d7c6519a-6800-4f64-8de2-38209c7338fc" /> <img width="2800" height="1724" alt="6-after-mollweide" src="https://github.com/user-attachments/assets/24ccfad8-7fe8-4604-98a4-c84f70bf82bf" /> ----- > [!NOTE] > This PR was written by Claude (Claude Code), not by @kylebarron. `MultiCOGLayer` now fetches edge tiles with `boundless: false`, as `COGLayer` does, and meshes only the part of each tile inside the image. Before, it drew every tile at full size, so the padding past the image's right and bottom edges showed as a band past the scene. That padding holds whatever the file's writer stored there, not necessarily nodata. In Digital Earth Australia's Sentinel-2 files (nodata -999) it is 0, which a nodata filter can't remove. Coarser bands are stitched from clipped tiles too, which works because every step uses the same clipped geometry: - `AffineTilesetLevel.projectedTileCorners` clips the tiles in the last column and row to the array (the change from #580). - `resolveSecondaryTiles` takes the stitched texture's size from the far clipped corner, so it matches the UV transform it computes from the clipped extents. - `assembleTiles` already accepts clipped edge tiles (#753). Clipping the corners also affects `COGLayer` and `ZarrLayer`, which already drew only the clipped part: their culling `bbox`, bounding volumes, Web Mercator pole clamp, and debug outlines now match what they draw. It also fixes #580's case, a full-world Mollweide COG whose padded corners fall outside the projection's domain, so every tile was culled. That file now selects and draws tiles, though its polar tiles still smear because pixels outside Mollweide's ellipse don't reproject, which is a separate problem. `dev-docs/boundless-tiles.md` is rewritten to match. Closes #580, closes #651 🤖 Written by [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Note
This PR was written by Claude (Claude Code), not by @kylebarron.
assembleTilesnow accepts a grid whose last column or row holds clipped edge tiles, asfetchTilesreturns them withboundless: false. The outputwidthandheightno longer have to be multiples of the tile size.This is groundwork for having
MultiCOGLayerstop drawing the padding that edge tiles carry past the image edge. That padding holds whatever the file's writer stored there (zeros in the DEA Sentinel-2 files from #651, whose nodata is -999), so a nodata filter can't reliably hide it. The fix is to fetch edge tiles withboundless: false, asCOGLayeralready does, which returns them clipped to the image.MultiCOGLayerstitches its coarser bands withassembleTiles, so the stitcher has to accept clipped tiles first.Each tile must still exactly fill its place in the grid:
tileWidthxtileHeight, or the clipped remainder in the last column or row. Anything else throws a descriptive error, such asTile (1, 0) is 2x2, expected 1x2. Previously, a tile smaller than its place left a silent gap of zeros in the output.Ref #651
🤖 Written by Claude Code