gaz_relations: Walk the hierarchy of the MarineRegions Gazetter given a...

View source: R/02_gaz_relations.R

gaz_relationsR Documentation

Walk the hierarchy of the MarineRegions Gazetter given a Gazetteer MRGID or Gazetteer entries

Description

Walk the hierarchy of the MarineRegions Gazetter given a Gazetteer MRGID or Gazetteer entries

Usage

gaz_relations(x, ...)

## S3 method for class 'numeric'
gaz_relations(x, ...)

## S3 method for class 'mr_df'
gaz_relations(x, ...)

Arguments

x

the object from which the relations are retrieved. Can be:

  • (integer) A valid Marine Regions Gazetteer Identifier (MRGID), passed to gaz_rest_relations_by_mrgid()

  • A data frame retrieved with mregions2 via its functions gaz_search(), gaz_search_by_source() or gaz_search_by_type().

...

Arguments passed on to gaz_rest_relations_by_mrgid

with_geometry

(logical) Add geometries to the result data frame? Default = FALSE

direction

(character) Must be one of upper, lower, both:

  • upper: lists all parents of the record.

  • lower: lists all childs of the record.

  • both: lists parents and childs of the record (default)

type

(character) Must be one of partof, partlypartof, adjacentto, similarto, administrativepartof, influencedby, all.

Details

You can pass the output of most ⁠gaz_*⁠ functions to gaz_relations() to retrieve the related gazetteer entries

Developer info

This is done in the method gaz_relations.mr_df(). mr_df is a class defined in this package to ensure the data frame passed to gaz_relations has a variable with MRGID.

Value

A data frame with Gazetteer entries

Examples


# Get the relations of the Belgian Exclusive Economic Zone
gaz_search("Belgian Exclusive Economic Zone") %>% gaz_relations()

# Or using its mrgid
gaz_relations(3293)


lifewatch/mregions2 documentation built on April 17, 2025, 10:40 a.m.