[英]Python API sentinelsat error in query intersect
我在搜索包含特定坐标的图像时遇到问题。 我无法让 intersect 函数与 API 一起使用。
我收到此错误消息:
sentinelsat.sentinel.SentinelAPIError: HTTP status 200 OK: Invalid query string. Check the parameters and format.
那么我怎样才能让查询与交集一起工作?
使用的代码:
from sentinelsat import SentinelAPI, read_geojson, geojson_to_wkt
from datetime import date
from shapely.geometry import box, Polygon
api = SentinelAPI('myusername', 'mypassword','https://scihub.copernicus.eu/dhus')
footprint='footprint:"intersects(POLYGON((0 0,1 1,0 1,0 0)))"'
products = api.query(footprint,
date=('20180901', date(2018, 9, 3)),
area_relation='Intersects',
platformname='Sentinel-2',
cloudcoverpercentage=(0, 10))
print(products)
#this works
#api.download_all(products)
知道如何解决这个问题吗?
代替
footprint='footprint:"intersects(POLYGON((0 0,1 1,0 1,0 0)))"'
和
footprint='POLYGON((0 0,1 1,0 1,0 0))'
我不知道这些数字是否仅供参考,但此多边形没有结果。 要查看其他区域的结果,请尝试
footprint='POLYGON((0 0,1 1,0 1,0 0))'
products = api.query(footprint,
date=('20180901', date(2018, 9, 5)),
area_relation='Intersects',
platformname='Sentinel-2',
cloudcoverpercentage=(0, 10))
根据官方 sentinelsat docs ,您可以在查询中的三种不同类型的 area_relation 之间进行选择。 我认为你应该只留下包含多边形的足迹:
Intersects: true if the AOI and the footprint intersect (default) Contains: true if the AOI is inside the footprint IsWithin: true if the footprint is inside the AOI
如果它与其他 OpenGIS 实现类似,我认为您需要引用多边形部分,即 intersects('POLYGON((0 0,1 1,0 1,0 0))')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.