| 1 | === Kinda proof of concept in Overpass Turbo |
| 2 | Thanx to freeExec for helping with code. |
| 3 | https://overpass-turbo.eu/s/w6c |
| 4 | |
| 5 | {{{ |
| 6 | |
| 7 | [out:xml][timeout:25][bbox:{{bbox}}]; |
| 8 | |
| 9 | node[railway=subway_entrance]; |
| 10 | |
| 11 | foreach( |
| 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: |
| 23 | node { |
| 24 | text: label; |
| 25 | } |
| 26 | }} |
| 27 | |
| 28 | }}} |
| 29 | |
| 30 | |
| 31 | === code |
| 32 | {{{ |
| 33 | #!style type="mapcss" |
| 34 | |
| 35 | meta { |
| 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 | |
| 43 | meta[lang=ru] { |
| 44 | title: "Названия станций на выходах метро"; |
| 45 | description: "Показывает названия станций метро на выходах из метро"; |
| 46 | link: "https://wiki.openstreetmap.org/wiki/Tag:public_transport%3Dstop_area"; |
| 47 | } |
| 48 | |
| 49 | relation[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 | |
| 54 | node[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 | }}} |