Skip to content

geotiff: VRT ResampleAlg is parsed but ignored (silent nearest-neighbour fallback) #1751

@brendancol

Description

@brendancol

Describe the bug

ComplexSource in read_vrt parses <ResampleAlg> (xrspatial/geotiff/_vrt.py:356-360) and stores it on the source record. The resample step at xrspatial/geotiff/_vrt.py:798-804 always calls _resample_nearest() when SrcRect and DstRect differ, regardless of the parsed algorithm.

A VRT requesting Bilinear, Cubic, Average, or Mode returns nearest-neighbour pixels with no warning. Downstream analytics see numerically different output from GDAL with no indication of why.

Expected behavior

At minimum, raise NotImplementedError (or warn) when resample_alg is set to anything other than Nearest / NEAR / None. The error message should name the requested algorithm and point at this issue.

If implementation scope allows, add bilinear and cubic resampling.

References

  • xrspatial/geotiff/_vrt.py:356 (parse site)
  • xrspatial/geotiff/_vrt.py:798 (resample call site)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions