biggis-project / path-optimizer

Former `heatstressrouting` shiny-based app
MIT License
2 stars 2 forks source link

Location api from graphhopper #10

Open vsimko opened 7 years ago

vsimko commented 7 years ago

Expected behaviour

When I type some location string e.g. "Karlsruhe" the coordinates should be transformed into lon/lat using the same API that graphhopper uses by default see this link.

Actual behavior

Currently, the Google API is used.

joachimrussig commented 7 years ago

I took a closer look on GraphHopper Geocoding and it seem that GraphHopper v0.6 (the version we currently use) uses the Mapquest Nominatim Web Service for geocoding (see here). In the newest GraphHopper release (v0.8) the geocoding seems to be performed client site using nominatim.openstreetmap.org (see here).

At the moment I can see three options:

vsimko commented 7 years ago

I would use the nominatim R wrapper

joachimrussig commented 7 years ago

Okay a took a closer look on the nominatim R wrapper and it uses the MapQuest Nomatim API which requiers an API key (15,000 request/month are for free).

It wouldn't be much affort to write a little R funciton myself that querys nominatim.openstreetmap.org/search (docs) directly, but I think the preferble alternative would be to use the Photon API which is for free and uses OSM data as well (and there is a R wrapper).

The bigest advantege of Nominatim API compared to the Photon API is, that search request can be restricted to a bounding box.