geotiff: hotfix require_transform_for_georeferenced for int-coord arrays#1969
Merged
Conversation
…el parity with coords_to_transform) PR #1953 added require_transform_for_georeferenced which raises when both spatial dims are in da.coords and the resolved transform is None. PR #1954 made coords_to_transform return None for integer x/y coords as the no-georef sentinel (#1949). Their interaction broke writer calls against int-coord arrays. Mirror the int/uint exemption from coords_to_transform inside the guard so the writer accepts int coords silently. Also fixes the error wording, which previously claimed "both axes are degenerate (1x1)" even when the array was not 1x1. Adds a regression test covering 2D and 3D int-coord round-trips.
This was referenced May 15, 2026
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.
Summary
PR #1954 made
coords_to_transformreturnNonefor integer x/y coords (no-georef sentinel for #1949 round-trips). PR #1953 addedrequire_transform_for_georeferencedwhich raises when both spatial dims are inda.coordsand the resolved transform isNone. Together they break every writer call that uses int coords, including theto_geotiffand VRT paths exercised bytest_vrt_int_nodata_1564.py,test_metadata_round_trip_1484.py,test_georef_edges.py, andtest_features.py(11 failures across the matrix).Fix
Mirror the int/uint exemption from
coords_to_transforminsiderequire_transform_for_georeferenced. Int coord dtypes are the read-side no-georef signal; the writer should accept them silently instead of fail-closing.Also tightens the error wording, which previously said "both axes are degenerate (1x1)" even when the array was non-degenerate.
Test plan
test_int_coords_round_trip_hotfix_1962.pycovers 2D and 3D int-coord round-trips.test_features.py::TestExtraTags::test_extra_tags_round_triptest_georef_edges.py::TestNonGeoreferencedRead::test_round_trip_preserves_pixelstest_metadata_round_trip_1484.py::TestTagPassThrough(3 tests)test_vrt_int_nodata_1564.py(6 tests)-k "georef or coord or transform"sweep stays green.