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

I have a overpass query which returns lot of nodes. I would like to know whether there is a way to add reverse geocoding information to the resulting data set. Details of my case are not that important, but just for completness:

area[name="Česko"];(node[information="guidepost"](area););out;

in fact i do not need full reverse geocoding info for nodes, I only need relation of certain administrative level, so if this is possible to add into the result set, it would be great.

PS: I know that I can read the result set and then reverse geocode each individual node, but it seems very inefficient to me.

asked 19 Aug '14, 01:55

gorn's gravatar image

gorn
542212537
accept rate: 11%

edited 19 Aug '14, 10:55

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701


Please have a look at http://overpass-turbo.eu/s/4EF

The foreach loop enables you to get the areas a node lies in right after each node.

permanent link

answered 20 Aug '14, 08:04

Roland%20Olbricht's gravatar image

Roland Olbricht
6.7k36489
accept rate: 36%

edited 20 Aug '14, 18:16

1

To avoid retrieving the same area details many times, you could just return the area id in a first API call and retrieve the missing area details in a second query call for each distinct area id returned by the first query.

After the signpost node, you would just get the following detail from the first query:

<area id="3600435511"/> <area id="3600442466"/>

In a second query you could fetch the more details for those area ids: (area(3600435511);area(3600442466););out;

This could save some bandwidth on your end.

http://overpass-turbo.eu/s/4Fo

(20 Aug '14, 23:16) mmd
1

Execllent idea!

On top of this, you could even avoid to ask for a list of ids:

http://overpass-turbo.eu/s/4FJ

(21 Aug '14, 05:03) Roland Olbricht

For anyone arriving from a Google search:

area[name="Česko"];
node[information=guidepost][ele~"^1..$"](area)->.Posts;
.Posts is_in;
rel(pivot)[admin_level="6"];
out geom;
.Posts out center;
permanent link

answered 23 Jul '22, 23:21

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

Have a look for "batch geocoding" or "batch reverse geocoder" or similar on this FAQ site.

Or have a closer look at the OSM wiki about Search engines ... maybe there is a solution for your aim.

permanent link

answered 19 Aug '14, 16:09

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

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:

×483
×85
×36

question asked: 19 Aug '14, 01:55

question was seen: 10,917 times

last updated: 23 Jul '22, 23:21

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