Skip to contents

[Stable] Full marine data sets can be downloaded using the SpatioTemporal Asset Catalogs (STAC). Use these functions to list download locations and get the files.

Usage

cms_download_stac(
  file_tibble,
  destination,
  show_progress = TRUE,
  overwrite = FALSE
)

cms_list_stac_files(product, layer)

cms_stac_properties(product, layer)

Arguments

file_tibble

A dplyr::tibble() with in each row the files to be downloaded. Should be created with cms_list_stac_files().

destination

A character string representing the path location where the downloaded files should be stored.

show_progress

A logical value. When TRUE (default) the download progress will be shown. This can be useful for large files.

overwrite

A logical value. When FALSE (default), files at the destination won't be overwritten when the exist. Instead an error will be thrown if this is the case. When set to TRUE, existing files will be overwritten.

product

An identifier (type character) of the desired Copernicus marine product. Can be obtained with cms_products_list.

layer

The name of a desired layer within a product (type character). Can be obtained with cms_product_details.

Value

In case of cms_stac_properties a dplyr::tibble() is returned with some product properties, It is used as precursor for cms_list_stac_files. In case of cms_list_stac_files a dplyr::tibble() is returned containing available URLs (for the specified product and layer) and some meta information is returned. In case of cms_download_stac an invisible logical value is returned, indicating whether all requested files are successfully stored at the destination path. A list of responses (of class httr2::response()) for all requested download links is included as attribute to the result.

Author

Pepijn de Vries

Examples

if (FALSE) { # \dontrun{
## List some STAC properties for a specific product and layer
cms_stac_properties(
  product       = "GLOBAL_ANALYSISFORECAST_PHY_001_024",
  layer         = "cmems_mod_glo_phy-cur_anfc_0.083deg_P1D-m"
)

## Get the available files for a specific product and layer:
file_tibble <-
  cms_list_stac_files("GLOBAL_ANALYSISFORECAST_PHY_001_024",
                      "cmems_mod_glo_phy-cur_anfc_0.083deg_P1D-m")

dest <- tempdir()

## download the first file from the file_tibble to 'dest'
cms_download_stac(file_tibble[1,, drop = FALSE], dest)
} # }