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


There are cities without relations. 'Search results' shows path of relations. How to get relation_ids from this path?

For example I am looking for 'Wislon'. In Search results I see City: 'Wilson, Wilson County, North Carolina, United States of America', ie Wilson is part of Wilson County and Wilson County is part of North Carolina and so on. If I go to the details of the city (click the link), at the bottom of the page I see there is no any relation.

How can I get relation_ids for Wilson County, North Carolina, United States of America? Usually I use, but this is not the case.

As I can guess, this path is based on latitude\longitude of a place, and map\engine checks the next bigger territory untill the country level is reached. Is there any API call which I can use to get relation_ids of this tree? Thank you.

asked 06 May '16, 22:42

bear_ukraine's gravatar image

accept rate: 0%

edited 06 May '16, 22:53

The county relation is available:

To obtain the county relation from another object, you could synthesize a coordinate for the object (maybe the center or use some method to select a child node) and use reverse geocoding to obtain the admin hierarchy for that point. Nominatim and Overpass API both have support for such queries:

permanent link

answered 06 May '16, 23:08

maxerickson's gravatar image

accept rate: 32%


Your information + some additional search + re-read few times Overpass API (lack of examples) and I have finally what I want :) Nominatim is cool thing, lots of example, but lack of functionality :)

Here is the example of the solution:;>;is_in;out;

Also related info:

(07 May '16, 00:11) bear_ukraine

Don't miss Overpass Turbo when working Overpas API queries.

(07 May '16, 02:31) maxerickson

Alternatively, you could go to Search for Wilson, pick the one you want, click on details and you get a page like

On that page you will find all the links of the relations used by Nominatim to calculate the address.

permanent link

answered 07 May '16, 11:13

escada's gravatar image

accept rate: 21%

Wow. This method is also cool. Is there any way how can I get the data from details page via API?

(07 May '16, 13:22) bear_ukraine

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: 06 May '16, 22:42

question was seen: 1,815 times

last updated: 07 May '16, 13:22

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