OCHA-DAP/ocha-anticipy

Drop `compute_raster_stats`

Opened this issue · 2 comments

With rasterstats.zonal_stats we were worried about this issue which has now been explained.

Recently @PaulineNimo found that rasterstats was much faster than compute_raster_stats (maybe you can elaborate Pauline), at least for files that were read in at the time of zonal stat computation. So I'm wondering if we should just drop this functionality and let rasterstats do it better.

Interesting find! Seems like if rasterstats is faster, we should just shift to that. Do we need to add that functionality to automatically transpose, say have a function oap.zonal_stats that does that and then calls rasterstats? Interested to hear how Pauline has done it, good find.

Do we need to add that functionality to automatically transpose, say have a function oap.zonal_stats that does that and then calls rasterstats?

Yeah great idea! Maybe I wouldn't have it call rasterstats to avoid the dependency, but a function that outputs the values in the right way to be able to do so easily.