JialeJiang的个人博客分享 http://blog.sciencenet.cn/u/JialeJiang

博文

【Python】基于Python API批量下载Planet卫星数据

已有 5633 次阅读 2019-12-18 16:22 |个人分类:经验分享|系统分类:科研笔记| Python, Planet, 批量下载

简介:本文介绍了一种基于Python批量下载Planet卫星数据的方法。通过该方法,用户可自定义感兴趣研究区(ROI)、限定时间范围、选择产品类别、进行云量筛选,实现自动化批量下载Planet卫星数据。


Requirements:

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

image.png


  • Define ROI

点击进入 http://geojson.io/#map=2/20.0/0.0 ,自定义ROI,将所获得的坐标信息粘贴替换PASTE COORDINATE HERE

image.png


  • Select Item & Asset 

选择所需下载的产品,可参考:https://developers.planet.com/docs/data/items-assets/

image.png

点击Item Types可查看对应的Asset Types.



Example:

image.png



References:





https://wap.sciencenet.cn/blog-3425264-1210565.html


下一篇:【Python】批量下载Sentinel-2卫星数据
收藏 IP: 109.171.137.*| 热度|

1 张鹰

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-19 16:37

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部