Skip to content

Commit b4af8b7

Browse files
KlumbumbusKlumbumbus
authored andcommitted
see #21836 - Add some power/voltage validation rules:
- `voltage:primary/secondary/tertiary` without `transformer` - `voltage:primary/secondary/tertiary` on a way - `voltage:primary/secondary/tertiary` not in correct number format (should be in volts with no units/delimiter/spaces) - don't warn about unknown numeric values of `voltage:primary/secondary/tertiary` - `transformer` together with `voltage` on nodes - `voltage:secondary` is lower than `voltage:primary` on `transformer=generator` - deprecate `voltage-high` and `voltage-low` in favor of `voltage:primary/secondary` git-svn-id: https://josm.openstreetmap.de/svn/trunk@18535 0c6e7542-c601-0410-84e7-c038aed88b3b
1 parent 458c2ec commit b4af8b7

File tree

5 files changed

+32
-2
lines changed

5 files changed

+32
-2
lines changed

resources/data/validator/combinations.mapcss

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ way[surface=~/^(paved|asphalt|cobblestone|cobblestone:flattened|sett|concrete|co
1010
}
1111

1212
/* {0.key} without {1.key} (warning level) */
13+
node[voltage:primary ][!transformer],
14+
node[voltage:secondary ][!transformer],
15+
node[voltage:tertiary ][!transformer],
1316
way[junction ][!highway][junction!=yes][!area:highway],
1417
way[living_street ][!highway],
1518
way[maintenance ][!highway],
@@ -345,7 +348,8 @@ relation[type=multipolygon][area=no] {
345348
group: tr("suspicious tag combination");
346349
}
347350

348-
/* {0.key} together with {1.key}, #18267, #17630, #17604 */
351+
/* {0.key} together with {1.key}, #18267, #17630, #17604, #21836 */
352+
node[transformer][voltage],
349353
node[marker][cover],
350354
node[marker][voltage],
351355
node[marker][pressure],
@@ -1060,3 +1064,9 @@ relation[piste:type=nordic][!piste:grooming]{
10601064
assertMatch: "relation piste:type=nordic";
10611065
assertNoMatch: "relation piste:type=nordic piste:grooming=classic";
10621066
}
1067+
1068+
/* #21836 */
1069+
*[voltage:primary][voltage:secondary][transformer=generator][tag("voltage:secondary")<tag("voltage:primary")] {
1070+
throwWarning: tr("{0} is lower than {1} on {2}.", "{1.key}", "{0.key}", "{2.tag}");
1071+
group: tr("suspicious tag combination");
1072+
}

resources/data/validator/deprecated.mapcss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,4 +2381,13 @@ way[shoulder=none] {
23812381
group: tr("deprecated tagging");
23822382
}
23832383

2384+
/* #21836 */
2385+
*[voltage-high],
2386+
*[voltage-low] {
2387+
throwWarning: tr("{0} is deprecated", "{0.key}");
2388+
suggestAlternative: "voltage:primary";
2389+
suggestAlternative: "voltage:secondary";
2390+
group: tr("deprecated tagging");
2391+
}
2392+
23842393
/* When tags are deprecated they should be added to ignoretags.cfg too. */

resources/data/validator/geometry.mapcss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ node[restriction] {
9595
}
9696

9797
/* {0} on a way, should be a node */
98+
way[voltage:primary],
99+
way[voltage:secondary],
100+
way[voltage:tertiary],
98101
way[line_attachment],
99102
way[line_management],
100103
way[emergency=fire_hydrant],

resources/data/validator/ignoretags.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ E:traffic_sign
135135
E:building:levels
136136
E:distance
137137
E:voltage
138+
E:voltage:primary
139+
E:voltage:secondary
140+
E:voltage:tertiary
138141
E:amperage
139142
E:generator:output:electricity
140143
E:plant:output:electricity
@@ -726,6 +729,8 @@ E:pump:type
726729
K:substance=heat
727730
K:surface=decoturf
728731
K:school=entrance
732+
E:voltage-high
733+
E:voltage-low
729734
;
730735
; Tags not yet decided (to remove from this section when added or moved up when deprecated)
731736
; see josm tickets: 17770 15309 15774 16315 16658 16793 19982

resources/data/validator/numeric.mapcss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,10 @@ way[maxspeed:backward][maxspeed:backward !~ /^(signals|none|unposted|variable|wa
372372
assertNoMatch: "way distance=7 mi";
373373
}
374374

375-
way[voltage][voltage =~ /(.*[A-Za-z].*)|.*,.*|.*( ).*/] {
375+
way[voltage][voltage =~ /(.*[A-Za-z].*)|.*,.*|.*( ).*/],
376+
way[voltage:primary][voltage:primary =~ /(.*[A-Za-z].*)|.*,.*|.*( ).*/],
377+
way[voltage:secondary][voltage:secondary =~ /(.*[A-Za-z].*)|.*,.*|.*( ).*/],
378+
way[voltage:tertiary][voltage:tertiary =~ /(.*[A-Za-z].*)|.*,.*|.*( ).*/] {
376379
throwWarning: tr("voltage should be in volts with no units/delimiter/spaces");
377380
assertMatch: "way voltage=medium";
378381
assertNoMatch: "way voltage=15000";

0 commit comments

Comments
 (0)