Loomio
Thu 30 Jul 2020 9:32AM

Overpass: How to get all OSM nodes, ways, areas within a boundary?

HD Huw Diprose Public Seen by 37

Hey,
I'm hoping to experiment this weekend and learn a bit of JSOM, play with some pyhton libraries and perhaps try rendering some stuff in QGIS.

I'd quite like to define myself a specific area to pull down all nodes, ways and areas within - I was ideally thinking of the ward that I live in, but failing that I'd take my Council's boundaries.

I've learned a bit of Overpass, and been using overpass turbo - but i'm struggling to give it an area to query within that isn't the bounding box. Does anyone know the answer to the following:

1) Does OSM store ward boundaries for the UK? I couldn't find them as administrativeboundaries
2) Given a boundary of any kind, is it possible to provide that to overpass and then say get me all nodes, ways and areas within it to load into JSOM or QGIS? If anyone had a link to any docs or blogs with example queries, that would be great, my googling has not been too successful so far!
3) Assuming I can make this query... should I? I guess every bit of data within a council might be quite large, is there a recommended place to get that from for UK data so I don't hammer someone's server?

Any help or thoughts would be much appreciated!
Huw

R

RobJN Thu 30 Jul 2020 10:27PM

Hi Huw, for point 3 the following links might help:

R

RobJN Thu 30 Jul 2020 10:33PM

For point 2 it is possible to have overpass filter by an area boundary. The area needs to be in OpenStreetMap as a relation. You also need to know the relation ID number.

I always struggle and need to ask for help when I do this. But perhaps you can look at a recent example I did related to updating HSBC bank names. The example uses the West Midlands relation.

https://wiki.openstreetmap.org/wiki/Automated_edits/RobJN#HSBC_UK_edit_in_the_West_Midlands

Point 1 I’m not very knowledgeable on. Best to use the query tool to look at the data in your locality.

HD

Huw Diprose Wed 5 Aug 2020 1:08PM

😁 Thanks Rob! Lots of great links!
I'm going to dive in a bit more this weekend.

Also great to see an example from the automated edits section of the wiki. I'll have a good read through of a few examples and that code of conduct.

Thanks again