You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tool should support the processing of more than one polygon at a time. Users can currently iterate over a set of polygons, building a new RestorationArea object for each polygon, but this does not take advantage of the multi-dimensional broadcasting built into xarray.
Supporting multiple polygons was pushed off because each polygon needs to have a disturbance and restoration start date set, which complicated the potential solution at the start of the project. With more things in place now in the tool now, it should be possible to figure out a way to allow multiple polygons.
Potential Solution
TDB.
The text was updated successfully, but these errors were encountered:
Simplest approach would create a RestorationArea for each polygon, then pass each RA to the metric functions. Individual polygon results would then be concatenated and returned to user. This would be slow and basically just an encapsulation of the logic that users are currently expected to employ to compute over multiple polygons.
More complex idea? Pass whole dataframe to RestorationArea then clip to each polygon and stack the arrays along a new "polygon" dim. Then pass the 5D array to the metric functions, and have them broadcast results over the band and polygon dimensions.
Difficulties?
Need to find a way to assign disturbance/reference years to each polygon dim without exploding the size of data. Maybe just a dataframe in the RestorationArea instance that maps polygon dim key to years?
To avoid exploding the size of the array by stacking (i.e do not stack many huge arrays over and over again), maybe the x/y should be removed once clipped (replaced with 0-N) so that the stacking x/y is only as large as the largest polygon being processing. Coords for each polygon could be stored in a dictionary in RestorationArea? Really not sure if this method would work for the whole ecosystem of the tool. Needs more thought.
Feature Description
The tool should support the processing of more than one polygon at a time. Users can currently iterate over a set of polygons, building a new
RestorationArea
object for each polygon, but this does not take advantage of the multi-dimensional broadcasting built into xarray.Supporting multiple polygons was pushed off because each polygon needs to have a disturbance and restoration start date set, which complicated the potential solution at the start of the project. With more things in place now in the tool now, it should be possible to figure out a way to allow multiple polygons.
Potential Solution
TDB.
The text was updated successfully, but these errors were encountered: