Access commercial data for very dispersed polygons

Hello!

I have27 very small polygons that are dispersed over very large area (like the whole USA).
I want to access airbus imagery for these images.
As first step, I have upload my polygons as GeoJSON to the request builder, as shown in the tutorial, and I get error :

As I understand this error, I might have too many vertices on my polygons (?) however, I can’t “lose” more vertices on my polygon.

Hence, and based on the tutorial I have watched , I would like to ask :

  1. What is the best way to deal with this error ? Will I have to go polygon by polygon? or are there any additional solutions?
  2. On the tutorial, The way to access airbus imagery was using the request builder and checking them manually. In my case, on one hand, I want to check which images I purchase, on the other hand, I wonder if there is more “smart” or “efficient” way to do that. I’m used to work with the process API, but seems like it’s not a good idea as I have limited amount of images I can purchase from Airbus. Hence, I would like to ask
    if you have additional recommendations for how to tackle this situation - having small polygons with large bbox? Is there any way to automate the process of creating the image collection of airbus without checking images one by one? or at least decrease the manual work.

Thanks :slight_smile:

Reut

Hi Reut :slight_smile:

I would advise that it is better to manually search by each polygon as it is important to find the right image when purchasing commercial imagery. Firstly, imagery may not be available on the “ideal” date that you request as the platforms are tasked, targeting certain AOIs, in comparison to Sentinel-2 which systematically collects data over most of the world’s land surfaces.

In addition, it is worth your time to check the previews of the imagery as while the cloud cover percentage of a scene is available through the metadata, even a small percentage could mean that your AOI is covered by cloud.

To help you be more efficient you can use Python to run through your polygons slightly quicker. To get you started, below are a few lines of code that fetch a Quicklook image for a single polygon; you can adapt the code to run it for all your polygons.

You can define your AOI, Time Range and other parameters like this:


# Specify Geometry of AOI
geometry = {
      "type": "Polygon",
      "coordinates": [
        [
          [
            12.480207,
            41.908026
          ],
          [
            12.499422,
            41.90726
          ],
          [
            12.515034,
            41.883876
          ],
          [
            12.486555,
            41.87902
          ],
          [
            12.480207,
            41.908026
          ]
        ]
      ]
    }

# Max Cloud cover in %
maxCC = 25

# Max incidence angle in degrees
maxINC = 54

start_date = "2022-04-15"
end_date = "2022-05-15"

And then run your request like this:

url = "https://services.sentinel-hub.com/api/v1/dataimport/search"

settings = {
    "provider": "AIRBUS",
    "bounds": {"geometry": geometry},
    "data": [
        {
            "constellation": "PHR",
            "dataFilter": {
                "maxCloudCoverage": maxCC,
                "maxIncidenceAngle": maxINC,
                "timeRange": {
                    "from": f"{start_date}T00:00:00Z",
                    "to": f"{end_date}T23:59:59Z",
                },
            },
        }
    ],
}

# The following is run after having fetched a Oauth token (not shown in this forum post)
response = oauth.post(url, json=settings)
output = response.json()

Then using the metadata in the response you can also plot the Quicklook image by:

# Fetch the quicklook URL for the first image in your search list
# We are using the "Image" library from PIL
url_ql = output["features"][0]["_links"]["quicklook"]["href"]
im = Image.open(requests.get(url_ql, stream=True).raw)

fig, ax = plt.subplots(1,1, figsize=(10,8))
ax.imshow(im)
plt.title(f"Image date:{output['features'][0]['properties']['acquisitionDate']}")

To make it easier for you, you can find the full example code in a Github gist.

I hope this helps streamline the process a little bit for you. :slight_smile:

If you need anything else explained then just let us know!

1 Like

Thank you very much for your answer.
If I understand correct, the script can help me visualize the images quickly outside the request builder, but if I want to download it, I can add after this part an API request to access the image.
Right?
but still need to be careful with which image I select.