OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.86k stars 2.53k forks source link

Fill NODATA does not fill all NODATA #2334

Closed ghost closed 4 years ago

ghost commented 4 years ago

I am trying to fill NODATA although I do not know what values they are represented in. So running: gdal_fillnodata.py on a raster file, did not give the desirable results, as not all NODATA cells are filled. The command I picked from QGis (that is directly using gdal gdal_fillnodata.py) then tried to run in Windows bash like:

FOR %i IN (C:\Users\UBU\Dowloads\NODATA\*.tif) DO "C:/Program Files/QGIS 3.12/bin/python3.exe" "C:/Program Files/QGIS 3.12/apps/Python37/Scripts/gdal_fillnodata.py" -md 10 -b 4 -of GTiff "%i" "%i.tiff"

But this does not change anything I guess.

Result:

Using Raster object from acrpy provided by Esri, I am testing nan values in the file in input and in output:

np.count_nonzero(np.isnan(RasterToNumPyArray(Raster('s5p_no2_20180917T164548_20180923T182508.tif')))) 600 np.count_nonzero(np.isnan(RasterToNumPyArray(Raster('20180917T164548_20180923T182508.tif.tiff')))) 50

So I still have some NODATA cells. Is this normal behavior ? and why if yes.

jratike80 commented 4 years ago

Perhaps you should increase the max_distance value https://gdal.org/programs/gdal_fillnodata.html.

Questions about how to use GDAL should go to the gdal-dev mailing list, not to bug tracker.