Changeset 19467 in josm for trunk/resources/data/validator


Ignore:
Timestamp:
2026-01-16T11:11:30+01:00 (2 days ago)
Author:
stoecker
Message:

improve Power circuits relations presets and validation, fix #24456 - patch by francois.lacombe

Location:
trunk/resources/data/validator
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/resources/data/validator/combinations.mapcss

    r19440 r19467  
    307307node[power=transformer][voltage],
    308308node[transformer=distribution][voltage][power=pole],
     309relation[power=circuit][wires],
     310relation[power=line_section][wires],
    309311*[amenity=vending_machine][shop],
    310312*[noname?][name],
     
    11381140  assertNoMatch: "way highway=primary oneway=yes bicycle:lanes=no|designated|yes cycleway:lanes=|lane|no";
    11391141}
     1142
     1143/* Prevent redundancy between relation and members, see #24456, #24457 */
     1144relation[power=circuit] > way[power=line][frequency],
     1145relation[power=circuit] > way[power=minor_line][frequency],
     1146relation[power=circuit] > way[power=cable][frequency] {
     1147  throwWarning: tr("Frequency tag should be on the circuit relation only, not on the power segment");
     1148  group: tr("redundant tagging");
     1149}
     1150relation[power=circuit] > relation[power=line_section][frequency] { 
     1151  throwWarning: tr("Frequency tag should be on the circuit relation only, not on the power section");
     1152  group: tr("redundant tagging");
     1153}
     1154
     1155/* Invalid topology with power circuit relation, see #24456 */
     1156relation[power=circuit][topology][topology!~/^(linear|branched)$/] {
     1157       throwError: tr("power=circuit relations should have a topology tag with value linear or branched");
     1158       assertMatch: "relation type=power power=circuit topology=branch";
     1159       assertNoMatch: "relation type=power power=circuit topology=branched";
  • trunk/resources/data/validator/deprecated.mapcss

    r19222 r19467  
    25842584}
    25852585
     2586/* route=power is deprecated, see #24456 */
     2587relation[route=power] {
     2588  throwWarning: tr("{0} is deprecated", "{0.tag}");
     2589  group: tr("deprecated tagging");
     2590  suggestAlternative: "type=power + power=circuit";
     2591}
     2592relation[power=branch] {
     2593  throwWarning: tr("{0} is deprecated", "{0.tag}");
     2594  group: tr("deprecated tagging");
     2595  suggestAlternative: "type=power + power=line_section";
     2596}
     2597
    25862598/* When tags are deprecated they should be added to ignoretags.cfg too. */
  • trunk/resources/data/validator/geometry.mapcss

    r19342 r19467  
    9191node[interval],
    9292node[route],
    93 node[restriction] {
     93node[restriction],
     94node[power=circuit],
     95node[power=line_section] {
    9496  throwError: tr("{0} on a node. Should be used in a relation", "{0.tag}");
    9597}
     
    140142way[type=multipolygon],
    141143way[interval][route!=ferry],
    142 way[route=bus] {
     144way[route=bus],
     145way[power=circuit],
     146way[power=line_section] {
    143147  throwError: tr("{0} on a way. Should be used in a relation", "{0.tag}");
    144148}
    145149
    146150/* {0} on a closed way, should be a unclosed way; #19981 */
    147 way:closed[power=line] {
     151way:closed[power=line],
     152way:closed[power=cable],
     153way:closed[power=minor_line] {
    148154  throwWarning: tr("{0} on a closed way. Should be used on an unclosed way.", "{1.tag}");
    149155}
  • trunk/resources/data/validator/ignoretags.cfg

    r19245 r19467  
    826826; This seems to be a region specific tag.
    827827K:valley=balka
     828K:route=power
     829K:power=branch
    828830
    829831; These tags should probably have better software support, but maybe they can be in the appropriate section in this file.
  • trunk/resources/data/validator/relation.mapcss

    r18369 r19467  
    7272  group: tr("suspicious tag combination");
    7373}
     74
     75/* Power relations, #24456 */
     76relation[type=power][!power],
     77relation[type=power][power][power!~/^(circuit|line_section)$/] {
     78       throwError: tr("Power relation misses or combined to wrong power=* value");
     79       assertMatch: "relation type=power";
     80  assertMatch: "relation type=power power=line";
     81       assertNoMatch: "relation type=power power=circuit";
     82}
Note: See TracChangeset for help on using the changeset viewer.