Skip to contents

The print function covers all objects in the rstac package:

  • stac(): returns a STACCatalog document from /stac (v0.8.0) or / (v0.9.0 or v1.0.0) endpoint.

  • stac_search(): returns a STACItemCollection document from /stac/search (v0.8.0) or /search (v0.9.0 or v1.0.0) endpoint containing all Items that match the provided search predicates.

  • collections(): implements the /collections and /collections/{collectionId} endpoints. The former returns a STACCollectionList document that lists all collections published by the server, and the later returns a single STACCollection document that describes a unique collection.

  • items(): retrieves a STACItemCollection document from /collections/{collectionId}/items endpoint and a STACItem document from /collections/{collectionId}/items/{itemId} endpoints.

The rstac package objects visualization is based on markdown, a lightweight markup language. You can paste the output into any markdown editor for a better visualization.

Call print() function to print the rstac's objects. You can determine how many items will be printed using n parameter.

Usage

# S3 method for RSTACQuery
print(x, ...)

# S3 method for STACCatalog
print(x, ...)

# S3 method for STACCollectionList
print(x, n = 10, ...)

# S3 method for STACCollection
print(x, ...)

# S3 method for STACItemCollection
print(x, n = 10, ..., tail = FALSE)

# S3 method for STACItem
print(x, ...)

# S3 method for Queryables
print(x, n = 10, ...)

# S3 method for Conformance
print(x, n = 5, ...)

Arguments

x

either a RSTACQuery object expressing a STAC query criteria or any RSTACDocument.

...

other parameters passed in the functions.

n

number of entries to print. Each object has its own rule of truncation: the STACCollection objects will print 10 links by default. If the object has less than 20 collections, all collections will be shown. In STACItemCollection, 10 features will be printed by default. To show all entries, use n = Inf.

tail

A logical value indicating if last features in STACItemCollection object must be show.

Examples

if (FALSE) {
 # STACItemCollection object
 stac_item_collection <-
   stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
   stac_search(collections = "CB4_64_16D_STK-1",
          bbox = c(-47.02148, -17.35063, -42.53906, -12.98314),
          limit = 15) %>%
   get_request()

 print(stac_item_collection, n = 10)

 # STACCollectionList object
 stac_collection <-
     stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
     collections() %>%
     get_request()

 print(stac_collection, n = 5)

 # RSTACQuery object
 obj_rstac <- stac("https://brazildatacube.dpi.inpe.br/stac/")

 print(obj_rstac)
}