knitr::opts_chunk$set(
  comment = "#>",
  collapse = TRUE,
  warning = FALSE,
  message = FALSE,
  fig.path = "img/"
)

getlandsat introduction

getlandsat provides access to Landsat https://landsat.usgs.gov 8 metadata and images hosted on AWS S3 at https://aws.amazon.com/public-data-sets/landsat. The package only fetches data. It does not attempt to aid users in downstream usage, but some additional functionality may be added.

Potential users are probably anyone from scientists asking questions about biodiversity or land use change, to software developers creating tools for users to vizualize their data.

Install

Dev version

devtools::install_github(c("ropensci/getlandsat"))
library("getlandsat")
lsat_cache_delete_all()

List scenes

(res <- lsat_scenes(n_max = 10))

List scene files

lsat_scene_files(x = res$download_url[1])

Get an image

Returns path to the image

lsat_image(x = "LC80101172015002LGN00_B5.TIF")

Another one

lsat_image("LC80010032014272LGN00_B10.TIF")

Caching

When requesting an image, we first check if you already have that image. If you do, we return the path to the file. If not, we get the image, and return the file path.

lsat_image(x = "LC80101172015002LGN00_B5.TIF")

Note the message given.

See ?lsat_cache for cache management functions.

Visualize

library("raster")
x <- lsat_cache_details()
img <- raster(x[[1]]$file)
plot(img)


Try the getlandsat package in your browser

Any scripts or data that you put into this service are public.

getlandsat documentation built on May 2, 2019, 2:37 a.m.