Filter _time/_source companion tiles from GGGS value-tile scans (#112)#113
Merged
Conversation
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>
…pt upper-case ext (#112)
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.
Closes #112
Summary
The GGGS tile layer globbed
*.tif/*.tiffwith no companion-suffix filter, so the bathy/MBES stores' companion tiles (<level>_<row>_<col>_time.tifInt64,<level>_<row>_<col>_source.tifuint16) were scanned as renderable value tiles → garbage renders. This filters every scan site to the base value tile only.src/camp2/raster/gggs_tile_util.h— inlineisValueTile(const QString& filename): an anchored, full-match positive pattern^\d+_\d+_\d+\.tiff?$(case-insensitive, to mirror the*.tif/*.tiffglob). Positive-match means future companion suffixes are excluded for free — no denylist to maintain.GggsTileLayer::loadDirectory(),GggsTileLayer::rescan(), andGggsStoreSource::dirHasTifs(). (The pre-Stores layer redesign: store-tree browser → flat selectable display layers (band + colormap + order) #104gggs_store_layer.cppsites from the issue body are gone — that file was retired by Stores layer redesign: store-tree browser → flat selectable display layers (band + colormap + order) #104; scan logic moved toGggsStoreSource.)gggs_tile.cppalready readsGetRasterBand(1)generically; this is purely the directory-scan companion issue.Tests (extended existing targets; no new file)
test_catalog_source.cpp— a tile-set dir with base +_time+_sourcecompanions discovers as a leaf; a dir of companions alone is pruned.test_gggs_rescan.cpp— aGggsTileLayerover base + companions loads exactly one tile (companions written at a disjoint extent so they'd widensceneBounds()if loaded);rescan()ignores companions landing later.test_gggs_tile.cpp—IsValueTileNameGrammarpins the predicate directly (accepts 3-group.tif/.tiffincl. 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-coderound (Standard, approved, 0 must-fix) — two independent adversarial passes confirmed the regex drops no legitimate value tile and the three sites are the complete*.tifscan 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 AgentModel:
Claude Opus 4.8