As noted in #267, the previous strategy of casting all integers to int64 can be undesirable.
This PR changes the strategy to use the dtype argument to any numpy methods that are susceptible to integer overflow (sum, mean). This allows the aggregate function to accumulate values in a "safe" integer type without casting all of the raster data.
Should be a small performance boost if you're using 16 or 32 bit integers.
As noted in #267, the previous strategy of casting all integers to int64 can be undesirable.
This PR changes the strategy to use the
dtype
argument to any numpy methods that are susceptible to integer overflow (sum, mean). This allows the aggregate function to accumulate values in a "safe" integer type without casting all of the raster data.Should be a small performance boost if you're using 16 or 32 bit integers.
Thanks @maxfenv and @groutr
Closes #267