isciences / exactextract

Fast and accurate raster zonal statistics
Apache License 2.0
255 stars 33 forks source link

Call exactextract from Python #7

Closed giacfalk closed 7 months ago

giacfalk commented 5 years ago

Is there a way to call the algorithm from Python? I have see there was a porting for R https://github.com/isciences/exactextractr, but I wonder if it would be possible to call it from Python (or even PyQGIS).

dbaston commented 5 years ago

Nothing except subprocess at this point.

rsignell-usgs commented 2 years ago

Is there someone we could contract to add a Python wrapper?

We would also like to be able to save the weights, as we often have to calculate zonal stats for a bunch of rasters with the same foot print (e.g. a time stack of remote sensing images or model output) .

hellkite500 commented 2 years ago

@rsignell-usgs WRT coverage fraction (weights), I have been working on adding some ways to do that in my own fork (https://github.com/hellkite500/exactextract/tree/coverage-fraction). I need to rebase and clean up the work in the near future, but if this is something useful to others, I can see about putting in a PR here (and/or maybe open its own issue to discuss the implementation details...). Could you envision how you might interact with this from python, even in some pseudo code? That might help to see how to build the correct interfaces...

dbaston commented 7 months ago

Python bindings available at https://github.com/isciences/exactextract/tree/master/python. Will publish to conda-forge when the interface feels stable.