Reason or Problem
Epic #2341 names "overview reads lose CRS/transform/nodata metadata" as a priority risk. The existing overview tests under xrspatial/geotiff/tests/ (e.g. test_cog_overview_nodata_1613.py, test_dask_overview_level.py, test_cog_cubic_overview_nodata_1623.py) assert pixel correctness or specific nodata behaviour, but not full metadata survival on the overview output, and not parity between internal overviews (COG) and external .ovr sidecars.
Proposal
Add xrspatial/geotiff/tests/test_release_gate_overview_sidecar_metadata_2341.py.
Two parametrized test groups:
Internal overviews (COG): for a COG fixture with overviews at levels 2 and 4, open at the base level and at each overview level via eager and dask. Assert:
attrs['crs'], attrs['crs_wkt'], attrs['georef_status'], attrs['raster_type'], attrs['nodata'], attrs['masked_nodata'] are equal across all three levels (overview reads do not lose or rewrite the contract).
attrs['transform'] scales correctly (pixel size doubles at each level, origin unchanged).
External .ovr sidecar: for a fixture with an external .ovr, read the base raster + the overview level via the sidecar path. Assert the same metadata-survival contract as above.
Assertions inlined per-file. Add a row to docs/source/reference/release_gate_geotiff.rst under "Sidecar and overview interactions" citing the new file.
Stakeholders and Impacts
Touches one new test file. Reads fixtures already present in xrspatial/geotiff/tests/golden_corpus/ where available; if a .ovr sidecar fixture does not exist yet, build one in-test using the existing fixture-construction helpers.
Out of scope: pixel-correctness of resampling kernels (already covered by the cubic/nodata tests), VRT mosaics (epic #2342).
Drawbacks
Building an .ovr sidecar in-test couples the test to the writer path; if the writer regresses, this test breaks too. That is acceptable — the test is part of the release gate, so any writer-side breakage is in scope to surface.
Alternatives
- Limit to COG internal overviews and skip sidecars in this PR. Rejected: the epic explicitly names sidecar reads as a release-promised path.
Additional Notes or Context
Parent epic: #2341. PR 3 of 5.
Reason or Problem
Epic #2341 names "overview reads lose CRS/transform/nodata metadata" as a priority risk. The existing overview tests under
xrspatial/geotiff/tests/(e.g.test_cog_overview_nodata_1613.py,test_dask_overview_level.py,test_cog_cubic_overview_nodata_1623.py) assert pixel correctness or specific nodata behaviour, but not full metadata survival on the overview output, and not parity between internal overviews (COG) and external.ovrsidecars.Proposal
Add
xrspatial/geotiff/tests/test_release_gate_overview_sidecar_metadata_2341.py.Two parametrized test groups:
Internal overviews (COG): for a COG fixture with overviews at levels 2 and 4, open at the base level and at each overview level via eager and dask. Assert:
attrs['crs'],attrs['crs_wkt'],attrs['georef_status'],attrs['raster_type'],attrs['nodata'],attrs['masked_nodata']are equal across all three levels (overview reads do not lose or rewrite the contract).attrs['transform']scales correctly (pixel size doubles at each level, origin unchanged).External
.ovrsidecar: for a fixture with an external.ovr, read the base raster + the overview level via the sidecar path. Assert the same metadata-survival contract as above.Assertions inlined per-file. Add a row to
docs/source/reference/release_gate_geotiff.rstunder "Sidecar and overview interactions" citing the new file.Stakeholders and Impacts
Touches one new test file. Reads fixtures already present in
xrspatial/geotiff/tests/golden_corpus/where available; if a.ovrsidecar fixture does not exist yet, build one in-test using the existing fixture-construction helpers.Out of scope: pixel-correctness of resampling kernels (already covered by the cubic/nodata tests), VRT mosaics (epic #2342).
Drawbacks
Building an
.ovrsidecar in-test couples the test to the writer path; if the writer regresses, this test breaks too. That is acceptable — the test is part of the release gate, so any writer-side breakage is in scope to surface.Alternatives
Additional Notes or Context
Parent epic: #2341. PR 3 of 5.