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

Working on a gadget that gets city/town/village/hamlet nodes from Overpass and then uses Nominatim to get the state_district/state.

Is there no better way to automatically get the two top tier administrative levels for each city/town/village/hamlet?

asked 29 Apr '15, 02:03

Stalfur's gravatar image

accept rate: 0%

It seems like the first two queries are working in different ways from one another. The first one is using lat/lon coordinates for its reverse lookup, and the second one is using osm_id. The third and fourth one are relying on the osm_id method.

When I used this tool to find the lat/lon coordinates for Pratt, Kansas, it seems to work better for me.

Here is what I got for the Pratt, Kansas query when I used lat/lon to look it up.

permanent link

answered 29 Apr '15, 02:24

baghaii's gravatar image

accept rate: 20%

Using lat/lon gives me

Why does lat/lon give me this when osm_id doesn't?

permanent link

answered 29 Apr '15, 02:49

Stalfur's gravatar image

accept rate: 0%

edited 29 Apr '15, 03:01

aseerel4c26's gravatar image

aseerel4c26 ♦

meta: this should be a comment on baghaii's answer, right? please could you use the "add new comment" button to add it there (due to technical problem I cannot convert it)

(29 Apr '15, 03:03) aseerel4c26 ♦

I hadn't seen baghaii's answer when I posted this. I'm still perplexed as to why these two methods don't return the same answer. OSM_ID is reccomended over lat/lon.

(29 Apr '15, 08:44) Stalfur

When I try this query with node 316955993 The result returns the state. So IMHO it depends on the node you are investigating.

I found that node ID via (the first link when I looked for Pratt on that website), then I took the node id under the section "linked places"

(30 Apr '15, 11:16) escada

Your query escada is for the county, my query was for the city within the county. I've filed a bug at nominatim for this

(30 Apr '15, 15:32) Stalfur

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: 29 Apr '15, 02:03

question was seen: 4,419 times

last updated: 30 Apr '15, 15:32

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