reverse_geocode_coords: Reverse geocode based on lat/lon

Description Usage Arguments Value Note Examples

Description

Vectorized over lat and lon

Usage

1
2
3
4
reverse_geocode_coords(lat, lon, zoom = 18, address_details = TRUE,
  email = getOption("OSM_API_EMAIL", "nominatimrpackage@example.com"),
  accept_language = getOption("LANG", "en-US,en;q=0.8"),
  key = getOption("OSM_API_KEY", ""))

Arguments

lat

Latitude to generate an address for

lon

Longitude to generate an address for

zoom

Level of detail required where 0 is country and 18 is house/building

address_details

Include a breakdown of the address into elements (TRUE == include)

email

If you are making large numbers of request please include a valid email address or alternatively include your email address as part of the User-Agent string. This information will be kept confidential and only used to contact you in the event of a problem, see Usage Policy for more details. You can pass the value in directly or set the OSM_API_EMAIL option and the function will it for all requests.

accept_language

Preferred language order for showing search results Either uses standard rfc2616 accept-language string or a simple comma separated l ist of language codes. The LANG option will be used, if set.#'

key

To access the openstreetmap API you need a valid API key. You can get it for free at https://developer.mapquest.com

Value

data.frame of reverse geocode results

Note

A slight delay is introduced between calls as both OpenStreetMap Nominatim & MapQuest Nominatim API calls to reduce load on their servers.

Data (c) OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright
Nominatim Usage Policy: http://wiki.openstreetmap.org/wiki/Nominatim_usage_policy
MapQuest Nominatim Terms of Use: http://info.mapquest.com/terms-of-use/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# Reverse geocode Canadian embassies
# complete list of Canadian embassies here:
# http://open.canada.ca/data/en/dataset/6661f0f8-2fb2-46fa-9394-c033d581d531
embassies <- data.frame(lat=c("34.53311", "41.327546", "41.91534", "36.76148", "-13.83282",
                              "40.479094", "-17.820705", "13.09511", "13.09511"),
                        lon=c("69.1835", "19.818698", "12.50891", "3.0166", "-171.76462",
                              "-3.686115", "31.043559", "-59.59998", "-59.59998"),
                        osm_type=c("R", "W", "R", "N", "N", "W", "R", "N", "N"),
                        osm_id=c("3836233", "267586999", "3718093", "501522082", "305640297",
                                 "309487691", "2793217", "501458399", "501458399"),
                                 stringsAsFactors=FALSE)
emb_coded_coords <- reverse_geocode_coords(embassies$lat, embassies$lon)

## End(Not run)

hrbrmstr/nominatim documentation built on May 17, 2019, 5:11 p.m.