NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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 :

 <node id="**107775**" lat="51.5072759" lon="-0.1276597">
    <tag k="capital" v="yes"/>
    <tag k="ele" v="15"/>
    <tag k="is_in" v="England, United Kingdom, UK, Great Britain, Europe"/>
    <tag k="is_in:continent" v="Europe"/>
    <tag k="is_in:country" v="United Kingdom"/>
    <tag k="media:commons" v=""/>
    <tag k="name" v="London"/>
    <tag k="website" v=""/>
    <tag k="wikipedia" v="en:London"/>

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 ?


asked 11 Apr '13, 12:20

Kobz's gravatar image

accept rate: 0%

edited 11 Apr '13, 12:22

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: Note that this does not applies to every city (remarkably small ones) as OSM's data quality varies.

(13 Apr '13, 01:37) aseerel4c26 ♦

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

permanent link

answered 15 Apr '13, 17:10

stephan75's gravatar image

accept rate: 6%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 11 Apr '13, 12:20

question was seen: 7,785 times

last updated: 15 Apr '13, 17:10

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum