Get the geographic coordinates of a city in OpenStreetMap

I am new to OpenStreetMap Api, so sorry for my main questions: How do I get the geographic coordinates of a city with its name using the OpenStreetMap API? And related to this, how can I get the street coordinates in this city?

Thanks!

+4
source share
1 answer

There is no way to do this with the main api, and you should not try, since the main api is primarily for editors.

What you need is a geocoder, nominate. You can find detailed information about this on the wiki , but basically you want to use a query like this:

http://nominatim.openstreetmap.org/search?q=paris&format=xml 

An XML document will be returned listing possible matches and their locations.

+14
source

All Articles