Pure builders for a STAC Collection document. Neither function touches
disk; use stac_save() to persist.
new_collection(): creates an in-memoryCollectionobject.add_collection(): registers a collection as achildof a catalog and returns the updated catalog.
Usage
new_collection(
id,
title,
description,
license = "proprietary",
extent = NULL,
stac_version = "1.0.0",
...
)
add_collection(catalog, collection)Arguments
- id
A
characteridentifier for the collection.- title
A
characterhuman-readable title.- description
A
characterdescription of the collection.- license
A
characterlicense identifier or URL. Defaults to"proprietary".- extent
A
listwith the collectionspatialandtemporalextent. IfNULL, an empty extent is created and later updated byadd_items().- stac_version
A
characterSTAC specification version. Defaults to"1.0.0".- ...
Additional named fields added to the collection document.
- catalog
A
doc_catalogobject the collection is attached to.- collection
A
doc_collectionobject to register.
Value
new_collection(): adoc_collectionobject.add_collection(): the updateddoc_catalog(the parent), so it can be chained with another call.
Examples
col <- new_collection(
id = "my-collection",
title = "My Collection",
description = "An example collection"
)
col$type
#> [1] "Collection"
cat <- new_catalog("cat", "Catalog", "Example")
cat <- add_collection(cat, col)
