A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

CopernicusMarine

Subset and download marine data from the EU Copernicus Marine Service Information to import data on the physical and biogeochemical state of the oceans without the need for external software.
https://github.com/pepijn-devries/copernicusmarine

Category: Hydrosphere
Sub Category: Ocean and Hydrology Data Access

Keywords

data spatial

Last synced: 28 minutes ago
JSON representation

Repository metadata

Subset and download marine data from EU Copernicus Marine Service Information. Import data on the oceans physical and biogeochemical state from Copernicus into R without the need of external software.

README.Rmd

          ---
output: github_document
---

```{r, echo = FALSE, message = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-"
)
library(CopernicusMarine)
```

> `CopernicusMarine` Easily access information from 


[![R-CMD-check](https://github.com/pepijn-devries/CopernicusMarine/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pepijn-devries/CopernicusMarine/actions/workflows/R-CMD-check.yaml)
![cranlogs](https://cranlogs.r-pkg.org/badges/CopernicusMarine)
[![version](https://www.r-pkg.org/badges/version/CopernicusMarine)](https://CRAN.R-project.org/package=CopernicusMarine)
[![cran checks](https://badges.cranchecks.info/worst/CopernicusMarine.svg)](https://cran.r-project.org/web/checks/check_results_CopernicusMarine.html)
[![CopernicusMarine status badge](https://pepijn-devries.r-universe.dev/badges/CopernicusMarine)](https://pepijn-devries.r-universe.dev/CopernicusMarine)


## Overview

CopernicusMarine logo

[Copernicus Marine Service Information](https://marine.copernicus.eu/about) is a programme subsidised by the
European Commission. Its mission is to provide free authoritative information on the oceans physical and
biogeochemical state. The `CopernicusMarine` R package is developed apart from this programme and facilitates
retrieval of information from . With the package you can:

 * List available marine data for Copernicus and provide meta-information.
 * Download and use the data directly in R.

## Why use `CopernicusMarine`

Copernicus Marine offers access to their data services through a
[Python application interface](https://pypi.org/project/copernicusmarine/).
For R users this requires complex installation procedures and is difficult to maintain in
a stable R package. The `CopernicusMarine` R package has
a much simpler installation procedure (see below) and does not depend on
third party software, other than packages available from [CRAN](https://cran.r-project.org/).

## Installation

> Get CRAN version
```{r eval=FALSE}
install.packages("CopernicusMarine")
```
> Get development version on github
```{r eval=FALSE}
devtools::install_github('pepijn-devries/CopernicusMarine')
```

## Usage

The package provides an interface between R and the Copernicus Marine services. Note that for some of these
services you need an account and have to comply with
[specific terms](https://marine.copernicus.eu/user-corner/service-commitments-and-licence). The usage section
briefly shows three different ways of obtaining data from Copernicus:

 * [Downloading a subset](#sec-subset)
 * [Downloading a full dataset](#sec-full)
 * [Using the WMTS server](#sec-wtms)

Please check the manual for complete documentation of the package.

Downloading a subset

Unfortunately, downloading subsets is not operational in R due to some [technical issues](https://github.com/pepijn-devries/CopernicusMarine/issues/42). It seems that it might take some time to get this fixed. In the meantime, you could have a look at this [work-around](https://github.com/pepijn-devries/CopernicusMarine/issues/42#issuecomment-2079745370).

Downloading a complete Copernicus marine product

If you don't want to subset the data and want the complete set, you can use the SpatioTemporal Asset Catalogs (STAC), if these are available for your product. First you can list STAC files available for a specific product (and layer): ```{r, eval=TRUE} stac_files <- cms_list_stac_files( "GLOBAL_ANALYSISFORECAST_PHY_001_024", "cmems_mod_glo_phy-cur_anfc_0.083deg_P1D-m") stac_files ``` Downloading the first file can be done with `cms_download_stac(stac_files[1,,drop = FALSE], tempdir())`, where the file would be stored in a temporary directory. By default the progress is printed as files can be very large and may take some time to download.

Copernicus Web Map Tile Services (WMTS)

Web Map Tile Services (WMTS) allow to quickly plot pre-rendered images onto a map. This may not be useful when you need the data for analyses but is handy for quick visualisations, inspection or presentation of data. In R it is very easy to add WMTS layers to an interactive map using [leaflet](https://rstudio.github.io/leaflet/) widgets. This is demonstrated with the example below (note that in the documentation the map is only shown statically and is not interactive). ```{r leaflet, eval=TRUE} leaflet::leaflet() |> leaflet::setView(lng = 3, lat = 54, zoom = 4) |> leaflet::addProviderTiles("Esri.WorldImagery") |> addCmsWMTSTiles( product = "GLOBAL_ANALYSISFORECAST_PHY_001_024", layer = "cmems_mod_glo_phy-thetao_anfc_0.083deg_P1D-m", variable = "thetao" ) ``` ### Citing the data you use A Copernicus account comes with several terms of use. One of these is that you [properly cite](https://help.marine.copernicus.eu/en/articles/4444611-how-to-cite-copernicus-marine-products-and-services) the data you use in publications. In fact, we also have credit the data used in this documentation, which can be easily done with the following code: ```{r, eval=TRUE} cms_cite_product("GLOBAL_ANALYSISFORECAST_PHY_001_024") ``` ## Resources ```{r, eval=TRUE, echo=FALSE} cop_det <- cms_product_details("GLOBAL_ANALYSISFORECAST_PHY_001_024") ``` * [E.U. Copernicus Marine Service Information](https://data.marine.copernicus.eu) * `r sprintf("[%s - %s (%s); DOI:%s](https://doi.org/%s)", cop_det$title, cop_det$id, cop_det$creationDate, cop_det$doi, cop_det$doi)`

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 7 days ago

Total Commits: 31
Total Committers: 3
Avg Commits per committer: 10.333
Development Distribution Score (DDS): 0.097

Commits in past year: 6
Committers in past year: 2
Avg Commits per committer in past year: 3.0
Development Distribution Score (DDS) in past year: 0.167

Name Email Commits
Vries p****s@w****l 28
pepijn-devries p****2@g****m 2
Riccardo Soldan 4****2 1

Committer domains:


Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 25
Total pull requests: 24
Average time to close issues: 27 days
Average time to close pull requests: 11 days
Total issue authors: 16
Total pull request authors: 2
Average comments per issue: 3.56
Average comments per pull request: 0.25
Merged pull request: 23
Bot issues: 0
Bot pull requests: 0

Past year issues: 0
Past year pull requests: 3
Past year average time to close issues: N/A
Past year average time to close pull requests: about 1 month
Past year issue authors: 0
Past year pull request authors: 1
Past year average comments per issue: 0
Past year average comments per pull request: 1.0
Past year merged pull request: 3
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/pepijn-devries/copernicusmarine

Top Issue Authors

  • pepijn-devries (7)
  • DevrekerD (2)
  • dancrear (2)
  • MauroMardones (2)
  • ValentinTeillard (1)
  • teuzindahuz (1)
  • RSO9192 (1)
  • CongGao-CG (1)
  • sermomon (1)
  • FMestre1 (1)
  • Ge0rges (1)
  • ericward-noaa (1)
  • elifrag (1)
  • raymondben (1)
  • LuisLauM (1)

Top Pull Request Authors

  • pepijn-devries (22)
  • RSO9192 (2)

Top Issue Labels

  • enhancement (5)
  • duplicate (3)
  • bug (1)
  • documentation (1)

Top Pull Request Labels


Package metadata

cran.r-project.org: CopernicusMarine

Search Download and Handle Data from Copernicus Marine Service Information

  • Homepage: https://github.com/pepijn-devries/CopernicusMarine
  • Documentation: http://cran.r-project.org/web/packages/CopernicusMarine/CopernicusMarine.pdf
  • Licenses: GPL (≥ 3)
  • Latest release: 0.2.5 (published 23 days ago)
  • Last Synced: 2025-04-26T14:35:02.175Z (1 day ago)
  • Versions: 8
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 553 Last month
  • Rankings:
    • Forks count: 21.888%
    • Stargazers count: 22.49%
    • Average: 27.776%
    • Downloads: 29.252%
    • Dependent packages count: 29.797%
    • Dependent repos count: 35.455%
  • Maintainers (1)

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • crayon * imports
  • dplyr * imports
  • httr * imports
  • jsonlite * imports
  • leaflet * imports
  • purrr * imports
  • readr * imports
  • rvest * imports
  • sf * imports
  • stringr * imports
  • utils * imports
  • xml2 * imports
  • lifecycle * suggests
  • stars * suggests
  • testthat >= 3.0.0 suggests
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite

Score: 10.972928463903958