diff --git a/signals.mml b/signals.mml index c3a3f0a9..b1f53795 100644 --- a/signals.mml +++ b/signals.mml @@ -98,8 +98,8 @@ Layer: NULL AS construction_usage, NULL AS construction_service, NULL AS preserved_railway, NULL AS preserved_service, NULL AS preserved_usage, - pzb, lzb, zsi127, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, etcs, construction_etcs, - 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 + pzb, lzb, zsi127, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, ctcs, etcs, construction_etcs, + 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 FROM (SELECT way, railway, usage, @@ -115,6 +115,7 @@ Layer: tags->'railway:tvm' AS tvm, tags->'railway:scmt' AS scmt, tags->'railway:asfa' AS asfa, + railway_null_or_zero_to_no(tags->'railway:ctcs') AS ctcs, railway_null_or_zero_to_no(tags->'railway:ptc') AS ptc, railway_null_or_zero_to_no(tags->'railway:etcs') AS etcs, railway_null_or_zero_to_no(tags->'construction:railway:etcs') AS construction_etcs @@ -142,8 +143,8 @@ Layer: NULL AS construction_usage, NULL AS construction_service, NULL AS preserved_railway, NULL AS preserved_service, NULL AS preserved_usage, - pzb, lzb, zsi127, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, etcs, construction_etcs, - 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 + pzb, lzb, zsi127, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, ctcs, etcs, construction_etcs, + 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 FROM (SELECT way, railway, usage, @@ -159,6 +160,7 @@ Layer: tags->'railway:tvm' AS tvm, tags->'railway:scmt' AS scmt, tags->'railway:asfa' AS asfa, + railway_null_or_zero_to_no(tags->'railway:ctcs') AS ctcs, railway_null_or_zero_to_no(tags->'railway:ptc') AS ptc, railway_null_or_zero_to_no(tags->'railway:etcs') AS etcs, railway_null_or_zero_to_no(tags->'construction:railway:etcs') AS construction_etcs @@ -186,8 +188,8 @@ Layer: construction_usage, construction_service, preserved_railway, preserved_service, preserved_usage, - pzb, lzb, zsi127, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, etcs, construction_etcs, - 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 + pzb, lzb, zsi127, atb, atb_eg, atb_ng, atb_vv, atc, kvb, tvm, scmt, asfa, ptc, ctcs, etcs, construction_etcs, + 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 FROM (SELECT way, railway, usage, service, @@ -210,6 +212,7 @@ Layer: tags->'railway:tvm' AS tvm, tags->'railway:scmt' AS scmt, tags->'railway:asfa' AS asfa, + railway_null_or_zero_to_no(tags->'railway:ctcs') AS ctcs, railway_null_or_zero_to_no(tags->'railway:ptc') AS ptc, railway_null_or_zero_to_no(tags->'railway:etcs') AS etcs, railway_null_or_zero_to_no(tags->'construction:railway:etcs') AS construction_etcs, diff --git a/sql/functions.sql b/sql/functions.sql index bc765015..0d635c22 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -322,6 +322,7 @@ CREATE OR REPLACE FUNCTION railway_train_protection_rank( asfa TEXT, ptc TEXT, zsi127 TEXT, + ctcs TEXT, etcs TEXT, construction_etcs TEXT) RETURNS INTEGER AS $$ BEGIN @@ -330,6 +331,9 @@ BEGIN END IF; IF ptc <> 'no' THEN RETURN 10; + END IF; + IF ctcs <> 'no' THEN + RETURN 10; END IF; IF construction_etcs <> 'no' THEN RETURN 9; @@ -361,7 +365,7 @@ BEGIN IF pzb = 'yes' THEN RETURN 2; END IF; - 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 + 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 RETURN 1; END IF; RETURN 0; diff --git a/train_protection.mss b/train_protection.mss index a86e5fd3..d9254120 100644 --- a/train_protection.mss +++ b/train_protection.mss @@ -14,6 +14,7 @@ @kvb_color: #66cc33; @tvm_color: #009966; @ptc_color: #cc0033; +@ctcs_color: orange; @etcs_color: blue; @etcs_construction_color: #87CEFA; @@ -101,6 +102,9 @@ ["ptc"!="no"] { line-color: @ptc_color; } + ["ctcs"!="no"] { + line-color: @ctcs_color; + } ["zsi127"="yes"] { line-color: @zsi127_color; }