Overpass-API
Overpass-API copied to clipboard
"route_master" support in the public transport line diagram
The public transport tagging schema states that the "network" and "ref" tags are optional for a 'route' relation when there is a corresponding "route_master" relation. I really like this because the data is kept in a single place and it would be nice if the public transport line diagram would support this. Right now, the query built in 'src/cgi-bin/draw-line' only searches for "route"s, I tried to modify it to also take "route_master" into account and came up with this:
(
(
relation
["type"="route_master"]
["network"="$NETWORK"]
["ref"="$REF"]->.master;
rel(r.master);
);
relation
["network"="$NETWORK"]
["ref"="$REF"];
);
(
._;
node(r)->.__;
way(r);
node(w);
);
out body;
This works like before with the line "VRR"/"625" 1, but also works for "Verkehrsverbund Vorarlberg"/"90" 2, a line where the "route" relations don't have the "network" tag.
One little thing bothers me: When a "route_master" is present, it is also included into the output of the query. That's probably not a big problem, but I'm curious why this is the case (I use the ".master" variable to store the master relations, why do they show up in the output?). I also tried to change the query like this to filter out the master relations:
(
(
relation
["type"="route_master"]
["network"="$NETWORK"]
["ref"="$REF"]->.master;
rel(r.master);
);
relation
["network"="$NETWORK"]
["ref"="$REF"];
);
rel(r._)
["type"="route"];
(
._;
node(r)->.__;
way(r);
node(w);
);
out body;
This yields the desired output for "Verkehrsverbund Vorarlberg"/"90" 3 , but returns an empty output when looking for "VRR"/"625" 4. Very strange (at least for me).
Could you please modify the line diagram to also search for "route_master"s, and explain to me why the master relations are in the output and why the second query is wrong?
I've also noticed when trying to download data:
relation["type"="route_master"]
Returns nothing: http://overpass-turbo.eu/s/MPB
Where as there are a lot of sub relations in this area that the route_master encompasses: http://overpass-turbo.eu/s/MPE
It's almost as if recursion isn't a thing for determining the location of meta relations