average Resampling auf Binärmaske liefert falsches Ergebnis
Am 26.03.2020 um 17:19 schrieb Gideon Hussels:
Hey Andreas,
ich schreibe aktuell an meiner Masterarbeit, habe dafür einige Rasterdaten und bin dabei auf ein Problem gestoßen: Ich habe ein Raster mit Binärdaten, dessen Inhalt ich gern in ein niedriger aufgelöstes Raster aggregieren würde (Zielwert: average). Das habe ich mit der EnMAP-Box-Funktion Spatial Resampling (Raster) probiert, allerdings enthält das ausgegebene Raster nicht die Durchschnittswerte, bzw. rundet dabei scheinbar konsequent auf 0 oder 1 ab bzw. auf.
Das Problem tritt in QGIS 3.12.0 mit der Box-Version 3.5.20191112T1029.MASTER auf und ließ sich auch mit der aktuelleren Developer-Version nicht lösen. Ich habe mit Franz Schug gesprochen, der mich an Dich verwiesen hat und meinte, das Problem hätte er auch schon mal gehabt.
Wenn Du einen Workaround o.ä. hast, wäre das sehr hilfreich.
Viele Grüße,
Gideon
Comments (7)
-
reporter -
reporter - changed version to 3.10
-
reporter - removed version
Removing version: 3.10 (automated comment)
-
reporter - changed milestone to 3.10 (Feature)
- marked as enhancement
-
reporter - marked as critical
-
reporter This should be a lightweight solution when implemented via an intermediate VRT that simply sets the working type.
The working data type stored in the VRT seams to be ignored by the GDAL resampling. After changing it to GTiff, it worked. So this isn’t the light-weight version I hoped for, but it works.
-
reporter - changed status to resolved
resolves
#388→ <<cset 72ee251994cc>>
- Log in to comment
Even the new “Translate raster layer” algorithm is not producing correct results, when aggregating (i.e. Average resampling) a binary mask into a coarser resolution. It seams to be not sufficient to use Float32 as destination data type.
I will introduce a “Working data type” that will overwrite the source type before applying the resampling. This should be a lightweight solution when implemented via an intermediate VRT that simply sets the working type.