This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Cities from country via API

0

Hi OSM-community! I am new to the subject, so I ask for a hint. I've found this awesome script: https://gist.github.com/4gus71n/26589a508d8deca333bb05928fd4beb0 which I try to modify. Line I am working on is:

data = api.get('area('+str(id)+')->.a;(way(area.a)["name"]["highway"]["highway" !~ "path"]..blahblah..["highway" !~ "cycleway"]["foot" !~ "no"]["access" !~ "private"]["access" !~ "no"];node(w)(area.a););out;')

I try to make it get cities when given id of country. What I have for now is:

data = api.get('area('+str(id)+')->.a;(node(area.a)["name"]["place"="city"];node(w)(area.a););out;')

As you probably figured out - it does not work. I've tried many things and I'm unable to make it work. Could I ask for any hints? I also have tried to go with OverpassTurbo, but any query I fed was giving empty results.

Thanks!

asked 16 Jun '21, 13:26

siemaeniownik's gravatar image

siemaeniownik
26223
accept rate: 0%

edited 16 Jun '21, 13:27

Source code available on GitHub .