Closed dugalh closed 2 weeks ago
Are RPC pixel coordinates always tied to pixel centers, even when the TIFF file has area_or_point=area
metadata like qb2_basic1b.tif has?
Are RPC pixel coordinates always tied to pixel centers, even when the TIFF file has
area_or_point=area
metadata like qb2_basic1b.tif has?
yes, at least that's how GDAL implements it. The suggested fix by the OP is correct, and I'm just about to submit a PR with it.
What is the bug?
I think
gdal_translate
does not account for RPC pixel coordinates being relative to the pixel center when adjusting RPC line/sample offsets. The resulting error increases with resolution scaling.Steps to reproduce the issue
Using this image.
I see a ~0.5 pixel offset between
gdal_ds_rpc_warp.tif
andsrc_rpc_warp.tif
if I view them in a GIS.If I reproduce the downsampled image with Rasterio but using what I think is the correct RPC adjustment:
And orthorectify with
gdal_warp
:Then
user_ds_rpc_warp.tif
overlayssrc_rpc_warp.tif
correctly.Versions and provenance
conda-forge GDAL 3.9.1, released 2024/06/22
Additional context
No response