reverse: Reverse Geocode Locations With Photon API

Description Usage Arguments Details Value References Examples

View source: R/geocode.R

Description

This function reverse geocode locations using the photon API.

Usage

1
reverse(x, y, server = NULL)

Arguments

x

Longitude(s).

y

Latitude(s).

server

Select which API is used. The default API is the photon public API (see Details), but you can use your own photon API.

Details

Terms of use of the photon public API:
"You can use the API for your project, but please be fair - extensive usage will be throttled. We do not guarantee for the availability and usage might be subject of change in the future. Have fun with photon and make OSM grow!"

Value

A data.frame with the following fields is returned :
x, y, osm_id, osm_type, name, housenumber, street, postcode, city, state, country, osm_key, osm_value, lon, lat, msg.
x and y are the original searched coordinates
msg is filled with the "Not found" text string if no results are found for a location.

References

Photon web site http://photon.komoot.de/
Photon source code https://github.com/komoot/photon

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
address <- c("19 rue Michel Bakounine, 29600 Morlaix, France",
             "5 rue Proudhon, 34130 Mauguio France",
             "2 Emma Goldmanweg, Tilburg, Netherlands",
             "36 Strada Panait Israti, Bucarest, Romania")
place <- geocode(address, limit = 1, key = "place")
place2 <- reverse(x = place$lon, y = place$lat)
place2

identical(place[,2:12], place2[,3:13])

## End(Not run)

rCarto/photon documentation built on Oct. 7, 2017, 9:51 a.m.