Hello, I'm using Overpass API and I'm looking for a way to get everything which is in a city determined by the ID of its node. For instance, If we're getting a closer look to London, it shows :
I'd like to get the bounding box of this city thanks to its node ID (here : 107775). I managed to do this thanks to the name of the city by the request : (rel["name"='London'];>;);out; But as you can see, in case of multiple places with the same name, you get multiple bounding box. That's the reason why I'd like to get this bounding box thanks to the ID of the node associated to the city. So, to sum um, with this node : node(107775), is it possible to get the bounding box of the city ? Thanks asked 11 Apr '13, 12:20 Kobz |
First of all, it seems that you are not looking for exact bounding boxes of a certain city, but for its boundary relation. Main problem: the binding from a node to its boundary relation is not completley mapped in the OSM data. There are some countries where you have boundary relations with one node as a member with the role admin_centre ... thus you ca find all place nodes that are member of a boundary relation. But this binding is incomplete in the world, even in Germany this data model is not so widely spreaded. see Relation:boundary in the OSM wiki. Maybe also helpful: overpass-get-relation-and-node-in-one-query-for-city answered 15 Apr '13, 17:10 stephan75 |
I am not really sure that I understand your question (a bounding box based on a node?!?) - however, maybe it helps that many cities have their boundaries mapped like this: http://www.openstreetmap.org/browse/relation/62400 Note that this does not applies to every city (remarkably small ones) as OSM's data quality varies.