|||
简介:本文介绍了一种基于Python批量下载Planet卫星数据的方法。通过该方法,用户可自定义感兴趣研究区(ROI)、限定时间范围、选择产品类别、进行云量筛选,实现自动化批量下载Planet卫星数据。
Requirements:
Python packages: json, wget, requests
download_Planet.py: download_Planet.zip
Usefull link:
Installation:
pip install planet
pip install geojsonio
Usage:
Step 1. Run download_Planet.py
run download_Planet.py
Step 2. Set up (edit your API key and research requirements)
# get your API Key form https://www.planet.com/account/
PLANET_API_KEY = 'PASTE YOUR API KEY HERE '
# define ROI using http://geojson.io/#map=2/20.0/0.0
roi = {
"type": "Polygon",
"coordinates": [
[
PASTE COORDINATE HERE
]
]
}
# set date range
start_date = 'YYYY-MM-DD'
end_date = 'YYYY-MM-DD'
# set the maximum cloud coverage from 0 to 1
cloud_cover = 0.2 # only download the image having <20% cloud coverage
# select the types of item and asset, refering to https://developers.planet.com/docs/data/items-assets/
item_type = 'SELECTE ITEM TYPE'
asset_type = 'SELECTE ASSET TYPE'
# set the download path
download_path = 'DIRECTORY:\WHERE\YOU\STORE\DATA'
Step 3. Search and check results
# Create search filter and return search results
search_result = searching(KEY=PLANET_API_KEY, roi=roi, date=[start_date,end_date], cloud_cover=cloud_cover, item_type=item_type)
print(search_result)
Step 4. Activation and downloading
# Activation and Downloading
for i in search_result:
downloading(KEY=PLANET_API_KEY, image_ids=i, item_type=item_type, asset_type=asset_type, path=download_path)
Get your API key
登录Planet account,点击左侧“API key”即复制成功,将复制好的API key粘贴替换PASTE YOUR API KEY HERE
Define ROI
点击进入 http://geojson.io/#map=2/20.0/0.0 ,自定义ROI,将所获得的坐标信息粘贴替换PASTE COORDINATE HERE
Select Item & Asset
选择所需下载的产品,可参考:https://developers.planet.com/docs/data/items-assets/
点击Item Types可查看对应的Asset Types.
Example:
References:
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-20 09:36
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社