Ticket #20902: josm_combinations_only_tag_v3.patch

File josm_combinations_only_tag_v3.patch, 2.3 KB (added by skyper, 4 years ago)

version 3: additionally, exclude building, bridge and tunnel relations from "name" test

  • resources/data/validator/combinations.mapcss

     
    66  set unpaved_surface;
    77}
    88
     9node[eval(number_of_tags()) = 1],
     10way[eval(number_of_tags()) = 1],
     11relation[type][eval(number_of_tags()) = 2] {
     12  set one_tag;
     13}
     14
    915/* {0.key} without {1.key} (warning level) */
    1016way[junction                   ][!highway][junction!=yes][!area:highway],
    1117way[living_street              ][!highway],
     
    337343}
    338344
    339345/* #16214 */
    340 relation[type=multipolygon] >[role="inner"] way[area][eval(number_of_tags()) = 1] {
     346relation[type=multipolygon] >[role="inner"] way[area].one_tag {
    341347  throwWarning: tr("{0} on an inner multipolygon ring without further tags", "{0.tag}");
    342348  fixRemove: "area";
    343349  set area_yes_autofix;
    344350  group: tr("suspicious tag combination");
    345351}
    346352
    347 /* only {0.key}, #11104, #12422, #14950, #19572 */
    348 *[lanes][eval(number_of_tags()) = 1],
    349 *[surface][eval(number_of_tags()) = 1],
    350 *[access][eval(number_of_tags()) = 1],
    351 *[area][eval(number_of_tags()) = 1]!.area_yes_autofix,
    352 *[name][eval(number_of_tags()) = 1],
    353 *[ref][eval(number_of_tags()) = 1],
    354 *[lit][eval(number_of_tags()) = 1] {
     353/* only {0.key}, #11104, #12422, #14950, #19572, #20902 */
     354/* multipolygon has own test for most cases, see #20909 */
     355*[access].one_tag[type!=multipolygon],
     356*[area].one_tag!.area_yes_autofix[type!=multipolygon],
     357*[lanes].one_tag[type!=multipolygon],
     358*[layer].one_tag[type !~ /^(bridge|building|multipolygon|tunnel)$/], /* some relations are valid */
     359way[level].one_tag, /* nodes might be valid */
     360relation[level].one_tag[type!=multipolygon],
     361*[lit].one_tag[type!=multipolygon],
     362*[name].one_tag[type !~ /^(bridge|building|multipolygon|tunnel)$/], /* some relations are valid */
     363*[ref].one_tag[type!=multipolygon],
     364*[surface].one_tag {
    355365  throwWarning: tr("incomplete object: only {0}", "{0.key}");
    356366  set only_one_tag;
    357367  group: tr("missing tag");
     
    363373  group: tr("missing tag");
    364374}
    365375/* only {0.tag}, #15269 */
    366 *[tourism=attraction][eval(number_of_tags()) = 1] {
     376*[tourism=attraction].one_tag {
    367377  throwWarning: tr("incomplete object: only {0}", "{0.tag}");
    368378  group: tr("missing tag");
    369379}