I wish to get nodes that belong to a particular city. I tried doing a radius search around the latitude and longitude of the city but that is just an approximation. Moreover the radius varies from one city to another. Is there a good way to do this using Open Street Maps?


1 Answer 1


When there is a boundary relation for that city area (like political boundaries) you can use its name for a query via overpass-api or overpass-turbo.

So first find out about any good boundary relation within the OSM data: go to http://nominatim.openstreetmap.org and try to find a boundary relation for your city ... for example type "Buxtehude" in its search box there (Buxtehude is a small city in the north of Germany) ... see the results and its detail links.

With that background knowledge vidit http://overpass-turbo.eu and use its wizard modus: Try "shop=* in Buxtehude" there ... without ""

Thus you can limit any query via overpass-api or overpass-turbo (or even QuickOSM-Plugin in QGIS) to any city area as long as we have boundaries for that in the OSM data.

Please refer to the documentation of overpass-api and overpass turbo at wiki.osm.org

If you get stuck about a boundary is present or not, tell us the name of the city we can use for testing purposes.

Tell us here about success or failure in general.

  • 1
    I found another solution to this problem - using area queries. Eg. [out:json]; area[name = "New York"]; node(area)[amenity=bar]; out; However the issue with this is that if I query the following: [out:json]; area[name = "New York"]; ( node(area)[amenity=bar]; node(area)[amenity=restaurant]; ); out; The output includes only the first amenity, i.e. 'bar' even though there's a union. Any ideas?
    – user53963
    Jun 21, 2015 at 5:50
  • I can confirm that your last query only returns bars, but no restaurants ... I have no knowledge whether there is an error in that query or a bug in overpass-api ... Tried to enter "amenity=bar or amenity=restaurent in XXX" in overpass-turbo-Wizard and it also gives only the bars and not the restaurants!!! Any experts here??????
    – stephan75
    Jun 21, 2015 at 10:27
  • 1
    @stephan75: I think you simply made a typo, it's restaurant, not restaurent. The same user created a new question for this topic: gis.stackexchange.com/questions/151702/…
    – mmd
    Jun 21, 2015 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.