As a next step to my previous question "How to calculate where raster a is not equal to raster b?", I now want to sieve (using QGIS -> Raster -> Analysis -> Sieve, or
gdal_sieve in the shell) a raster which consists of the values
The problem is: no matter what parameters I tell
gdal_sieve to use, it still returns the original raster, nothing happens.
Above you can see the raster (black pixels) that I want to sieve. Actually, this screenshot was taken immediately after the sieve algorithm ran through. You will find that nothing was sieved.
I guess this is because gdal_sieve cannot handle
NaN, so the nearest possible value always is
1 again, if it skips the
Because I want to use Zonal Statistics with this raster and some polygons afterwards, it is necessary that this raster consists just of
NaN, because I am interested in the total count of pixels with value
1 in a polygon. If I would use a raster with, say
1, it would always accumulate these two in my count column.
Does anyone have an idea how to workaround this?