-
Notifications
You must be signed in to change notification settings - Fork 10
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
set output data type in zonal_stats #76
Comments
Which method for zonal stats are you using? The default? |
Yes the default: |
It has actually nothing to do with the input dtype, that is preserved to the aggregated array. We need to create a rasterised version of geometries and that array is, due to masking of empty areas, being generated as float64. In #77 I am switching to float32, which should help a bit. If the memory is a concern, |
I guess the reason I am testing your package rather than using rasterio or rasterstats is the vectorized method hoping for performance improvement. So would switching to the slower iterate version would be similar to packages I already use? |
Performance-wise, the Try using the dev version of xvec installed from main, that may solve the issues you're having. But it is to be noted that the performance here comes certainly at a memory cost. |
Hi there, I've been testing zonal_stats on a large raster containing decimal values. zonal_stats wants to allocate a large array with type float64 - which is unnecessary as my input raster is float32. Would it be possible to set this dtype throughout the calculation as to avoid overuse of memory?
The text was updated successfully, but these errors were encountered: