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

I have a following query build almost same as the example at : http://wiki.openstreetmap.org/wiki/Overpass_API It should return all town areas in the given box (second query) that are close to way from a first query, however it return a huuuge list of (?) random (?) towns and I don't know what's wrong

<query type="way"> <bbox-query n="50.3651" s="50.3498" w="20.013" e="20.0468"/> <has-kv k="highway" v="primary"/> </query> <bbox-query n="50.3651" s="50.3498" w="20.013" e="20.0468"/> <query type="area"> <has-kv k="place" v="town"/> </query> <print/>

asked 15 Jan '15, 17:37

huberttt's gravatar image

huberttt
31224
accept rate: 0%

edited 15 Jan '15, 20:23

Roland%20Olbricht's gravatar image

Roland Olbricht
6.7k36489

1

areas are only created for ways and relations, if they have a name (very broadly speaking). However, in your bbox, there's neither a way with place=town nor a relation with the same tagging. Only a single node, but for that one, there's no area as I mentioned.

Can you rephrase a bit what you're trying to do? I didn't quite get it from your question.

The following query would find all nodes with place=town up to 3km distance to your way. That's about the only information you would get in your bbox: http://overpass-turbo.eu/s/733

(15 Jan '15, 17:54) mmd
1

Ok, maybe my goal was a bit messy. What my point is: Supposed we have a road ( highway=primary) , I want to find all the towns near that road (within some radius maybe 100-400m)

(15 Jan '15, 17:57) huberttt

Thank you, seems to work pretty nice, suffices. Regards

(15 Jan '15, 18:09) huberttt

And just one more question, what if I would like to list all the cities like before but not in a box ? I'mean for all length of road?

(15 Jan '15, 18:12) huberttt
1

The following query will check along ref=7 in Poland (according to the existing relation) - http://overpass-turbo.eu/s/739 ... Note that it takes several minutes to run this query.

(15 Jan '15, 18:35) mmd

Well, you can try and play around a bit with the following query: http://overpass-turbo.eu/s/734 - or - http://overpass-turbo.eu/s/735 (which includes highways on the map)

It will return all town nodes up to 5000m distance to a highway=primary in your current bbox.

permanent link

answered 15 Jan '15, 18:28

mmd's gravatar image

mmd
5.7k15388
accept rate: 37%

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:

×213
×147
×85

question asked: 15 Jan '15, 17:37

question was seen: 3,864 times

last updated: 15 Jan '15, 20:23

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