Learn R Programming

mregions (version 0.1.8)

mr_rev_geo_code: Reverse Geocode with Marineregions

Description

Retrieve the names of geographic objects from coordinates (and optionally a radius around them).

Usage

mr_rev_geo_code(lat, lon, lat_radius = 1, lon_radius = 1, ...)

Arguments

lat

(numeric) Latitude for the coordinates (decimal format)

lon

(numeric) Longitude for the coordinates (decimal format)

lat_radius

(numeric) Extends search to include the range from lat-lat_radius to lat+lat_radius

lon_radius

(numeric) Extends search to include the range from lon-lon_radius to lon+lon_radius

...

curl options to be passed on to httr::GET()

Value

If no results, an empty list. If results found, a data.frame with the columns:

  • MRGID (integer)

  • gazetteerSource (character)

  • placeType (character)

  • latitude (numeric)

  • longitude (numeric)

  • minLatitude (numeric)

  • minLongitude (numeric)

  • maxLatitude (numeric)

  • maxLongitude (numeric)

  • precision (numeric)

  • preferredGazetteerName (character)

  • preferredGazetteerNameLang (character)

  • status (character)

  • accepted (integer)

Examples

Run this code
# NOT RUN {
# Setting radius to 0.5
mr_rev_geo_code(-21.5, 55.5, lat_radius=0.5, lon_radius=0.5)

# radius to 3
mr_rev_geo_code(-21.5, 55.5, lat_radius=3, lon_radius=3)

# radius to 1
mr_rev_geo_code(-15, 45, lat_radius=1, lon_radius=1)
# }

Run the code above in your browser using DataLab