You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
geotiff: orientation 5-8 on georeferenced TIFFs returns wrong coords behind a warning #1765
_apply_orientation_with_geo in xrspatial/geotiff/_reader.py (~line 2260) handles TIFF Orientation tag values 5-8 (transpose, 90 CW, transverse, 90 CCW) on georeferenced files by swapping pixel_width and pixel_height in the transform and calling warnings.warn. That swap is not enough. Orientations 5-8 require a per-orientation origin shift plus a rotation that the axis-aligned GeoTransform cannot express, so the returned x/y coords are wrong while the user only sees a warning saying "may need manual adjustment".
Returning wrong georeferenced coords behind a warning is the wrong contract for this module.
Proposed fix:
When a file has crs_epsg or crs_wkt set and the Orientation tag is in {5, 6, 7, 8}, raise NotImplementedError with a message naming the orientation value and pointing at the workaround (reproject with another tool, or strip the Orientation tag).
Non-georeferenced files keep the existing axis swap. No geographic claims to violate there.
Implementing the correct affine for 5-8 needs a rotation component the rest of the reader does not carry. Failing hard is the honest option.
Activity
geotiff: gate orientation 5-8 raise on has_georef, mirror on GPU path
geotiff: refuse georeferenced TIFFs with orientation 5-8 (#1765) (#1771)
geotiff: extract GPU helpers to _backends/_gpu_helpers.py (#1884) (#1894