Ticket #20902: josm_combinations_only_tag_v4.patch

File josm_combinations_only_tag_v4.patch, 3.0 KB (added by skyper, 5 years ago)

version 4: tested with all relation types in defaultpreset

  • 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/* boundary, connectivity, enforcement, restriction, route and waterway have own test for needed subkeys */
     356*[access].one_tag[type !~ /^(boundary|connectivity|enforcement|multipolygon|restriction|route|waterway)$/],
     357*[area].one_tag!.area_yes_autofix[type !~ /^(boundary|connectivity|enforcement|multipolygon|restriction|route|waterway)$/],
     358*[lanes].one_tag[type !~ /^(boundary|connectivity|enforcement|multipolygon|restriction|route|waterway)$/],
     359*[layer].one_tag[type !~ /^(boundary|bridge|building|connectivity|enforcement|multipolygon|restriction|route|tunnel|waterway)$/], /* some relations are valid */
     360way[level].one_tag, /* nodes might be valid */
     361relation[level].one_tag[type !~ /^(boundary|connectivity|enforcement|multipolygon|restriction|route|waterway)$/],
     362*[lit].one_tag[type !~ /^(boundary|connectivity|enforcement|multipolygon|restriction|route|waterway)$/],
     363*[name].one_tag[type !~ /^(associatedStreet|boundary|bridge|building|connectivity|enforcement|multipolygon|restriction|route|site|street|tunnel|waterway)$/], /* most relations are valid */
     364*[ref].one_tag[type !~ /^(boundary|connectivity|enforcement|multipolygon|restriction|route|waterway)$/],
     365*[surface].one_tag[type !~ /^(boundary|connectivity|enforcement|restriction|route|waterway)$/] {
    355366  throwWarning: tr("incomplete object: only {0}", "{0.key}");
    356367  set only_one_tag;
    357368  group: tr("missing tag");
     
    363374  group: tr("missing tag");
    364375}
    365376/* only {0.tag}, #15269 */
    366 *[tourism=attraction][eval(number_of_tags()) = 1] {
     377*[tourism=attraction].one_tag {
    367378  throwWarning: tr("incomplete object: only {0}", "{0.tag}");
    368379  group: tr("missing tag");
    369380}