3
1

Hey guys,

Another Overpass QL question. I'm using Overpass Turbo and trying to realise the following query:

General:

I'm trying to get nodes with a certain tag if there are member of a certain way.

Excplicit:

I want all nodes that have the tag barrier=lift_gate and are on ways that are highway=living_street or highway=residential.

Here's a first try on Overpass Turbo. I got all nodes and used recurse up to get the corresponding ways. But how do i filter them?

[out:json][timeout:25];
(
node["barrier"="lift_gate"]({{bbox}});
<;
);

out body;
>;
out skel qt;

Thanks in advance!

asked 03 Jan '15, 22:18

kerosin's gravatar image

kerosin
411131627
accept rate: 0%


One Answer:
6

I will use a slightly different approach here: as a first step, we search for all relevant ways in a bbox, then determine all nodes belonging to those ways and eventually filter nodes we're interested in:

[bbox:{{bbox}}];
way[highway~"^(living_street|residential)$"];
node(w)[barrier=lift_gate];
out meta;

http://overpass-turbo.eu/s/6P7

See documentation for details.

permanent link

answered 04 Jan '15, 09:01

mmd's gravatar image

mmd
5.6k14988
accept rate: 37%

edited 04 Jan '15, 09:28

1

Okay, thank you very much! I thought the approach of getting all ways first might be too inefficient. Another question, trying to extend your code: I got all nodes (barrier=lift_gate) that are a part of a set of highways (residential+living_street). Is it possible to ask if they are not connected to another type of street (track,service etc)? Mostly the type of highway changes on a barrier node (e.g. way with highway=residential|node with barrier=lift_gate|way with highway=service). I only want to get nodes that are connected on both ends with the same set of highways.

(04 Jan '15, 11:23) kerosin
2

meta: @kerosin: I am not sure, but I think this might be suitable for a new question (e.g. "how to remove nodes from a set which are connected to two differently tagged ways"). This would help others having the same question more.

(04 Jan '15, 11:42) aseerel4c26 ♦
1

@kerosin: sure that's possible: Compare http://overpass-turbo.eu/s/6Pv vs http://overpass-turbo.eu/s/6Pu . Will you create a new question?

(04 Jan '15, 11:52) mmd

Okay, thanks for suggestions and the overpass query :) Of course I will post a new question for others!

(04 Jan '15, 13:35) kerosin

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:

×139
×51

question asked: 03 Jan '15, 22:18

question was seen: 7,374 times

last updated: 04 Jan '15, 13:35

powered by OSQA