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

I am struggling with my query setup. What i want is a set of nodes and ways (and their related nodes) in a given radius.

This is what i have so far:

(
nw(around:1000,52.46989,13.21026)[highway~"^(motorway|trunk|primary|secondary|tertiary|unclassified|residential|living_street|service)$"];
nw(around:1000,52.46989,13.21026)[highway~"^(footway|path|track)$"];
nw(around:1000,52.46989,13.21026)[natural~"^(cave_entrance|spring|peak|rock)$"];
nw(around:1000,52.46989,13.21026)[tourism~"^(wildernis_hut|viewpoint)$"];
);
(._;>;);
out body;

This returns all the related of nodes of the found ways in that radius. But i don't want nodes that are not in the given radius, even if they are related to said ways. How can i achieve this?

Also i am sure there is a more efficient way to use the around-filter (only applying it ones) but i couldn't figure this out either.

asked 09 May '22, 12:42

Tibooo's gravatar image

Tibooo
11113
accept rate: 0%

IIRC the string of punctuation on the line above out body gives all child nodes for the dataset under consideration. I imagine you would need to re-filter for distance after this stage, but that might give poor results as a straight section of road passing through the area could have no nodes in the search radius even if it goes directly over the point you're querying.

(11 May '22, 08:43) InsertUser

thank you for the reply @InsertUser, i think this is it. i tried to replace the line with another around filter but if i just add another around filter instead it works! (although it seems very hacky)

(12 May '22, 13:42) Tibooo

@Tibooo Could you post your solution for others to learn from.

(07 Jun '22, 17:12) DaveF

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:

×65
×16
×12

question asked: 09 May '22, 12:42

question was seen: 881 times

last updated: 07 Jun '22, 17:12

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