Home

Awesome

Project Status: Abandoned – Initial development has started, but there has not yet been a stable, usable release; the project has been abandoned and the author(s) do not intend on continuing development. The project has been abandoned and the author do not intend on continuing development.

R Interface to the Photon API

Photon is an open source geocoder built for OpenStreetMap data and based on elasticsearch. This package allows to query a photon API and get the results in a data frame.

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

Install Instructions

<pre><code>require(devtools) devtools::install_github(repo = 'rCarto/photon') </code></pre>

Usage

geocode()

<pre><code>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 </code></pre> <small>
locationosm_idosm_typenamehousenumberstreetpostcodecitystatecountryosm_keyosm_valuelonlatmsg
19 rue Michel Bakounine, 29600 Morlaix, France3241060871NNA19Rue Michel Bakounine29600MorlaixBrittanyFranceplacehouse-3.81643548.59041NA
5 rue Proudhon, 34130 Mauguio France3700168030NNA5Rue Proudhon34130MauguioOccitaniaFranceplacehouse4.00802443.61583NA
2 Emma Goldmanweg, Tilburg, Netherlands2844596196NNA2Emma Goldmanweg5032MNTilburgNorth BrabantThe Netherlandsplacehouse5.04136151.53783NA
36 Strada Panait Israti, Bucarest, Romania2838254765NNA36Strada Panait Istrati011547BucharestNARomaniaplacehouse26.06426644.46227NA
</small> <pre><code>geocode("Montreuil", limit = 1)</code></pre> <small>
locationosm_idosm_typenamehousenumberstreetpostcodecitystatecountryosm_keyosm_valuelonlatmsg
Montreuil2622231RMontreuilNANA62170NANord-Pas-de-Calais and PicardyFranceplacevillage1.76422850.46375NA
</small> <pre><code>geocode("Montreuil", locbias = c(2.4, 48.9), limit = 1)</code></pre> <small>
locationosm_idosm_typenamehousenumberstreetpostcodecitystatecountryosm_keyosm_valuelonlatmsg
Montreuil129423RMontreuilNANA93100NAIle-de-FranceFranceplacecity2.44121848.86234NA
</small> <pre><code># with a typical local install of photon place <- geocode(address, limit = 1, key = "place", server = "http://0.0.0.0:2322/") </code></pre>

reverse()

<pre><code>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</code></pre> <small>
xyosm_idosm_typenamehousenumberstreetpostcodecitystatecountryosm_keyosm_valuelonlatmsg
-3.81643548.590413241060871NNA19Rue Michel Bakounine29600MorlaixBrittanyFranceplacehouse-3.81643548.59041NA
4.00802443.615833700168030NNA5Rue Proudhon34130MauguioOccitaniaFranceplacehouse4.00802443.61583NA
5.04136151.537832844596196NNA2Emma Goldmanweg5032MNTilburgNorth BrabantThe Netherlandsplacehouse5.04136151.53783NA
26.06426644.462272838254765NNA36Strada Panait Istrati011547BucharestNARomaniaplacehouse26.06426644.46227NA
</small> <pre><code>identical(place[,2:12], place2[,3:13]) >TRUE </code></pre>