These functions provide support to work with static catalogs.
stac_read()
: open a STAC document from an URL.read_items()
: opens (statically) all items referred inlinks
key entry of a given collection document (doc_collection
).links()
: extracts and filters the links of any STAC document.link_open()
: opens (statically) the document referenced by the link. This function can resolve any relative URL.
Usage
read_stac(url, ...)
read_items(collection, ..., limit = 100, page = 1, progress = TRUE)
read_collections(catalog, ..., limit = 100, page = 1, progress = TRUE)
links(x, ...)
link_open(link, base_url = NULL)
Arguments
- url
a
character
value with the URL to a valid STAC document.- ...
additional arguments. See details.
- collection
a
doc_collection
object to fetch allrel=="item"
links.- limit
an
integer
with defining the page size of items to fetch.- page
an
integer
with the page number to fetch the items.- progress
a
logical
indicating if a progress bar must be shown or not. Defaults toTRUE
.- catalog
a
doc_catalog
object to fetch allrel=="child"
links.- x
any
rstac
document with'links'
key entry.- link
a
doc_link
object, usually an element oflinks
key entry.- base_url
a
character
with the base URL to resolve relative links. IfNULL
(default)rstac
will try resolve relative links using internal metadata.
Value
links()
: adoc_links
object containing a list oflink
entries.link_open()
: a recognizablerstac
document.
Details
Ellipsis argument (...
) may appears in different items functions and
has distinct purposes:
stac_read()
: ellipsis is used to pass any additional parameters to read_json function.links()
: ellipsis is used to pass logical expressions to be evaluated against adoc_link
item as a filter criteria. See examples.
Examples
if (FALSE) { # \dontrun{
x <- stac("https://brazildatacube.dpi.inpe.br/stac") %>%
collections("CB4-16D-2") %>%
get_request()
link <- links(x, rel == "items")
link_open(link[[1]])
} # }
if (FALSE) { # \dontrun{
wv_url <- paste0(
"https://s3.eu-central-1.wasabisys.com",
"/stac/openlandmap/wv_mcd19a2v061.seasconv/collection.json"
)
wv <- read_stac(wv_url)
stac_type(wv) # Collection
# reads the second page of 5 links
wv_items <- read_items(wv, limit = 5, page = 2)
# lists all links of the collection document that are not items
links(wv, rel != "item")
# lists all links of the items document
links(wv_items)
} # }