Describe the bug
_extract_transform() at xrspatial/geotiff/_geotags.py:466-468 handles the case where a TIFF carries a ModelTiepointTag but no ModelPixelScaleTag. The current branch is:
# Tiepoint without scale: still flag as georeferenced (origin known)
if tiepoint is not None:
return GeoTransform(), True
That returns the default GeoTransform() (origin (0, 0), unit pixels) with has_georef=True. The tiepoint's actual model X/Y is discarded. Downstream coordinate construction trusts has_georef=True and produces a real coordinate axis with the wrong origin, silently relocating the raster.
Expected behavior
The tiepoint encodes a real origin. Either:
- Honour the tiepoint origin: use
tp_x - tp_i * 1.0 and tp_y + tp_j * 1.0 as origin with pixel_width = 1.0, pixel_height = -1.0, documenting the unit-pixel-scale assumption; or
- Set
has_georef=False so downstream code falls back to the integer-pixel coord path used for non-georef files.
Either is acceptable. A silent (0, 0) origin is not.
References
xrspatial/geotiff/_geotags.py:466
Describe the bug
_extract_transform()atxrspatial/geotiff/_geotags.py:466-468handles the case where a TIFF carries aModelTiepointTagbut noModelPixelScaleTag. The current branch is:That returns the default
GeoTransform()(origin(0, 0), unit pixels) withhas_georef=True. The tiepoint's actual model X/Y is discarded. Downstream coordinate construction trustshas_georef=Trueand produces a real coordinate axis with the wrong origin, silently relocating the raster.Expected behavior
The tiepoint encodes a real origin. Either:
tp_x - tp_i * 1.0andtp_y + tp_j * 1.0as origin withpixel_width = 1.0,pixel_height = -1.0, documenting the unit-pixel-scale assumption; orhas_georef=Falseso downstream code falls back to the integer-pixel coord path used for non-georef files.Either is acceptable. A silent (0, 0) origin is not.
References
xrspatial/geotiff/_geotags.py:466