gaz_relations: 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 numeric
gaz_relations(x, ...)
# S3 method for mr_df
gaz_relations(x, ...)
Value
A data frame with Gazetteer entries
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.
# \donttest{# Get the relations of the Belgian Exclusive Economic Zonegaz_search("Belgian Exclusive Economic Zone") %>% gaz_relations()
# Or using its mrgidgaz_relations(3293)
# }