Skip to content

geotiff: hotfix require_transform_for_georeferenced for int-coord arrays#1969

Merged
brendancol merged 1 commit into
mainfrom
hotfix-int-coord-require-transform
May 15, 2026
Merged

geotiff: hotfix require_transform_for_georeferenced for int-coord arrays#1969
brendancol merged 1 commit into
mainfrom
hotfix-int-coord-require-transform

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Summary

PR #1954 made coords_to_transform return None for integer x/y coords (no-georef sentinel for #1949 round-trips). PR #1953 added require_transform_for_georeferenced which raises when both spatial dims are in da.coords and the resolved transform is None. Together they break every writer call that uses int coords, including the to_geotiff and VRT paths exercised by test_vrt_int_nodata_1564.py, test_metadata_round_trip_1484.py, test_georef_edges.py, and test_features.py (11 failures across the matrix).

Fix

Mirror the int/uint exemption from coords_to_transform inside require_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

  • New regression test in test_int_coords_round_trip_hotfix_1962.py covers 2D and 3D int-coord round-trips.
  • Existing failing tests pass again:
    • test_features.py::TestExtraTags::test_extra_tags_round_trip
    • test_georef_edges.py::TestNonGeoreferencedRead::test_round_trip_preserves_pixels
    • test_metadata_round_trip_1484.py::TestTagPassThrough (3 tests)
    • test_vrt_int_nodata_1564.py (6 tests)
  • Broader -k "georef or coord or transform" sweep stays green.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant