wiki:Styles/RU-SubwayEntranceLabeling

Version 3 (modified by Alexander-II, 3 months ago) (diff)

--

Kinda proof of concept in Overpass Turbo

Thanx to freeExec for helping with overpass ql code. https://overpass-turbo.eu/s/w6c | https://forum.openstreetmap.org/viewtopic.php?pid=684527#p684527

[out:xml][timeout:25][bbox:{{bbox}}];

node[railway=subway_entrance];

foreach(
  rel(bn)->.r;
  out skel;
  convert node 
    ::id = id(),
    ref = t[ref],
    colour = t[colour],
    label = "Выход № " + t[ref] + " со станций: " + r.set(t[name]);
  out;
);

{{style:
node {
  text: label;
}
}}

code

meta {
    title: "Station names on subway entrances";
    version: "0.1.3_2018-02-11";
    description: "Shows station names on subway entrances via stop_area relation";
    author: "Alexander-II";
    link: "https://wiki.openstreetmap.org/wiki/Tag:public_transport%3Dstop_area";
}

meta[lang=ru] {
    title: "Названия станций на выходах метро";
    description: "Показывает названия станций метро на выходах из метро с использованием отношения stop_area";
    link: "https://wiki.openstreetmap.org/wiki/Tag:public_transport%3Dstop_area";
}

relation[type=public_transport][public_transport=stop_area][name] > node::subway_entrance_label {
  station_name: parent_tags(name); /* this list won't contain more than one item until https://josm.openstreetmap.de/ticket/7151 is unresolved */
  set .has_station_name;
}

node|z18-[railway=subway_entrance].has_station_name::subway_entrance_label {
  text: concat("Выход № ", tag(ref), " со станций: " ,join_list(", ", prop(station_name)));
  text-anchor-vertical: above;
  text-offset-x: 5;
  font-size: 11; /* TODO maybe it makes sense to put text size in settings */
}

Styles_RU-SubwayEntranceLabeling-style.mapcss, Styles_RU-SubwayEntranceLabeling.zip