NOTICE: help.openstreetmap.org 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

Stalfur
26113
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

baghaii
2162611
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

Stalfur
26113
accept rate: 0%

edited 29 Apr '15, 03:01

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

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 http://nominatim.openstreetmap.org/details.php?place_id=127699730 (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 https://github.com/twain47/Nominatim/issues/269

(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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×689
×483
×14

question asked: 29 Apr '15, 02:03

question was seen: 4,693 times

last updated: 30 Apr '15, 15:32

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