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

mregions2

Offers a streamlined interface to access data from Marine Regions in R for researchers, marine scientists, and geospatial analysts seeking marine geographical information.
https://github.com/ropensci/mregions2

Category: Hydrosphere
Sub Category: Ocean and Hydrology Data Access

Keywords from Contributors

jerico-relevant biological-data biology fish marine-biology marine-species taxize taxonomy marine lifewatch

Last synced: about 8 hours ago
JSON representation

Repository metadata

Access the Marine Regions Gazetteer and the Marine Regions Data Products in R. Maintained by @salvafern.

README.Rmd

          ---
output: github_document
df_print: tibble
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%",
  cache = TRUE
)
```

# mregions2



[![Funding](https://img.shields.io/static/v1?label=powered+by&message=lifewatch.be&labelColor=1a4e8a&color=f15922)](https://lifewatch.be) [![Status at rOpenSci Software Peer Review](https://badges.ropensci.org/590_status.svg)](https://github.com/ropensci/software-review/issues/590) [![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/mregions2)](https://cran.r-project.org/package=mregions2) [![R-CMD-check](https://github.com/ropensci/mregions2/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/mregions2/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/ropensci/mregions2/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ropensci/mregions2?branch=main)



![](https://user-images.githubusercontent.com/54405067/156809171-1487bb9f-35af-4418-8e2f-93c24a59aad0.gif)

`mregions2` offers a streamlined interface to access data from [Marine Regions](https://marineregions.org) in R for researchers, marine scientists, and geospatial analysts seeking marine geographical information

Marine Regions offers two key resources: the [Marine Regions Gazetteer](https://marineregions.org/gazetteer.php), a list of standardized marine place names with unique identifiers, and the [Marine Regions Data Products](https://marineregions.org/sources.php), including popular features like the world maritime boundaries.

You can find detailed information in the articles online:

-   [Introduction to mregions2](https://docs.ropensci.org/mregions2/articles/mregions2.html)
-   [Why mregions and mregions2?](https://docs.ropensci.org/mregions2/articles/why_mregions2.html)
- [Marine Regions Data Products Ontology](https://docs.ropensci.org/mregions2/articles/mrp_ontology.html)
-   [mregions2 as RDF](https://docs.ropensci.org/mregions2/articles/mregions2-rdf.html)

## Installation

You can install the latest CRAN version with:

``` r
install.packages("mregions2")
```

Or install the development version of mregions2 from GitHub with:

``` r
# install.packages("devtools")
devtools::install_github("ropensci/mregions2", build_vignettes = TRUE)
```

Load the library with:

```{r, results='hide', warning=FALSE, message=FALSE}
library(mregions2)
```

The function `mrp_view()` requires two extra packages that are not listed as Imports, hence they are not installed along with `mregions2` but you must install yourself:

``` r
install.packages("leaflet")
install.packages("leaflet.extras2")
```
Some of the examples below use the pipe operator `%>%`. Install and load `magrittr`:

```{r}
# install.packages("magrittr")
library(magrittr)
```

## Query the Marine Regions Gazetteer

The [Marine Regions Gazetteer](https://marineregions.org/gazetteer.php) is a standard list of marine georeferenced place names.

> Gazetteer: a dictionary of geographical names.



You can search the Gazetteer in many ways:

Search by free text:

```{r}
gaz_search("Belgian Part of the North Sea")
```

Search by unique identifier. See `?MRGID`:

```{r}
gaz_search(3293)
```

Search by location:

```{r}
gaz_search(x = 2.927, y = 51.21551)
```

Search by place type:

```{r}
gaz_search_by_type("EEZ")
```

Search by authortative source:

```{r}
gaz_search_by_source("Flanders Marine Institute (VLIZ)")
```

The list of place types and sources are available with `gaz_types()` and `gaz_sources()` respectively.

You can add the geometry of the Gazetteer entries with `gaz_geometry()`:

```{r gaz2}
# Get a record and turn into a sf object with geometry
gaz_search(3293) %>% gaz_geometry()

# Or get only the geometry 
gaz_geometry(3293, format = "sfc")
```

The entries of the Marine Regions Gazetteer are organized hierarchically. You can browse this hierarchy up and down with `gaz_relations()`

```{r gaz3}
# Get all relations
gaz_search(3293) %>% gaz_relations()

