pip install sentinelsat
from sentinelsat import SentinelAPI, read_geojson, geojson_to_wkt
from datetime import date
api = SentinelAPI(‘user’, ‘password’, ‘https://scihub.copernicus.eu/dhus’)
api.download(
footprint = geojson_to_wkt(read_geojson(’/path/to/map.geojson’)) (附言有geojson格式构造例子)
products = api.query(footprint,
date=(‘20151219’, date(2015, 12, 29)),
platformname=‘Sentinel-2’,
cloudcoverpercentage=(0, 30))
api.download_all(products)
products_df = api.to_dataframe(products)
api.to_geojson(products)
api.to_geodataframe(products)
api.get_product_odata(
api.get_product_odata(
if product_info[‘Online’]:
print(‘Product {} is online. Starting download.’.format(
api.download(
else:
print(‘Product {} is not online.’.format(
# Download the product’s
1.点要素Point
点要素是最简单的,类型type对应Point,然后坐标是一个1维的数组,里面有两个元素(如果是立体的坐标就是三维x,y,z),分别为经度和纬度。properties里面可以封装各种属性,例如名称、标识颜色等等。
例如:
{“type”:“Feature”,
“properties”:{},
“geometry”:{
“type”:“Point”,
“coordinates”:[105.38090375,31.57826438]
}
}
2.线要素
.线要素就是指线段,记录的是线的端点坐标,
{“type”:“Feature”,
“properties”:{},
“geometry”:{
“type”:“LineString”,
“coordinates”:[[105.60859305,30.651556287],
[107.95115649,31.98940288],
[109.37880025,30.55460206],
[107.79515625,29.95213344]]
}
}
多边形Polygon
闭合的线要素
{“type”:“Feature”,
“properties”:{},
“geometry”:{
“type”:“Polygon”,
“coordinates”:[
[
[106.10557031,33.33974240],
[106.32563575,32.41708682],
[108.03955725,32.23136636],
[108.25977435,33.15537849],
[106.10503125,33.33902426]
]
}
}