kapadia / usgs

Client library for interfacing with USGS datasets
http://kapadia.github.io/usgs/
ISC License
110 stars 38 forks source link

How to download Landsat-8 C2-L2 files using the USGS module #69

Open WALEE1789 opened 1 year ago

WALEE1789 commented 1 year ago

Please forgive any posting conventions, this is my first time posting an issue.

the documentation found in (http://kapadia.github.io/usgs/reference/api.html) suggests that there is a method called usgs.api.download which can be used to download Landsat-8 datasets, yet I can't seem to find it, the only one available usgs.api.download_options which does not initiate any download actions, it returns a response.

Here is my code so far, it works but does not initiate any downloading:

from usgs import api

# login
response = api.login(username, password)
api_key = response["data"]
landsat8_dataset = 'landsat_ot_c2_l2'

landsat8_scene_id = 'LC81970362017213LGN00'
productid='LC08_L2SP_197036_20170801_20200903_02_T1'
node='EE'

api.download_options(landsat8_dataset, landsat8_scene_id,api_key=api_key)