Skip to content

geotiff: tiepoint-only georef silently drops origin (reports has_georef=True at 0,0) #1750

@brendancol

Description

@brendancol

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions