TransWikia.com

Unable to access and download Sentinel-2 images from Python API with the standard code

Geographic Information Systems Asked by Inshu Chauhan on May 29, 2021

products = api.query(footprint.wkt,
                     date = ('20161101', '20161116'),
                     platformname = 'Sentinel-2',
                     processinglevel = 'Level-2A',
                     cloudcoverpercentage = (0,10)
                    )
print (len(products))

Another Error while accessing sentinel data from APi python for the above same code is:

KeyError    Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/sentinelsat/sentinel.py
in _load_subquery(self, query, order_by, limit, offset)

    394     json_feed = response.json()["feed"]
--> 395     if json_feed["opensearch:totalResults"] is None:
    396 

            

We are using some unintended behavior of the server that a null is KeyError: ‘opensearch:totalResults’

During handling of the above exception, another exception occurred:

SentinelAPIError  Traceback (most recent call last)
3 frames
/usr/local/lib/python3.6/dist-packages/sentinelsat/sentinel.py in _load_subquery(self, query, order_by, limit, offset)

    401           total_results = int(json_feed["opensearch:totalResults"])
    402       except (ValueError, KeyError):
--> 403           raise SentinelAPIError("API response not valid. JSON decoding failed.", response)
    404 
    405       products = json_feed.get("entry", [])


SentinelAPIError: HTTP status 200 OK: API response not valid. JSON decoding failed.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP