mocnik-science / osm-python-tools

A library to access OpenStreetMap related services
GNU General Public License v3.0
440 stars 48 forks source link

querying cities with special characters and spaces #57

Closed chvieira2 closed 2 years ago

chvieira2 commented 2 years ago

Hi,

could you help me with the following problem? I think there's some easy solution that I can't seem to find by myself...

I'm running the following query for several cities. The query works fine for cities with generally easy names like Berlin, Budapest, London, Paris, etc. However, I can't make it work for cities with spaces in the name (New York, Rio de Janeiro), or cities with special characters (Köln, Münich, Rīga). Any ideas?

""" [out:json][timeout:900]; area[name=New York]->.city; (node'amenity'='bus_station';node'highway'='bus_stop'; ); (._;>;); out center;

chvieira2 commented 2 years ago

Sorry for the silly question. I already found my own mistake. I should put the city name in quotes...

[out:json][timeout:900]; area[name="New York"]->.city; (node'amenity'='bus_station';node'highway'='bus_stop'; ); (._;>;); out center;