# Or get the relations directly
gaz_relations(3293)
```

## Marine Regions Data Products

In addition to the Marine Regions Gazetteer, the Marine Regions Team creates and hosts geographical Data Products, being the most popular one the [Marine Regions Maritime Boundaries](https://marineregions.org/eez.php).

An overview of all available products can be consulted with `mrp_list`

```{r prod_list}
mrp_list
```

Their attributes are explained in the [Marine Regions Data Products Ontology article](https://docs.ropensci.org/mregions2/articles/mrp_ontology.html), or simply run `mrp_ontology`

```{r prod_ontology}
mrp_ontology
```

You can visualize the Marine Regions Data Products with `mrp_view()`. It opens an interactive `leaflet::leaflet` viewer.

```{r prod1, eval=FALSE}
mrp_view("eez")
```

![](https://raw.githubusercontent.com/ropensci/mregions2/main/man/figures/README-prod1-1.png)

Or you can download and read the data products into R with `mrp_get()`

```{r prod2, eval = FALSE}
mrp_get("eez")
```

You can specify the download path in the `path` argument:

```{r prod3, eval = FALSE}
mrp_get("eez", path = "path/to/data")
```

Get to know more in the [Get Started vignette](https://docs.ropensci.org/mregions2/articles/mregions2.html).

```{r, include=FALSE, echo=FALSE}
# Copy and paste output - do not include to not add more deps
get_md <- function(pkgs){
  get_titles <- function(x) packageDescription(x, fields = "Title")
  titles <- purrr::map_chr(pkgs, get_titles)
  cat(glue::glue("* [{pkgs}](https://docs.ropensci.org/{pkgs}): _{titles}_. \n"), sep = "\n")
}
```

## Related packages

### Marine biodiversity data

The main purpose of Marine Regions is to serve as the geographical backbone for the World Register of Marine Species (WoRMS), an authoritative classification and catalogue of marine names. Here is a list of R packages to access Marine taxonomical and biogeographic data that can be combined with data from `mregions2`:

```{r, include=FALSE, echo=FALSE}
get_md(c("worrms", "eurobis", "robis", "rgbif"))
# Change links manually
```
* [worrms](https://docs.ropensci.org/worrms/): _World Register of Marine Species (WoRMS) Client_. 
* [eurobis](https://lifewatch.github.io/eurobis/): _Download data from EurOBIS using the LifeWatch/EMODnet-Biology Web Feature Services_. 
* [robis](https://cran.r-project.org/package=robis): _Ocean Biodiversity Information System (OBIS) Client_. 
* [rgbif](https://docs.ropensci.org/rgbif/): _Interface to the Global Biodiversity Information Facility API_. 

### More geographical data

There are other R packages that allow to access other gazetteers and boundaries data. Here is a non-exhaustive list:

```{r, include=FALSE, echo=FALSE}
get_md(c("geonames", "osmdata", "osmextract", "rnaturalearth"))
```

* [geonames](https://docs.ropensci.org/geonames/): _Interface to the "Geonames" Spatial Query Web Service_. 
* [osmdata](https://docs.ropensci.org/osmdata/): _Import 'OpenStreetMap' Data as Simple Features or Spatial
Objects_. 
* [osmextract](https://docs.ropensci.org/osmextract/): _Download and Import Open Street Map Data Extracts_. 
* [rnaturalearth](https://docs.ropensci.org/rnaturalearth/): _World Map Data from Natural Earth_.


## Citation

```{r citation, cache=FALSE, collapse=FALSE, comment="", results='asis'}
citation("mregions2")
```

## License

MIT. See `LICENSE.md`

This software is developed for scientific, educational and research purposes. It is not meant to be used for legal, economical (in the sense of exploration of natural resources) or navigational purposes. See the [Marine Regions disclaimer](https://marineregions.org/disclaimer.php) for more information.

## Code of Conduct

Please note that this package is released with a [Contributor Code of Conduct](https://ropensci.org/code-of-conduct/). By contributing to this project, you agree to abide by its terms.

        

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 6 days ago

Total Commits: 201
Total Committers: 5
Avg Commits per committer: 40.2
Development Distribution Score (DDS): 0.234

Commits in past year: 35
Committers in past year: 4
Avg Commits per committer in past year: 8.75
Development Distribution Score (DDS) in past year: 0.171

Name Email Commits
salvafern s****z@v****e 154
LottePohl l****l@i****u 41
Julia Gustavsen j****n@g****m 3
bart-v b****v@v****e 2
Maëlle Salmon m****n@y****e 1

Committer domains:


Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 50
Total pull requests: 4
Average time to close issues: 3 months
Average time to close pull requests: 11 days
Total issue authors: 7
Total pull request authors: 2
Average comments per issue: 3.42
Average comments per pull request: 0.75
Merged pull request: 4
Bot issues: 8
Bot pull requests: 0

Past year issues: 11
Past year pull requests: 4
Past year average time to close issues: about 1 month
Past year average time to close pull requests: 11 days
Past year issue authors: 4
Past year pull request authors: 2
Past year average comments per issue: 4.27
Past year average comments per pull request: 0.75
Past year merged pull request: 4
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/ropensci/mregions2

Top Issue Authors

  • salvafern (22)
  • github-actions[bot] (8)
  • lottepohl (5)
  • jflowernet (5)
  • peterdesmet (4)
  • lawleyjw (3)
  • jooolia (3)

Top Pull Request Authors

  • jooolia (3)
  • maelle (1)

Top Issue Labels

  • bug (14)
  • enhancement (12)
  • help wanted (1)

Top Pull Request Labels


Package metadata

cran.r-project.org: mregions2

Access Data from Marine Regions: Gazetteer & Data Products

  • Homepage: https://github.com/ropensci/mregions2
  • Documentation: http://cran.r-project.org/web/packages/mregions2/mregions2.pdf
  • Licenses: MIT + file LICENSE
  • Latest release: 1.1.2 (published about 1 month ago)
  • Last Synced: 2025-04-26T06:01:59.278Z (1 day ago)
  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 241 Last month
  • Rankings:
    • Dependent packages count: 28.317%
    • Dependent repos count: 34.924%
    • Average: 49.987%
    • Downloads: 86.719%
  • Maintainers (1)

Dependencies

.github/workflows/R-CMD-check-schedule.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgcheck.yaml actions
  • ropensci-review-tools/pkgcheck-action main composite
.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
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • ISOcodes * imports
  • checkmate * imports
  • cli * imports
  • curl * imports
  • dplyr * imports
  • glue * imports
  • httr * imports
  • httr2 * imports
  • lubridate * imports
  • magrittr * imports
  • memoise * imports
  • methods * imports
  • ows4R >= 0.3 imports
  • purrr * imports
  • rdflib * imports
  • sf * imports
  • utils * imports
  • wrapr * imports
  • xml2 * imports
  • httptest * suggests
  • httptest2 * suggests
  • jsonlite * suggests
  • knitr * suggests
  • leaflet * suggests
  • leaflet.extras2 * suggests
  • mapview * suggests
  • mregions * suggests
  • rmarkdown * suggests
  • testthat * suggests
  • wk * suggests

Score: 9.295600215927006