Skip to content

Commit

Permalink
Merge pull request #25 from rolfsimoes/master
Browse files Browse the repository at this point in the history
Default assets_name in assets_list
  • Loading branch information
gqueiroz authored Feb 14, 2021
2 parents 4702169 + eb96f4e commit ef0819d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 4 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ stac_version <- function(x, ...) {
#' the result of \code{/stac/search}, \code{/collections/{collectionId}/items}.
#'
#' @param assets_names a \code{character} with the assets names to be
#' filtered.
#' filtered. If \code{NULL} (default) all assets will be returned.
#'
#' @param sort a \code{logical} if true the dates will be sorted
#' in increasing order. By default, the dates are sorted.
Expand All @@ -445,13 +445,14 @@ stac_version <- function(x, ...) {
#' }
#'
#' @export
assets_list <- function(items, assets_names, sort = TRUE,
assets_list <- function(items, assets_names = NULL, sort = TRUE,
gdal_vsi_resolution = TRUE) {

if (is.null(assets_names))
assets_names <- items_fields(items, "assets")

timeline <- items_reap(items, field = c("properties", "datetime"))
index <- seq_along(timeline)

if (sort) index <- order(timeline)

timeline <- timeline[index]
Expand Down
9 changes: 7 additions & 2 deletions man/assets_list.Rd

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

0 comments on commit ef0819d

Please sign in to comment.