Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
fix #17 fixed cache delete fxn and other caching fxns
Browse files Browse the repository at this point in the history
fix #16 clear up usage of lsast_list, lsat_scenes and lsast_scene_files
fix #15 more details on what pkg is for
bump dev version
  • Loading branch information
sckott committed Aug 10, 2016
1 parent 81392a5 commit ed10270
Show file tree
Hide file tree
Showing 12 changed files with 99 additions and 15 deletions.
8 changes: 5 additions & 3 deletions DESCRIPTION
Expand Up @@ -5,8 +5,8 @@ Description: Get Landsat 8 Data from AWS public data sets
(<https://aws.amazon.com/public-data-sets/landsat/>). Includes
functions for listing images and fetching them, and handles
caching to prevent unnecessary additional requests.
Version: 0.0.6.9000
Date: 2016-07-13
Version: 0.0.9.9000
Date: 2016-08-10
Authors@R: c(person("Scott", "Chamberlain", role = c("aut", "cre"),
email = "myrmecocystus@gmail.com"))
License: MIT + file LICENSE
Expand All @@ -21,8 +21,10 @@ Imports:
tibble,
rappdirs
Suggests:
roxygen2 (>= 5.0.1),
testthat,
knitr,
covr
covr,
raster
VignetteBuilder: knitr
RoxygenNote: 5.0.1
1 change: 1 addition & 0 deletions R/cache.R
Expand Up @@ -12,6 +12,7 @@
#' @details We cache using \code{\link[rappdirs]{user_cache_dir}}, find your cache
#' folder by executing \code{rappdirs::user_cache_dir("landsat-pds")}
#'
#' @section Functions:
#' \itemize{
#' \item \code{lsat_cache_list()} returns a character vector of full path file names
#' \item \code{lsat_cache_delete()} deletes one or more files, returns nothing
Expand Down
25 changes: 25 additions & 0 deletions R/getlandsat-package.R
@@ -1,10 +1,35 @@
#' getlandsat - get Landsat 8 data from AWS public data sets
#'
#' \pkg{getlandsat} provides access to Landsat \url{https://landsat.usgs.gov} 8
#' metadata and images hosted on AWS S3 at
#' \url{https://aws.amazon.com/public-data-sets/landsat}. The package only
#' fetches data. It does not attempt to aid users in downstream usage.
#'
#' @importFrom readr read_csv
#' @importFrom xml2 read_html read_xml xml_find_all as_list xml_children xml_name
#' @importFrom httr content write_disk GET stop_for_status
#' @name getlandsat-package
#' @aliases getlandsat
#' @docType package
#' @keywords package
#'
#' @examples \dontrun{
#' ## 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")
#'
#' ## Visualize
#' if (requireNamespace("raster")) {
#' library("raster")
#' x <- lsat_cache_details()[[1]]
#' img <- raster(x$file)
#' plot(img)
#' }
#' }
NULL
11 changes: 6 additions & 5 deletions R/lsat_list.R
@@ -1,8 +1,4 @@
#' @title List Landsat images
#'
#' @description This is an alternative to using lsat_scenes(). This
#' function uses the AWS S3 API, while the other fxn simply downloads
#' the up to date compressed csv file.
#' List Landsat images
#'
#' @export
#' @param max (integer) number indicating the maximum number of keys to return (max 1000,
Expand All @@ -15,6 +11,11 @@
#' @param delimiter (character) string used to group keys. Read the AWS doc for
#' more detail.
#' @param ... curl args passed on to \code{\link[httr]{GET}}
#'
#' @details This is an alternative to using \code{\link{lsat_scenes}}. This
#' function uses the AWS S3 API, while \code{\link{lsat_scenes}} downloads
#' the up to date compressed csv file.
#'
#' @examples \dontrun{
#' lsat_list(max = 10)
#'
Expand Down
6 changes: 6 additions & 0 deletions R/lsat_scenes.R
Expand Up @@ -8,6 +8,12 @@
#' file for \code{read_csv} for what parameter you can pass to modify it's
#' behavior.
#'
#' This is an alternative to using \code{\link{lsat_list}}. This function
#' downloads the up to date compressed csv file, while \code{\link{lsat_list}}
#' uses the AWS S3 API.
#'
#' @seealso \code{\link{lsat_scene_files}}
#'
#' @examples \dontrun{
#' res <- lsat_scenes()
#' head(res)
Expand Down
7 changes: 6 additions & 1 deletion R/lsat_scenes_files.R
Expand Up @@ -2,7 +2,12 @@
#'
#' @export
#' @param x (character) A URL to a scene html file
#' @param ... Further args passed on to \code{\link[httr]{GET}}
#' @param ... Curl options passed on to \code{\link[httr]{GET}}
#'
#' @details This function fetches files available in a scene, while
#' \code{\link{lsat_scenes}} lists the scenes, but not their files
#'
#' @seealso \code{\link{lsat_scenes}}
#'
#' @return A data.frame with two columns:
#' \itemize{
Expand Down
5 changes: 3 additions & 2 deletions inst/vign/getlandsat_vignette.Rmd
Expand Up @@ -17,8 +17,9 @@ knitr::opts_chunk$set(
getlandsat introduction
=======================

Get Landsat 8 Data from AWS public data sets. Includes functions for
listing images and fetching them.
`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

Expand Down
26 changes: 25 additions & 1 deletion man/getlandsat-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/lsat_cache.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions man/lsat_list.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion man/lsat_scene_files.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions man/lsat_scenes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ed10270

Please sign in to comment.