Learn R Programming

mregions2 (version 1.1.2)

gaz_search: Search in the Marine Regions Gazetteer by names, MRGID or reverse geocode with a pair of WGS84 coordinates x and y

Description

Search in the Marine Regions Gazetteer by names, MRGID or reverse geocode with a pair of WGS84 coordinates x and y

Usage

gaz_search(x, ...)

# S3 method for character gaz_search(x, ...)

# S3 method for numeric gaz_search(x, ..., y = NULL)

# S3 method for sfg gaz_search(x, ...)

# S3 method for sf gaz_search(x, ...)

# S3 method for sfc gaz_search(x, ...)

Value

A data frame with Gazetteer entries

Arguments

x

object to perform the search with. Can be:

  • (character) Free text search

  • (integer) A valid Marine Regions Gazetteer Identifier (MRGID)

  • (double) Longitude in WGS84

  • Aditionally, you can pass objects of class sf::sf or sf::sfc with geometry of class POINT

...

Arguments passed on to gaz_rest_record_by_mrgid, gaz_rest_records_by_name, gaz_rest_records_by_names, gaz_rest_records_by_lat_long

with_geometry

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

rdf

(logical) Return an object of class rdflib::rdf?

typeid

(numeric) Restrict to one or more placetypeIDs. Retrieve a list of placetypeIDs with gaz_rest_types()

language

(character) Restrict to one language. Provide as a 2 digits ISO-639. See ISOcodes::ISO_639_2.

like

(logical) Add a '%'-sign before and after the name? (SQL LIKE function). Default = TRUE

fuzzy

(logical) Use Levenshtein query to find nearest matches? Default = TRUE

y

(double) Latitude in WGS84 (Optional)

Examples

Run this code
# \donttest{

# Look-up a name in the Gazetteer
gaz_search("North Sea")

# Get the entries of two known MRGID including their geometry
gaz_search(c(14, 17), with_geometry = TRUE)

# Maybe the name is in another language...
gaz_search("Noordzee", language = "nl")

# Get all the records intersecting with the longitude 51.21551 and latitude 2.927
# restricting to some placetypes
gaz_search(x = 2.927, y = 51.21551, typeid = c(255, 259))
# }

Run the code above in your browser using DataLab