Skip to content

fix: draw only the image part of MultiCOGLayer edge tiles - #755

Merged
kylebarron merged 2 commits into
mainfrom
kyle/multi-cog-boundless-false
Oct 21, 2026
Merged

kylebarron merged 2 commits into
mainfrom
kyle/multi-cog-boundless-false

Conversation

@kylebarron

@kylebarron kylebarron commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

before (black border):

before-fit

after:

after-fit

before:

3-before-20m-corner

after:

4-after-20m-corner

before and after for mollweide example (still broken 😄 )

5-before-mollweide

6-after-mollweide

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:

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

MultiCOGLayer fetched edge tiles with `boundless: true` and meshed every
tile at full size, so the padding past the image's right and bottom
edges drew as a band past the scene. The padding holds whatever the
writer stored there, not necessarily nodata (0 in DEA's Sentinel-2
files, whose nodata is -999), so a nodata filter can't remove it.

Fetch with `boundless: false`, as COGLayer does, and mesh the primary
band's clipped texture. Coarser bands are stitched from clipped tiles:
AffineTilesetLevel clips edge tile corners to the array (from #580),
and resolveSecondaryTiles takes the stitched size from the far clipped
corner, so it matches the UV transform from the clipped extents.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@kylebarron kylebarron left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm; just an overly verbose comment

@kylebarron
kylebarron enabled auto-merge (squash) October 21, 2026 15:02
@kylebarron
kylebarron disabled auto-merge October 21, 2026 15:06
@kylebarron
kylebarron merged commit 86b4cd9 into main Oct 21, 2026
3 checks passed
@kylebarron
kylebarron deleted the kyle/multi-cog-boundless-false branch October 21, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant