Python下载Sentinel-1/2数据

Installation

pip install sentinelsat

connect to the API

from sentinelsat import SentinelAPI, read_geojson, geojson_to_wkt
from datetime import date

api = SentinelAPI(‘user’, ‘password’, ‘https://scihub.copernicus.eu/dhus’)

download single scene by known product id

api.download(<product_id>)

search by polygon, time, and SciHub query keywords

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))

download all results from the search

api.download_all(products)

convert to Pandas DataFrame

products_df = api.to_dataframe(products)

GeoJSON FeatureCollection containing footprints and metadata of the scenes

api.to_geojson(products)

GeoPandas GeoDataFrame with the metadata of the scenes and the footprints as geometries

api.to_geodataframe(products)

Get basic information about the product: its title, file size, MD5 sum, date, footprint and

its download url

api.get_product_odata(<product_id>)

Get the product’s full metadata available on the server

api.get_product_odata(<product_id>, full=True)

Download the product’s

if product_info[‘Online’]:
print(‘Product {} is online. Starting download.’.format(<product_id>))
api.download(<product_id>)
else:
print(‘Product {} is not online.’.format(<product_id>))
# Download the product’s

GEOJSON标准格式学习

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]]
}
}

  1. 多边形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]

                   ]
     }
    

    }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值