Changes between Initial Version and Version 1 of Styles/RU-SubwayEntranceLabeling


Ignore:
Timestamp:
2018-02-11T19:37:59+01:00 (6 years ago)
Author:
Alexander-II
Comment:

initial commit

Legend:

Unmodified
Added
Removed
Modified
  • Styles/RU-SubwayEntranceLabeling

    v1 v1  
     1=== Kinda proof of concept in Overpass Turbo
     2Thanx to freeExec for helping with code.
     3https://overpass-turbo.eu/s/w6c
     4
     5{{{
     6
     7[out:xml][timeout:25][bbox:{{bbox}}];
     8
     9node[railway=subway_entrance];
     10
     11foreach(
     12  rel(bn)->.r;
     13  out skel;
     14  convert node
     15    ::id = id(),
     16    ref = t[ref],
     17    colour = t[colour],
     18    label = "Выход № " + t[ref] + " со станций: " + r.set(t[name]);
     19  out;
     20);
     21
     22{{style:
     23node {
     24  text: label;
     25}
     26}}
     27
     28}}}
     29
     30
     31=== code
     32{{{
     33#!style type="mapcss"
     34
     35meta {
     36    title: "Station names on subway entrances";
     37    version: "0.1.[[revision]]_[[date]]";
     38    description: "Shows station names on subway entrances via stop_area relation";
     39    author: "Alexander-II";
     40    link: "https://wiki.openstreetmap.org/wiki/Tag:public_transport%3Dstop_area";
     41}
     42
     43meta[lang=ru] {
     44    title: "Названия станций на выходах метро";
     45    description: "Показывает названия станций метро на выходах из метро";
     46    link: "https://wiki.openstreetmap.org/wiki/Tag:public_transport%3Dstop_area";
     47}
     48
     49relation[type=public_transport][public_transport=stop_area][name] > node::subway_entrance_label {
     50  station_name: parent_tags(name); /* this list won't contain more than one item until https://josm.openstreetmap.de/ticket/7151 is unresolved */
     51  set .has_station_name;
     52}
     53
     54node[railway=subway_entrance].has_station_name::subway_entrance_label {
     55  text: concat("Выход № ", tag(ref), " со станций: " ,join_list(", ", prop(station_name)));
     56/*  font-size: 12; TODO maybe it makes sense to put text size in settings */
     57}
     58
     59}}}