We are requesting images from PlanetScope via search API for the region present in the KML [SB.kml] of Saldanha Bay in South Africa.
SB.kml (1.5 KB)
The following is the python code for searching the image tiles
def _search_tiles(geometry, record_dates, max_cloud_coverage=100, features_fetch_count = 200):
url = "https://services.sentinel-hub.com/api/v1/dataimport/search"
if isinstance(record_dates, str) or isinstance(record_dates, datetime):
record_dates = [record_dates]
assert isinstance(record_dates, list) or isinstance(record_dates, tuple), "records_dates should be a list or enumerable"
record_dates_obj = list(map(lambda record_date: record_date if isinstance(record_date, datetime) else datetime.strptime(record_date, "%Y-%m-%d"), record_dates))
record_dates_obj.sort()
start_date = record_dates_obj[0]
end_date = record_dates_obj[-1]
coords = list(map(lambda poly: list(map(lambda x: [round(x[0], 4), round(x[1], 4)], poly.coords)), geometry.exterior))
payload = {
"provider": "PLANET",
"planetApiKey": planet_key,
"bounds": {
"geometry": {
"type": "Polygon",
"coordinates": coords
},
},
"data": [
{
"dataFilter": {
"timeRange": {
"from": start_date.strftime("%Y-%m-%dT00:00:00.000Z"),
"to": end_date.strftime("%Y-%m-%dT23:59:59.000Z")
},
"maxCloudCoverage": max_cloud_coverage,
"nativeFilter": {
"type": "AndFilter",
"config":[
{
"type": "StringInFilter",
"field_name": "quality_category",
"config": [
"standard"
]
},
{
"type" : "PermissionFilter",
"config" : [ "assets:download" ]
},
{
"type" : "AssetFilter",
"config" : [ "analytic" ]
}
]
}
},
"itemType": "PSScene4Band"
}
]
}
token = get_token(oauth)
response = oauth.post(url, json=payload, params={'count': features_fetch_count}, headers= {"Authorization" : "Bearer {}".format(token)})
results = response.json()
features = results.get('features', [])
nextToken = results['links'].get('nextToken')
next_link = results['links'].get('next')
while next_link is not None:
response = oauth.post(next_link, json=payload, params={'count': features_fetch_count,
'viewtoken': nextToken}, headers={"Authorization" : "Bearer {}".format(token)})
results = response.json()
nextToken = results['links'].get('nextToken')
next_link = results['links'].get('next')
features.extend(results.get('features', []))
return features
on requesting dates for period 2020-02-04 to 2020-02-11 It returned tiles info of date 2020-02-08 only tiles for date 5nd Feb 2020 and 10 Feb 2020 were not populated in the search result while the result are available in the Planet Explorer panel.
The image in the planet explorer where it shows the available dates. I have marked the dates missing in search API results encircled in red.
What is the reasoning of these dates not coming in search result while we have ensured that max cloud 100 is allowed?