首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用标准代码从Python访问和下载Sentinel-2图像。

无法使用标准代码从Python访问和下载Sentinel-2图像。
EN

Stack Overflow用户
提问于 2021-01-25 07:18:03
回答 1查看 276关注 0票数 1
代码语言:javascript
复制
rec = POLYGON ((597843.23 2977645.792070312, 686175.1025585937 2977645.792070312, 686175.1025585937 3112308.537736816, 597843.23 3112308.537736816, 597843.23 2977645.792070312))
products = api.query(rec,
                     date = ('20191001', '20191031'),
                     platformname = 'Sentinel-2',          
                     cloudcoverpercentage = (0,40)
                    )

上下载哨兵-2图像的代码,我得到以下错误:

代码语言:javascript
复制
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.

我已经阅读了文档,并在相同的错误上引用了类似的问题,但无法解决这个问题。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-01-26 10:07:36

多边形值不是坐标。

区块报价

rec =多边形( 597843.23 2977645.792070312,686175.1025585937 2977645.792070312,686175.1025585937 3112308.537736816,597843.23 3112308.537736816,597843.23 2977645.792070312)

你需要用经度纬度来描述你的多边形。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65880418

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档