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

4
3

Is there a way to search for a node situated within a given distance from at least one other node with a given tag?

Applications:

asked 12 May '14, 03:05

dandv's gravatar image

dandv
40131114
accept rate: 0%

edited 12 May '14, 03:17

Uh, those examples are ...

(12 May '14, 07:56) scai ♦

Thankfully, the Overpass API supports an around operator. One needs to be careful with queries that return many nodes, and the query likely to return the fewest nodes should be first. Bounding boxes help.

Here's an example for the second query:

<query type="node">
  <has-kv k="amenity" v="brothel"/>
  <bbox-query {{bbox}}/>
</query>
<query type="node">
  <around radius="1000"/>
  <has-kv k="amenity" v="police"/>
</query>

<print/>

You can see it live for Berlin:

alt text

permanent link

answered 12 May '14, 05:04

dandv's gravatar image

dandv
40131114
accept rate: 0%

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:

×205
×193
×147
×63

question asked: 12 May '14, 03:05

question was seen: 6,916 times

last updated: 12 May '14, 07:56

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