I am new to using OSM.I am trying to download OSM data programmatically using Python. I need data of ways and its child nodes contained in a perimeter specified by coordinates. Currently, I am referring to https://github.com/mvexel/overpass-api-python-wrapper which is mighty useful, but I am facing issues with the APIs.

This does not give me any data. Not sure if it has to do with syntax.

data = api.get('way(42.819,-73.881,42.820,-73.880)')

When I try

MapQuery = overpass.MapQuery(50.746,7.154,50.748,7.157)
response = api.get(MapQuery) 

I get a list of of features where I can't tell which is way or node.

I can work with XML or CSV format. I was hoping the data would look like a .osm file downloaded from JOSM.

  • overpass api with ways and your bounding box > overpass-turbo.eu/s/Gb6 (hit run) – Mapperz Feb 17 '19 at 1:04
  • @Mapperz Thanks, now I am getting data. Problem now is, when I run this on PyCharm my data looks like {"features": [{"geometry": {"coordinates": [-73.8805813, 42.8190013], "type": "Point"}, "id": 42001224, "properties": {"highway": "stop", "name": "All-way stop"}, "type": "Feature"}, I can work with xml or json, but the data is not in a template, like in overpass turbo, where I can identify way, node, nd. – Suraj Feb 18 '19 at 0:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.