Skip to content

VRTWarpedDataset::IRasterIO(): honour requested resampling on rescaled reads - #15427

Open
alonfaraj wants to merge 1 commit into
OSGeo:masterfrom
alonfaraj:fix/vrtwarped-rescaled-resampling
Open

alonfaraj wants to merge 1 commit into
OSGeo:masterfrom
alonfaraj:fix/vrtwarped-rescaled-resampling

Conversation

@alonfaraj

Copy link
Copy Markdown
Contributor

What does this PR do?

Whole image read of warped VRT at a different buffer size warps directly at that size with the warp options' resampling, and ignoring the requested eResampleAlg. So reproject ! resize -r average in a pipeline gives a nearest-neighbour result. Use that shortcut only for nearest.

Repro:
(400x400 Byte, 1-pixel 0/200 stripes, EPSG:32631)

gdal raster pipeline read in.tif ! reproject --dst-crs EPSG:3857 ! resize --size 100,100 -r average ! write out.tif

Interior of out.tif:
before min=0 max=200
after min=88 max=111 (same as running reproject and resize separately)

What are related issues/pull requests?

AI tool usage

  • AI (Y-a-t-il-un-Copilot-dans-l'avion, Chat-j'ai-pété, Jean-Claude Dusse or something similar) supported my development of this PR. See our policy about AI tool use. Use of AI tools must be indicated.

Tasklist

  • Make sure code is correctly formatted (cf pre-commit configuration)
  • Add test case(s)
  • Add documentation
  • Updated Python API documentation (swig/include/python/docs/)
  • Review
  • Adjust for comments
  • All CI builds and checks have passed
  • ADD YOUR TASKS HERE

Environment

Provide environment details, if relevant:

  • OS: Ubuntu 26.04
  • Compiler: gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant