简介: 本文介绍了一种基于Python批量下载Planet卫星数据的方法。通过该方法,用户可自定义感兴趣研究区(ROI)、限定时间范围、选择产品类别、进行云量筛选,实现自动化批量下载Planet卫星数据。 Requirements: Python and Jupyter Python packages: json, wget, requests Other specific Python packages: planet and geojsonio download_Planet.py: download_Planet.zip Planet account Usefull link: Python Extension Packages for Windows 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: ] } # 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= , 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 : https://developers.planet.com/open/ https://github.com/planetlabs/notebooks/blob/master/jupyter-notebooks/data-api-tutorials/planet_cli_introduction.ipynb