geocode | R Documentation |
This function geocode locations using the photon API.
geocode(
location,
limit = NULL,
key = NULL,
value = NULL,
lang = NULL,
locbias = NULL,
server = NULL,
quiet = TRUE
)
location |
Location(s) to geocode, a character vector. |
limit |
Maximum number of returned results. |
key |
Photon allows filtering based on OSM tags and values (see photon documentation). |
value |
Photon allows filtering based on OSM tags and values (see photon documentation). |
lang |
Photon is multilingual, this parameter allows to specify a language. |
locbias |
Location bias. A pair of coordinates (WGS84, |
server |
Select which API is used. The default API is the photon public API (see Details), but you can use your own photon API. |
quiet |
Should the function print the currently processed input ? |
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!"
A data.frame with the following fields is returned :
location, osm_id, osm_type, name, housenumber, street, postcode, city, state,
country, osm_key, osm_value, lon, lat, msg.
location
is the original searched location.
lon
and lat
are longitude and latitude (WGS84).
msg
is filled with the "Not found" text string if no results are found for a
location.
Photon web site http://photon.komoot.de/
Photon source code https://github.com/komoot/photon
## 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")
place
geocode("Montreuil", limit = 1)
geocode("Montreuil", locbias = c(2.4, 48.9), limit = 1)
# with a typical local install of photon
place <- geocode(address, limit = 1, key = "place", server = "http://0.0.0.0:2322/")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.