Hi Reut
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": i
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"]e0]u"_links"]""quicklook"]i"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:{outpute'features']e0]u'properties']p'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.
If you need anything else explained then just let us know!
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.