Skip to contents

The static root catalog lives on the file host with RELATIVE child links. The main site (GitHub Pages, a different origin) serves an alias of it at /stac/catalog.json, in which every child link is ABSOLUTE so a client starting there walks into the canonical tree. The alias keeps every top-level field of the source (same order) and replaces links with, in order: root and self (both self_url), canonical (the source catalog), service-desc (the searchable STAC API), then every other source link except its root and self, with a relative href resolved against src_base and an absolute one left untouched (type is added as application/json when missing). Pure: no network unless catalog is a URL.

Usage

stac_catalog_alias(
  catalog,
  self_url = "https://marinesensitivity.org/stac/catalog.json",
  src_base = atlas_bases()$stac,
  api_url = atlas_bases()$stac_api
)

Arguments

catalog

a parsed catalog (jsonlite::fromJSON(x, simplifyVector = FALSE)) or a path or URL to one

self_url

where the alias is served

src_base

base of the canonical STAC tree (the folder holding catalog.json)

api_url

base of the searchable STAC API

Value

the alias catalog as a list