Skip to content

Imagery: MapTiler Satellite fallback outside IGN.fr and SwissImage coverage - #165

Merged
xfischer merged 1 commit into
masterfrom
feat/imagery-fallback
Nov 24, 2026
Merged

xfischer merged 1 commit into
masterfrom
feat/imagery-fallback

Conversation

@xfischer

Copy link
Copy Markdown
Member

Why

A tile outside a national orthophoto coverage made the whole imagery download fail, so any area touching the sea or a border failed with IGN.fr or SwissImage:

  • IGN.fr answers 404 outside France (max zoom 19 is correct; checked against the WMTS capabilities and real tiles).
  • SwissImage answers 400 {"message":"Tile out of bounds …"} beyond its extent (it does serve real cross-border photos near the border; those are kept).

What

  • ImageryProvider.FallbackProvider: on a 404/400 for a tile, DownloadTilesAsync fetches the same z/x/y from the fallback. MapTiler's 512 px tiles are resized when the texture is built (existing LoadTile / TileDecoder behaviour).
  • TileRange.FallbackProviderUsed tells callers to add the fallback's attribution; the download logs how many tiles came from it.
  • IGN.fr and SwissImage fall back to MapTilerSatellite (needs the MapTilerKey secret).
  • IGN.es has no fallback: outside Spain it answers 200 with its own low-resolution filler, which can't be told apart reliably from real tiles by size.
  • Providers without a fallback still fail on a missing tile, as before.

Tests

ImageryFallbackTests (stub HTTP handler): 404 and 400 fall back, no fallback when every tile is found, no fallback configured still throws, predefined wiring.

Companion WebAPI PR adds the attribution.

🤖 Generated with Claude Code

…e coverage

A tile outside a national orthophoto coverage made the whole download
fail: IGN.fr answers 404 (sea, borders), SwissImage 400 "Tile out of
bounds". ImageryProvider.FallbackProvider now fetches the same z/x/y
from another provider (tiles of another size are resized when the
texture is built), and TileRange.FallbackProviderUsed tells the caller
to add its attribution.

IGN.es keeps no fallback: outside Spain it answers 200 with its own
low-resolution filler, which can't be told apart reliably.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xfischer
xfischer merged commit 07b6533 into master Nov 24, 2026
3 checks passed
@xfischer
xfischer deleted the feat/imagery-fallback branch November 24, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant