gaz_relations {mregions2}R 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:

...

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)


[Package mregions2 version 1.1.2 Index]