# These examples might require interaction to query the local keyring, or
# might fail due to network issues, so they are not run by default
if (FALSE) {
## locations of Heidelberg around the globe
x <- ors_geocode("Heidelberg")
## set the number of results returned
x <- ors_geocode("Heidelberg", size = 1)
## search within a particular country
ors_geocode("Heidelberg", boundary.country = "DE")
## structured geocoding
x <- ors_geocode(list(locality="Heidelberg", county="Heidelberg"))
## reverse geocoding
location <- x$features[[1L]]$geometry$coordinates
y <- ors_geocode(location = location, layers = "locality", size = 1)
}
Run the code above in your browser using DataLab