This changes aggregate_spatial to use a boolean mask, similar to the polygon drill method shown here.
Input/output mapping doesn't change, with larger rasters the aggregate_spatial function (building the crop list) becomes quite a bit faster and most importantly, the mask doesn't kill workers' memory anymore. We still have the problem that building the croplist this way eventually runs out of memory, but this is an improvement.
In lieu of a proper testing env (looking at you #99!), here's a notebook to validate these claims:
validate_polygon_drill.zip
This changes aggregate_spatial to use a boolean mask, similar to the polygon drill method shown here.
Input/output mapping doesn't change, with larger rasters the
aggregate_spatial
function (building the crop list) becomes quite a bit faster and most importantly, the mask doesn't kill workers' memory anymore. We still have the problem that building the croplist this way eventually runs out of memory, but this is an improvement.In lieu of a proper testing env (looking at you #99!), here's a notebook to validate these claims: validate_polygon_drill.zip