Home

Awesome

rLandsat <img src="https://i.imgur.com/btZP6vS.png" align="right" />

Acquire Landsat 8 Data: R Package to make Landsat 8 data accessible and help unlock its mysteries.

Overview

rLandsat makes it easy to search for Landsat8 product IDs, place an order on USGS-ESPA and download the data along with the meta information in the perfect format from R. Internally, it uses a combination of sat-api, espa-api and AWS S3 Landsat 8 metadata.

<img src="https://i.imgur.com/cmjtegG.png" align="centre" />

To run any of the functions starting with espa_, you need valid login credentials from ESPA-LSRD and you need to input them in your environment with espa_creds(username, password) for the functions to work properly.

You should also check the demo script (which downloads all the Landsat 8 data for India for January 2018) in the demo folder, or run demo("india_landsat") in R after loading this library.

Installation

# Install the latest dev version from GitHub:
install.packages("devtools")
devtools::install_github("atlanhq/rLandsat")

# Load the library
library(rLandsat)

If you encounter a bug, please file an issue with steps to reproduce it on Github. Please use the same for any feature requests, enhancements or suggestions.

Additional Details

About Landsat 8

Landsat 8 Operational Land Imager (OLI) and Thermal Infrared Sensor (TIRS) images consist of nine spectral bands with a spatial resolution of 30 meters for Bands 1 to 7 and 9. The ultra blue Band 1 is useful for coastal and aerosol studies. Band 9 is useful for cirrus cloud detection. The resolution for Band 8 (panchromatic) is 15 meters. Thermal bands 10 and 11 are useful in providing more accurate surface temperatures and are collected at 100 meters.

Landsat offers this data through a variety of data products, depending on the data quality and level of processing, including SR (Surface Reflectance), TOA (Top of Atmosphere), BT (Brightness Temperature), and Spectral Indices.

This data is available with EROS Science Processing Architecture (ESPA), AWS S3 and Google Cloud Storage. Using data from ESPA is recommended as they have made Collection 1 data available even for data before January 2017. AWS S3 and Google Cloud Storage, on the other hand, have Pre-Collection data until January 1, 2017, and Collection 1 data after that. This library considers that change.

Here are some additional resources you might want to read:

What can I do on rLandsat?

A few other smaller functions and features/options are also available. Use ?function_name to learn more about each function.

Please note: Most of the functions are dependent on external APIs, so the functionalities may be dependent on the APIs working properly. Any major changes in the APIs may need the functions in rLandsat to be modified accordingly.

Example

# 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())

References

Cheers to open data :blush:

<img src="https://user-images.githubusercontent.com/408863/66741678-a78ab780-ee93-11e9-8d90-b274af222339.png" align="centre" />