NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

The thing is I need to know that both moves away from a city and that both approaches another, but the search just gives me the data where it is, I need to do this search the names of the two nearest cities.

http://nominatim.openstreetmap.org/search?q=co+4.17897295000,-73.70788536667&format=xml&addressdetails=1

How do I do this query?

asked 30 Oct '12, 22:29

diegoug's gravatar image

diegoug
26112
accept rate: 0%


Nominatim is an address search engine and not really suited for your purpose. You are looking for another kind of search and Overpass API seems to fit a lot better.

Take a look at this example query for all place nodes in the area you mentioned:

http://overpass-api.de/api/interpreter?data=[out:json];node["place"](4.14,-73.73,4.21,-73.67);out;

Note that this query only searches for nodes, you want to search for ways, too, to find every city. If the query doesn't return anything for a specific area, try increasing the given bounding box. You can also choose a different output format, just take a look at the documentation and the examples.

permanent link

answered 31 Oct '12, 14:56

scai's gravatar image

scai ♦
33.3k21309459
accept rate: 23%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×710
×689
×362
×147
×111

question asked: 30 Oct '12, 22:29

question was seen: 18,951 times

last updated: 31 Oct '12, 14:56

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum