Skip to content

feat(examples): outline each COG in the naip-mosaic example - #864

Merged
kylebarron merged 2 commits into
mainfrom
kyle/naip-cog-gridlines
Nov 6, 2026
Merged

kylebarron merged 2 commits into
mainfrom
kyle/naip-cog-gridlines

Conversation

@kylebarron

@kylebarron kylebarron commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

before:

before-z10

after:

after-z10

Note

This PR was written by Claude (Claude Code), not by @kylebarron.

Change

Adds an "Outline each COG" checkbox to the naip-mosaic example, off by default. When it's on, a subdued red outline is drawn around each opened COG, above the whole mosaic. This shows that the imagery is many separate COGs mosaicked together.

Each outline is the opened source's tilesetDescriptor.projectedBounds projected to WGS84, so it follows the image's real edge. NAIP COGs are in UTM, and the STAC bbox would miss that edge by more than 100 m at the mosaic's west side, where UTM grid convergence is about 1°. The app collects the outlines through onSourceLoad and onSourceUnload, and draws them in one PathLayer over the MosaicLayer.

Each NAIP image extends 300-430 m past its 3.75' quarter-quad cell, so neighboring images overlap and every boundary shows as a pair of lines. A note under the checkbox says so.

Some color changes inside one outline are not COG edges. NAIP builds each image from several aerial frames, and the seamlines between them often follow roads.

Testing

  • pnpm --dir examples/naip-mosaic typecheck and biome check pass.
  • Checked in headed Chrome. Zoomed in at the mosaic's east boundary, the outline sits on the image edge. No new console messages.

Closes #845

🤖 Written by Claude Code

A checkbox draws each COG's outline, showing that the imagery is many
separate COGs mosaicked together. The outline comes from the opened
source's projected bounds, so it follows the image's UTM edge rather
than its WGS84 bbox.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the feat label Nov 6, 2026
Drawn after each item's imagery, the outlines hid one another where COGs
overlap and formed an irregular pattern. One PathLayer over the mosaic,
fed by onSourceLoad and onSourceUnload, draws every opened COG's outline
in a subdued red. Neighboring NAIP images overlap by a few hundred
meters, so each boundary is a pair of lines; the panel says so.

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.

✅

@kylebarron
kylebarron merged commit a72d7a1 into main Nov 6, 2026
4 checks passed
@kylebarron
kylebarron deleted the kyle/naip-cog-gridlines branch November 6, 2026 17:54
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.

In naip-mosaic app, optionally overlay COG gridlines

1 participant