Skip to content

Change algorithm for summarizing values in the portion of a raster dataset that is covered by a polygon (rasterio -> exactextract)#175

Open
CyrilThebault wants to merge 1 commit intoCH-Earth:mainfrom
CyrilThebault:main
Open

Change algorithm for summarizing values in the portion of a raster dataset that is covered by a polygon (rasterio -> exactextract)#175
CyrilThebault wants to merge 1 commit intoCH-Earth:mainfrom
CyrilThebault:main

Conversation

@CyrilThebault
Copy link
Copy Markdown
Contributor

Until now, rasterio was used to count the number of pixel in each sub-catchments with the function zonal_stats. This algorithm can handle that in 2 different way: either by including all pixels that touch the sub-catchment, or include only those whose centroids fall within the sub-catchment. Both of these methods can be problematic for very small sub-catchments because zonal_stats doesn't handle fraction of pixels. To overcome this limitation I suggest using the package exactextract (https://isciences.github.io/exactextract/) which is a library for extracting and summarizing the values in the portion of a raster dataset that is covered by a polygon (and handle fraction of pixels).

…taset that is covered by a polygon (rasterio -> exactextract)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant