List polygons or processing requests

To have more overview over polygons and processing requests within your user plan, you can list them. To do so, you call the list method on the Polygon or ProcessingRequest classes.

ProcessingRequest class is a parent class of the classes you would normally use for processing requests (such as Observation or FieldZonation). Calling the list method will automatically return correct subclasses.

Say we’ve already authenticated.

[1]:
from dynacrop import Polygon, ProcessingRequest

Calling the list method will return an iterator. You can loop through it or filter it to find the desired object.

Note that filtering can take a lot of time.

[2]:
my_polygons = Polygon.list()


for mp, i in zip(my_polygons, range(5)):
    print(mp, mp.max_mean_cloud_cover)

#  or for example list(filter(lambda mp: mp.id == 2, my_polygons))
<dynacrop.Polygon 46673> 0.3
<dynacrop.Polygon 46831> 1.0
<dynacrop.Polygon 47108> 0.3
<dynacrop.Polygon 47230> 0.3
<dynacrop.Polygon 47300> 0.3

We can also list processing requests.

[3]:
my_prs = ProcessingRequest.list()

for mpr, i in zip(my_prs, range(5)):
    print(mpr, mpr.rendering_type)
<dynacrop.FieldZonationByMedian 426910> field_zonation_by_median
<dynacrop.FieldZonationByMedian 426911> field_zonation_by_median
<dynacrop.FieldZonationByMedian 426912> field_zonation_by_median
<dynacrop.FieldZonationByMedian 426913> field_zonation_by_median
<dynacrop.FieldZonationByMedian 426914> field_zonation_by_median