average Resampling auf Binärmaske liefert falsches Ergebnis

Issue #388 resolved
Andreas Janz created an issue

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)

  1. Andreas Janz reporter

    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.

  2. Andreas Janz 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.

  3. Log in to comment