Closed sciabolazza closed 3 months ago
This time results are similar when calculating the average, but differ significantly when calculating the total value
us_grid
has dimensions 1000x1000 but us_star
has dimensions 393x166. There are not as many values in us_star
, so the sum is lower.
Is it possible to provide more details on how exact extract creates zonal statistics?
They are documented at https://github.com/isciences/exactextract?tab=readme-ov-file#supported-statistics
Closing this for now. Please feel free to reopen if things still don't work out.
Consider the following toy example. I create the shapefile of US states, and generate a raster from this shapefile. To each pixel of the raster I associate a unique value. Then, I exact extract the sum and the average values of the pixels falling within each state:
I now try to replicate the results without asking exact extract to generate the average and total values associated to a state, but only to indicate which pixels falls within a State.
In order to make things easier, I only consider Florida.
If I compare the average and total values of pixels falling within Florida calculated by me and by exact extract in the previous exercise, things are pretty much the same:
I now try to replicate the same exercise, but this time I identify by my own which cells fall within Florida, and then I calculate their average and total value.
This time results are similar when calculating the average, but differ significantly when calculating the total value.
It could be that these differences are explained in the documentation of the package, but I failed to find them. Is it possible to provide more details on how exact extract creates zonal statistics?