[gdal-dev] Downsampling with gdal_translate and overviews

Julien Michel julien.michel at cnes.fr
Fri Jul 21 04:49:02 PDT 2017


Hi all,

Yesterday I experienced a strange issue while downsampling image with 
gdal_translate -tr option (-filter is average). I was downsampling data 
before feeding them into a stereo reconstruction processing chain, and 
the output DSM had a clear and straight cutline in the middle of the 
image, as if the whole south part of the image was several meters lower 
than the north part. I compared the downsampled images with an in-house 
downsampling tool, and found indeed that whole rectangular portions of 
the gdal_translate output were a bit shifted (maybe less than a pixel, 
but that counts when doing stereo reconstruction). At one point I 
started suspecting my .ovr files, and indeed removing them made the 
problem disappear (I was subsampling by 10, whereas overviews have been 
generated with the classical 2 4 8 16 32 ... progression). So here are 
my questions :

- Is gdal_translate using the nearest overview level as a start for 
resampling ?

- Is there a way to prevent that (other than removing the ovr file) ?

- Is it expected than the resampling yields artifacts when ovr files are 
present ?

Thanks a lot for your help,

Regards,

Julien

-- 
Julien MICHEL
CNES - DSO/SI/2A



More information about the gdal-dev mailing list