Package 'cmemsarco'

Title: Cloud-Native Access to Copernicus Marine ARCO Zarr Stores
Description: Build and query a catalog of Copernicus Marine Service (CMEMS) Analysis-Ready Cloud-Optimized (ARCO) Zarr datasets. Provides GDAL-ready data source names for direct access to 'timeChunked' and 'geoChunked' Zarr stores without file downloads or directory listings. Default DSNs use '/vsicurl/' for zero-configuration access. Catalog is built by walking the CMEMS STAC API at <https://stac.marine.copernicus.eu>.
Authors: Michael Sumner [aut, cre] (ORCID: <https://orcid.org/0000-0002-2471-7511>)
Maintainer: Michael Sumner <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-06-10 09:33:27 UTC
Source: https://github.com/hypertidy/cmemsarco

Help Index


Construct GDAL DSN directly

Description

Convenience wrapper combining cmems_arco_url() and cmems_gdal_dsn().

Usage

cmems_arco_dsn(
  product_id,
  dataset_id,
  version,
  chunk_type = c("time", "geo"),
  bucket_version = "045",
  array = NULL,
  use_s3 = FALSE
)

Arguments

product_id

Product identifier

dataset_id

Dataset identifier (without version)

version

6-digit version string (YYYYMM)

chunk_type

"time" or "geo"

bucket_version

Bucket suffix (e.g., "045", "042"). Varies by product.

array

Optional array/variable name

use_s3

Use ⁠/vsis3/⁠ instead of ⁠/vsicurl/⁠ (requires cmems_setup())

Value

GDAL DSN string


Filter catalog to ARCO datasets only

Description

Removes datasets that don't have Zarr URLs (static/native-only datasets).

Usage

cmems_arco_only(catalog)

Arguments

catalog

A catalog tibble from cmems_catalog()

Value

Filtered tibble with only ARCO datasets


Construct ARCO Zarr URL directly

Description

Build a Zarr URL from known identifiers without querying STAC. Requires knowing the bucket version suffix which varies by product family.

Usage

cmems_arco_url(
  product_id,
  dataset_id,
  version,
  chunk_type = c("time", "geo"),
  bucket_version = "045"
)

Arguments

product_id

Product identifier

dataset_id

Dataset identifier (without version)

version

6-digit version string (YYYYMM)

chunk_type

"time" or "geo"

bucket_version

Bucket suffix (e.g., "045", "042"). Varies by product.

Value

HTTPS URL to the Zarr store


Build CMEMS ARCO catalog from STAC

Description

Walks the STAC catalog to retrieve all products, datasets, and Zarr URLs.

Usage

cmems_catalog(product_ids = NULL, progress = TRUE)

Arguments

product_ids

Character vector of product IDs, or NULL for all products

progress

Show progress messages

Value

A tibble with columns: product_id, dataset_version_id, dataset_id, version, timeChunked_url, geoChunked_url, native_url, and GDAL/S3 variants

Examples

## Not run: 
# Single product
cat <- cmems_catalog("SEALEVEL_GLO_PHY_L4_NRT_008_046")

# All products (takes a few minutes)
full <- cmems_catalog()

## End(Not run)

CMEMS ARCO Catalog

Description

Cached catalog of Copernicus Marine ARCO Zarr datasets with URLs for timeChunked and geoChunked stores. Updated periodically via data-raw/update_catalog.R.

Usage

cmems_catalog_data

Format

A tibble with columns:

product_id

CMEMS product identifier

dataset_version_id

Full dataset identifier with version suffix

dataset_id

Dataset identifier without version

version

6-digit version string (YYYYMM), NA for static datasets

timeChunked_url

HTTPS URL to timeChunked.zarr (spatial slice access)

geoChunked_url

HTTPS URL to geoChunked.zarr (time series access)

native_url

URL to native files (if available)

timeChunked_gdal

GDAL DSN using /vsicurl/ (no setup needed)

geoChunked_gdal

GDAL DSN using /vsicurl/ (no setup needed)

timeChunked_gdals3

GDAL DSN using /vsis3/ (needs cmems_setup())

geoChunked_gdals3

GDAL DSN using /vsis3/ (needs cmems_setup())

timeChunked_s3

S3 URI for timeChunked store

geoChunked_s3

S3 URI for geoChunked store

Source

STAC catalog at https://stac.marine.copernicus.eu/metadata/catalog.stac.json

See Also

cmems_catalog() to refresh, cmems_latest() to filter to latest versions, cmems_arco_only() to remove non-ARCO datasets


Convert URL to GDAL Zarr DSN (vsicurl)

Description

Creates a GDAL DSN using ⁠/vsicurl/⁠ which works without environment variable configuration.

Usage

cmems_gdal_dsn(url, array = NULL)

Arguments

url

HTTPS URL to a Zarr store

array

Optional array/variable name to access directly

Value

GDAL DSN string

Examples

url <- "https://s3.waw3-1.cloudferro.com/mdl-arco-time-045/arco/PRODUCT/dataset/timeChunked.zarr"
cmems_gdal_dsn(url)
cmems_gdal_dsn(url, array = "sla")

Convert URL to GDAL Zarr DSN (vsis3)

Description

Creates a GDAL DSN using ⁠/vsis3/⁠ which requires cmems_setup() to configure AWS environment variables first.

Usage

cmems_gdal_dsn_s3(url, array = NULL)

Arguments

url

HTTPS URL to a Zarr store

array

Optional array/variable name to access directly

Value

GDAL DSN string

Examples

url <- "https://s3.waw3-1.cloudferro.com/mdl-arco-time-045/arco/PRODUCT/dataset/timeChunked.zarr"
cmems_setup()
cmems_gdal_dsn_s3(url)

Generate gdalinfo command

Description

Generate gdalinfo command

Usage

cmems_gdalinfo_cmd(dsn)

Arguments

dsn

GDAL DSN string

Value

Shell command string


Filter catalog to latest version per dataset

Description

Filter catalog to latest version per dataset

Usage

cmems_latest(catalog)

Arguments

catalog

A catalog tibble from cmems_catalog()

Value

Filtered tibble with only the latest version of each dataset


Convert S3 HTTPS URL to s3:// URI

Description

Convert S3 HTTPS URL to s3:// URI

Usage

cmems_s3_uri(url)

Arguments

url

HTTPS URL to a Zarr store

Value

S3 URI string


Set up GDAL environment for CMEMS S3 access

Description

Sets AWS environment variables required for ⁠/vsis3/⁠ access to CMEMS. Not needed if using the default ⁠/vsicurl/⁠ DSNs.

Usage

cmems_setup()

Value

Invisible TRUE

Examples

cmems_setup()