Skip to content

Filter _time/_source companion tiles from GGGS value-tile scans (#112)#113

Merged
rolker merged 11 commits into
jazzyfrom
feature/issue-112
Jun 21, 2026
Merged

Filter _time/_source companion tiles from GGGS value-tile scans (#112)#113
rolker merged 11 commits into
jazzyfrom
feature/issue-112

Conversation

@rolker

@rolker rolker commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Closes #112

Summary

The GGGS tile layer globbed *.tif/*.tiff with no companion-suffix filter, so the bathy/MBES stores' companion tiles (<level>_<row>_<col>_time.tif Int64, <level>_<row>_<col>_source.tif uint16) were scanned as renderable value tiles → garbage renders. This filters every scan site to the base value tile only.

Tests (extended existing targets; no new file)

  • test_catalog_source.cpp — a tile-set dir with base + _time + _source companions discovers as a leaf; a dir of companions alone is pruned.
  • test_gggs_rescan.cpp — a GggsTileLayer over base + companions loads exactly one tile (companions written at a disjoint extent so they'd widen sceneBounds() if loaded); rescan() ignores companions landing later.
  • test_gggs_tile.cppIsValueTileNameGrammar pins the predicate directly (accepts 3-group .tif/.tiff incl. upper-case ext; rejects companions, 4-group names, too-few groups, non-digit groups, wrong extension, leading/trailing junk).

100 tests, 0 failures (2 pre-existing GL self-skips).

Local review

One pre-push review-code round (Standard, approved, 0 must-fix) — two independent adversarial passes confirmed the regex drops no legitimate value tile and the three sites are the complete *.tif scan set. The two optional suggestions (case-insensitive extension match + a 4-group-name rejection test) were both addressed before this PR.

Part of #175.


Authored-By: Claude Code Agent
Model: Claude Opus 4.8

Claude Code Agent and others added 11 commits June 21, 2026 15:47
Add isValueTile() helper at a single definition site (gggs_tile_util.h) and apply
at all three current scan sites (loadDirectory, rescan, dirHasTifs). Add a test
with base + _time + _source companions asserting only the base tile is enumerated.
…#112)

The bathy/MBES stores write three files per tile in one directory:
<level>_<row>_<col>.tif (value), _time.tif (Int64), and _source.tif
(uint16). The GggsTileLayer/GggsStoreSource *.tif globs matched all
three, so companions were scanned as renderable value tiles -> garbage
renders.

Add a shared inline isValueTile() in src/camp2/raster/gggs_tile_util.h
matching the anchored value-tile pattern ^\d+_\d+_\d+\.tiff?$ against
the filename, and apply it at the three scan sites: loadDirectory() and
rescan() in gggs_tile_layer.cpp, and dirHasTifs() in gggs_store_source.cpp.
A positive pattern excludes any future companion suffix for free.

Sync plan.md to as-built: resolve the two open questions (shared header;
extend existing tests), fix the ADR-0005 title, drop the spurious ADR-0006
citation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extend the existing targets (no new file/CMakeLists change):
- test_catalog_source.cpp: a tile-set dir with base + _time + _source
  companions still discovers as a leaf; a dir of only companions is not
  a tile-set.
- test_gggs_rescan.cpp: a GggsTileLayer over base + companions (written
  at a disjoint eastward extent) loads only the base tile (sceneBounds
  equals a base-only layer's); companions landing after load make
  rescan() no-op.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 21, 2026 17:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@rolker rolker merged commit 8ebc370 into jazzy Jun 21, 2026
1 check failed
@rolker rolker deleted the feature/issue-112 branch June 21, 2026 17:09
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.

GGGS tile layer: *.tif scan mis-loads _time/_source companion tiles (filter to base value tiles)

2 participants