Skip to content

Commit c19a215

Browse files
authored
Merge pull request #115 from davide84/master
Rendering of Chinese CTCS signalling
2 parents 2639d75 + c0cc032 commit c19a215

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

signals.mml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ Layer:
9898
NULL AS construction_usage, NULL AS construction_service,
9999
NULL AS preserved_railway, NULL AS preserved_service,
100100
NULL AS preserved_usage,
101-
pzb, lzb, zsi127, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, etcs, construction_etcs,
102-
railway_train_protection_rank(pzb, lzb, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, zsi127, etcs, construction_etcs) AS rank
101+
pzb, lzb, zsi127, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, ctcs, etcs, construction_etcs,
102+
railway_train_protection_rank(pzb, lzb, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, zsi127, ctcs, etcs, construction_etcs) AS rank
103103
FROM
104104
(SELECT
105105
way, railway, usage,
@@ -115,6 +115,7 @@ Layer:
115115
tags->'railway:tvm' AS tvm,
116116
tags->'railway:scmt' AS scmt,
117117
tags->'railway:asfa' AS asfa,
118+
railway_null_or_zero_to_no(tags->'railway:ctcs') AS ctcs,
118119
railway_null_or_zero_to_no(tags->'railway:ptc') AS ptc,
119120
railway_null_or_zero_to_no(tags->'railway:etcs') AS etcs,
120121
railway_null_or_zero_to_no(tags->'construction:railway:etcs') AS construction_etcs
@@ -142,8 +143,8 @@ Layer:
142143
NULL AS construction_usage, NULL AS construction_service,
143144
NULL AS preserved_railway, NULL AS preserved_service,
144145
NULL AS preserved_usage,
145-
pzb, lzb, zsi127, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, etcs, construction_etcs,
146-
railway_train_protection_rank(pzb, lzb, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, zsi127, etcs, construction_etcs) AS rank
146+
pzb, lzb, zsi127, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, ctcs, etcs, construction_etcs,
147+
railway_train_protection_rank(pzb, lzb, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, zsi127, ctcs, etcs, construction_etcs) AS rank
147148
FROM
148149
(SELECT
149150
way, railway, usage,
@@ -159,6 +160,7 @@ Layer:
159160
tags->'railway:tvm' AS tvm,
160161
tags->'railway:scmt' AS scmt,
161162
tags->'railway:asfa' AS asfa,
163+
railway_null_or_zero_to_no(tags->'railway:ctcs') AS ctcs,
162164
railway_null_or_zero_to_no(tags->'railway:ptc') AS ptc,
163165
railway_null_or_zero_to_no(tags->'railway:etcs') AS etcs,
164166
railway_null_or_zero_to_no(tags->'construction:railway:etcs') AS construction_etcs
@@ -186,8 +188,8 @@ Layer:
186188
construction_usage, construction_service,
187189
preserved_railway, preserved_service,
188190
preserved_usage,
189-
pzb, lzb, zsi127, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, etcs, construction_etcs,
190-
railway_train_protection_rank(pzb, lzb, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, zsi127, etcs, construction_etcs) AS rank
191+
pzb, lzb, zsi127, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, ctcs, etcs, construction_etcs,
192+
railway_train_protection_rank(pzb, lzb, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, zsi127, ctcs, etcs, construction_etcs) AS rank
191193
FROM
192194
(SELECT
193195
way, railway, usage, service,
@@ -210,6 +212,7 @@ Layer:
210212
tags->'railway:tvm' AS tvm,
211213
tags->'railway:scmt' AS scmt,
212214
tags->'railway:asfa' AS asfa,
215+
railway_null_or_zero_to_no(tags->'railway:ctcs') AS ctcs,
213216
railway_null_or_zero_to_no(tags->'railway:ptc') AS ptc,
214217
railway_null_or_zero_to_no(tags->'railway:etcs') AS etcs,
215218
railway_null_or_zero_to_no(tags->'construction:railway:etcs') AS construction_etcs,

sql/functions.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ CREATE OR REPLACE FUNCTION railway_train_protection_rank(
322322
asfa TEXT,
323323
ptc TEXT,
324324
zsi127 TEXT,
325+
ctcs TEXT,
325326
etcs TEXT,
326327
construction_etcs TEXT) RETURNS INTEGER AS $$
327328
BEGIN
@@ -330,6 +331,9 @@ BEGIN
330331
END IF;
331332
IF ptc <> 'no' THEN
332333
RETURN 10;
334+
END IF;
335+
IF ctcs <> 'no' THEN
336+
RETURN 10;
333337
END IF;
334338
IF construction_etcs <> 'no' THEN
335339
RETURN 9;
@@ -361,7 +365,7 @@ BEGIN
361365
IF pzb = 'yes' THEN
362366
RETURN 2;
363367
END IF;
364-
IF (pzb = 'no' AND lzb = 'no' AND etcs = 'no') OR (atb = 'no' AND etcs = 'no') OR (atc = 'no' AND etcs = 'no') OR (scmt = 'no' AND etcs = 'no') OR (asfa = 'no' AND etcs = 'no') OR (kvb = 'no' AND tvm = 'no' AND etcs = 'no') OR (zsi127 = 'no') THEN
368+
IF (pzb = 'no' AND lzb = 'no' AND etcs = 'no') OR (atb = 'no' AND etcs = 'no') OR (atc = 'no' AND etcs = 'no') OR (scmt = 'no' AND etcs = 'no') OR (asfa = 'no' AND etcs = 'no') OR (kvb = 'no' AND tvm = 'no' AND etcs = 'no') OR (zsi127 = 'no') OR (ctcs = 'no') THEN
365369
RETURN 1;
366370
END IF;
367371
RETURN 0;

train_protection.mss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
@kvb_color: #66cc33;
1515
@tvm_color: #009966;
1616
@ptc_color: #cc0033;
17+
@ctcs_color: orange;
1718
@etcs_color: blue;
1819
@etcs_construction_color: #87CEFA;
1920

@@ -101,6 +102,9 @@
101102
["ptc"!="no"] {
102103
line-color: @ptc_color;
103104
}
105+
["ctcs"!="no"] {
106+
line-color: @ctcs_color;
107+
}
104108
["zsi127"="yes"] {
105109
line-color: @zsi127_color;
106110
}

0 commit comments

Comments
 (0)