[GraphHopper] Get Street name and Town name of a GPS point
Thomas Ferris Nicolaisen
tfnico at gmail.com
Fri Nov 29 09:22:28 UTC 2013
On Fri, Nov 29, 2013 at 10:16 AM, Thomas Ferris Nicolaisen
<tfnico at gmail.com> wrote:
> On Fri, Nov 29, 2013 at 9:50 AM, Maxime Guyon <gmaxi17 at gmail.com> wrote:
>>
>> Hello,
>>
>> I want to know if it's possible to get the name of the street corresponding to a GPS point and if it's also possible to get the corresponding Town of the street.
Well, now I just realized I totally misread your question :)
I would have a closer look at the response that the maps application
gets back from the geocoding service. For example, when I click in
Berlin somewhere, I see (using the browser's developer tools) that
this request is sent:
http://nominatim.openstreetmap.org/reverse?lat=52.514807&lon=13.389947&format=json&zoom=16&json_callback=reverse_callback5&callback=reverse_callback5&_=1385716788366
And this response arrives:
reverse_callback5({"place_id":"45007684","licence":"Data \u00a9
OpenStreetMap contributors, ODbL 1.0.
http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"35557143","lat":"52.5148644","lon":"13.3911125","display_name":"Franz\u00f6sische
Stra\u00dfe, Berliner Urstromtal, Mitte, Berlin, 10117, Germany,
European Union","address":{"road":"Franz\u00f6sische
Stra\u00dfe","neighbourhood":"Berliner
Urstromtal","suburb":"Mitte","city_district":"Mitte","city":"Berlin","state":"Berlin","postcode":"10117","country":"Germany","country_code":"de","continent":"European
Union"}})
So using JavaScript you should be able to extract all the information you want.
More information about the GraphHopper
mailing list