Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for partial pixel overlap in Zonal Statistics #38273

Open
jfbourdon opened this issue Aug 13, 2020 · 2 comments
Open

Option for partial pixel overlap in Zonal Statistics #38273

jfbourdon opened this issue Aug 13, 2020 · 2 comments
Labels
Feature Request Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@jfbourdon
Copy link
Contributor

jfbourdon commented Aug 13, 2020

Feature description.
The current native:zonalstatistics only considers pixels which have their centroïd overlapping the polygons and computes statistics as if all pixels have the same weight. It could be useful if an option was available to consider the proportion of area covered for each pixel as weight for the statistics. The count stats would then be fractional also.

Additional context
I must add that there is currently either a hidden feature or a bug for polygons covering the centroïd of one pixel or none at all. In that case, the tool works as I suggest and uses the fractional area to compute the stats. It seems that there has been a bug about that in past (see #25058).

@gioman gioman added the Processing Relating to QGIS Processing framework or individual Processing algorithms label Aug 13, 2020
@root676
Copy link
Contributor

root676 commented Aug 14, 2020

I am currently thinking about reworking the whole vector based zonal statistic algorithms in order to make them executable in a background thread. I would be up to include the requested functionality in exchange for a small funding. If you are interested and this is an option for you, just e-mail me: clemens.raffler@gmail.com

@kgjenkins
Copy link
Sponsor Contributor

FYI, exactextract provides a more robust zonal statistics calculation that takes partial pixel overlaps into account, and there is currently an experimental QGIS plugin Zonal Exact Extract that uses the exactextract library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

No branches or pull requests

4 participants