1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
 
/*
Find all bridges and tunnels that have an inner node
connected to another way that is not a bridge or tunnel.
 
By Shaun das Schaf
*/
 
[timeout:600];
 
{{geocodeArea:"Freiburg"}}->.searchArea;
 
// BRIDGES
way[highway][bridge=yes](area.searchArea); // Select all bridges
 
foreach ->.b
{
  node(w.b)->.n;
  if (n.count(nodes) > 2) // Only process bridges with at least one inner node
  {
    (.n; - node(w.b:1,-1);); // Select inner nodes
    foreach
    {
      way(bn)[highway][bridge!=yes]->.p; // For each inner node select the parent ways
      if (p.count(ways) >= 1)
      {
        (.b; .p;); // Output bridge and connected way
        out;
        >;
        out skel;
      }
    }
  }
}
 
// TUNNELS
way[highway][tunnel=yes](area.searchArea); // Select all tunnels
 
foreach ->.t
{
  node(w.t)->.n;
  if (n.count(nodes) > 2) // Only process tunnels with at least one inner node
  {
    (.n; - node(w.t:1,-1);); // Select inner nodes
    foreach
    {
      way(bn)[highway][tunnel!=yes]->.p; // For each inner node select the parent ways
      if (p.count(ways) >= 1)
      {
        (.t; .p;); // Output tunnel and connected way
        out;
        >;
        out skel;
      }
    }
  }
}
 
 
 
{{style:
 
way
{ color:red; fill-color:red; }
 
way[tunnel=yes]
{ color:green; fill-color:green; }
  
way[bridge=yes]
{ color:blue; fill-color:blue; }
 
}}
500 m
Leaflet © OpenStreetMap contributors
1
 
no data loaded yet