static_functions {rstac} | R Documentation |
Static functions
Description
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 |
... |
additional arguments. See details. |
collection |
a |
limit |
an |
page |
an |
progress |
a |
catalog |
a |
x |
any |
link |
a |
base_url |
a |
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.
Value
-
links()
: adoc_links
object containing a list oflink
entries. -
link_open()
: a recognizablerstac
document.
Examples
## Not run:
x <- stac("https://brazildatacube.dpi.inpe.br/stac") %>%
collections("CB4-16D-2") %>%
get_request()
link <- links(x, rel == "items")
link_open(link[[1]])
## End(Not run)
## Not run:
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)
## End(Not run)