Open-EO / openeo-processes-python

A Python representation of (most) openEO processes
Apache License 2.0
11 stars 4 forks source link

Use boolean mask in `aggregate_spatial` #167

Closed LukeWeidenwalker closed 2 years ago

LukeWeidenwalker commented 2 years ago

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