Skip to content

[scripts] Treat missing legacy raster CRS as a warning - #108

Merged
phantom-branch merged 5 commits into
mainfrom
fix/allow-unreferenced-legacy-flt
Oct 14, 2026
Merged

phantom-branch merged 5 commits into
mainfrom
fix/allow-unreferenced-legacy-flt

Conversation

@Chain-Frost

Copy link
Copy Markdown
Owner

Problem

Legacy TUFLOW FLT and ASC outputs may omit .prj files. PR #107's strict CRS check incorrectly reports those as mismatches even when cell values, NoData masks, and grid alignment are identical.

Change

  • Compare declared CRS definitions only when both files have one. A disagreement between two declared CRSs still fails validation.
  • When either/both rasters omit CRS metadata, continue checking all raster values, masks, dimensions and grid transform; after a successful comparison mark the result as MATCH_CRS_UNVERIFIED (eligible for the deletion proposal, with explicit uncertainty).
  • Split actual errors from missing-CRS warnings. Add non-overwriting tuflow_raster_conversion_warnings.csv; include status and warning columns on proposed deletions.
  • No change to TIF-newer requirement, explicit delete confirmation, metadata safeguards, symlink checks, or retention of .prj files.
  • Document the distinction in the TUFLOW scripts README.

Tests

  • New tests for FLT/ASC with missing source CRS but declared TIF CRS, both rasters missing CRS, TIF CRS missing, declared CRS disagreement, genuine pixel mismatch when CRS is missing, and confirmed deletion of a warning candidate.
  • Existing synthetic raster test suite retained.

Caution

A warning indicates that the spatial reference is not independently proven, even when stored grid geometry and pixel values match. Review any warning-labelled deletion candidates before approving deletion. No project data was accessed or changed.

@phantom-branch
phantom-branch marked this pull request as ready for review October 14, 2026 16:09
@phantom-branch
phantom-branch merged commit c4ede82 into main Oct 14, 2026
3 checks passed
@Chain-Frost
Chain-Frost deleted the fix/allow-unreferenced-legacy-flt branch October 15, 2026 17:45
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.

2 participants