Downloads a collection's places.parquet from the oceanmetrics gazetteer and returns it as an sf.
The read is pinned: the manifest row (index/layers.json, matched on slug) names the
version and the parquet's parquet_sha256, and the downloaded bytes must hash to it, else an
error (a silently changed layer must never reach a release). The manifest's newer fields are
optional, so this works against older manifests:
Usage
read_gazetteer_layer(
slug,
version = NULL,
manifest = GAZETTEER_MANIFEST,
cache_dir = tools::R_user_dir("calcofi4db", "cache")
)Value
An sf in EPSG:4326 with geometry column geometry, the columns place_id, name,
status, status_date, status_source, status_upstream, status_history first (NA when the
parquet lacks one), then the native attributes (the GeoParquet bbox covering column dropped).
Attribute gazetteer = list(slug, version, sha256, url).
Details
no
parquet: the URL is<base><slug>/places.parquet(basefrom the manifest, defaulthttps://storage.oceanmetrics.io/gazetteer/);no
parquet_sha256, or aversionother than the manifest's: the hash comes from<base><slug>/versions.json(versions[]entry forversion,assets["places.parquet"].sha256, and itshrefwhen given).
A verified copy is kept in cache_dir/<slug>/<version>/places.parquet and reused while its hash
still matches. manifest, base, parquet and versions.json may also be local paths.
Examples
if (FALSE) { # \dontrun{
aoa <- read_gazetteer_layer("noaa_aoa_socal")
attr(aoa, "gazetteer")
} # }