[gdal-dev] Issue with resampling algorithm in gdal_array.DatasetReadAsArray python wrapper function

Even Rouault even.rouault at spatialys.com
Thu Feb 10 05:06:40 PST 2022


Miguel,
>
> I am trying to use the gdal_array.DatasetReadAsArray function to 
> extract a window from a 3B gtif file by indicating the dataset, the 
> upper left corner image coordinates, the window size (256x256) at 
> actual scale in the dataset, the desired buffer size (larger than 
> actual size 341x341) and indicating the resample algorithm.
> It only works if I select the NearestNeighbour algorithm. In the rest 
> of the cases (Bilinear, bicubic, Lanczos, etc...) what the function 
> returns me is a mosaic that repeats 9 times (3x3) the original image 
> in reduced size.
>
> What am I doing wrong or what have I interpreted incorrectly in the API?

First you should try with the latest release (3.4.1). If you can still 
reproduce the issue, then strip down your code to a minimum standalone 
reproducer script (using only GDAL & numpy) and with a minimum 
reproducing dataset, and provide it here.

Even

>
> Thanks & Best regards
>
> Miguel A. Manso
>
> MERCATOR Research Group
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.



More information about the gdal-dev mailing list