Changeset 17957 in josm


Ignore:
Timestamp:
2021-07-07T23:04:44+02:00 (3 years ago)
Author:
Klumbumbus
Message:

fix #20902 - Warn about solo layer and level tags, remove relations from checks, warn about area on relations (patch by skyper)

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

Legend:

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

    r17954 r17957  
    345345}
    346346
    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] {
     347/* only {0.key}, #11104, #12422, #14950, #19572, #20902 */
     348/* relations excluded as there is a test for missing type=* plus several other test depending on the type exist */
     349node[access][eval(number_of_tags()) = 1],
     350way[access][eval(number_of_tags()) = 1],
     351node[area][eval(number_of_tags()) = 1]!.area_yes_autofix,
     352way[area][eval(number_of_tags()) = 1]!.area_yes_autofix,
     353node[lanes][eval(number_of_tags()) = 1],
     354way[lanes][eval(number_of_tags()) = 1],
     355node[layer][eval(number_of_tags()) = 1],
     356way[layer][eval(number_of_tags()) = 1],
     357way[level][eval(number_of_tags()) = 1], /* nodes might be valid, e.g. start and end nodes of steps */
     358node[lit][eval(number_of_tags()) = 1],
     359way[lit][eval(number_of_tags()) = 1],
     360node[name][eval(number_of_tags()) = 1],
     361way[name][eval(number_of_tags()) = 1],
     362node[ref][eval(number_of_tags()) = 1],
     363way[ref][eval(number_of_tags()) = 1],
     364node[surface][eval(number_of_tags()) = 1],
     365way[surface][eval(number_of_tags()) = 1] {
    355366  throwWarning: tr("incomplete object: only {0}", "{0.key}");
    356367  set only_one_tag;
     
    358369}
    359370/* only {0.key} and {1.key} */
    360 *[name][area][eval(number_of_tags()) = 2],
    361 *[name][ref][eval(number_of_tags()) = 2] {
     371node[name][area][eval(number_of_tags()) = 2],
     372way[name][area][eval(number_of_tags()) = 2],
     373node[name][ref][eval(number_of_tags()) = 2],
     374way[name][ref][eval(number_of_tags()) = 2] {
    362375  throwWarning: tr("incomplete object: only {0} and {1}", "{0.key}", "{1.key}");
    363376  group: tr("missing tag");
    364377}
    365378/* only {0.tag}, #15269 */
    366 *[tourism=attraction][eval(number_of_tags()) = 1] {
     379node[tourism=attraction][eval(number_of_tags()) = 1],
     380way[tourism=attraction][eval(number_of_tags()) = 1] {
    367381  throwWarning: tr("incomplete object: only {0}", "{0.tag}");
    368382  group: tr("missing tag");
    369383}
    370384/* only {0.key} and {1.tag} */
    371 *[name][tourism=attraction][eval(number_of_tags()) = 2] {
     385node[name][tourism=attraction][eval(number_of_tags()) = 2],
     386way[name][tourism=attraction][eval(number_of_tags()) = 2] {
    372387  throwWarning: tr("incomplete object: only {0} and {1}", "{0.key}", "{1.tag}");
    373388  group: tr("missing tag");
  • trunk/resources/data/validator/geometry.mapcss

    r17933 r17957  
    138138way:closed[power=line] {
    139139  throwWarning: tr("{0} on a closed way. Should be used on an unclosed way.", "{1.tag}");
     140}
     141
     142/* #20902 */
     143relation[area?] {
     144  throwWarning: tr("{0} on a relation", "{0.key}");
     145  fixRemove: "{0.key}";
    140146}
    141147
  • trunk/resources/data/validator/unnecessary.mapcss

    r17947 r17957  
    2020}
    2121
    22 area:closed[amenity ][area?][!highway],
    23 area:closed[building][area?],
    24 area:closed[landuse ][area?][!highway],
    25 area:closed[leisure ][area?][!highway][leisure!=track][leisure!=slipway],
    26 area:closed[natural ][area?],
    27 area:closed[shop    ][area?] {
     22way:closed[amenity ][area?][!highway],
     23way:closed[building][area?],
     24way:closed[landuse ][area?][!highway],
     25way:closed[leisure ][area?][!highway][leisure!=track][leisure!=slipway],
     26way:closed[natural ][area?],
     27way:closed[shop    ][area?] {
    2828  throwWarning: tr("{0} is unnecessary for {1}", "{2.tag}", "{1.key}");
    2929  group: tr("unnecessary tag");
Note: See TracChangeset for help on using the changeset viewer.