Skip to content

Instantly share code, notes, and snippets.

@christinegarcia
Created July 18, 2018 09:14
Show Gist options
  • Save christinegarcia/2c0092592a08c3dc3ca7c0ce42f1aa99 to your computer and use it in GitHub Desktop.
Save christinegarcia/2c0092592a08c3dc3ca7c0ce42f1aa99 to your computer and use it in GitHub Desktop.
# get all the product IDs for India, alternatively can define path and row
result = landsat_search(min_date = "2018-01-01", max_date = "2018-01-16", country = "India")
# inputting espa creds
espa_creds("yourusername", "yourpassword")
# getting available products
prods = espa_products(result$product_id)
prods = prods$master
# placing an espa order
result_order = espa_order(result$product_id, product = c("sr","sr_ndvi"),
projection = "lonlat",
order_note = "All India Jan 2018")
order_id = result_order$order_details$orderid
# getting order status
durl = espa_status(order_id = order_id, getSize = TRUE)
downurl = durl$order_details
# download; after the order is complete
landsat_download(download_url = downurl$product_dload_url, dest_file = getwd())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment