Ticket #21286: josm_21286_v3.patch

File josm_21286_v3.patch, 1.6 KB (added by skyper, 2 years ago)

patch version 3: use complete strings instead of substrings in regex plus only compare values without unit plus " m" or " ft"

  • resources/data/validator/combinations.mapcss

     
    4747way[length_unit                ][!waterway],
    4848way[canal                      ][!waterway],
    4949way[have_riverbank             ][!waterway],
     50area[min_height                ][!height][/^(building|building:part)$/], /* #21286 */
     51area[building:min_level        ][!building:levels][/^(building|building:part)$/], /* #21286 */
    5052*[border_type                  ][!boundary],
    5153*[piste:difficulty             ][!piste:type],
    5254*[place                        ][!name][place!=islet][place!=plot][noname!=yes],
     
    10761078  throwWarning: tr("{0} is lower than {1} on {2}.", "{1.key}", "{0.key}", "{2.tag}");
    10771079  group: tr("suspicious tag combination");
    10781080}
     1081 No newline at end of file
     1082
     1083/* #21286 */
     1084area[/^(building|building:part)$/][height =~ /^[0-9]+(\.[0-9]+)?( m)?$/][min_height =~ /^[0-9]+(\.[0-9]+)?( m)?$/][get(split(" ", tag(height)), 0) <= get(split(" ", tag(min_height)), 0)],
     1085area[/^(building|building:part)$/][height =~ /^[0-9]+(\.[0-9]+)?( ft)$/][min_height =~ /^[0-9]+(\.[0-9]+)?( ft)$/][get(split(" ", tag(height)), 0) <= get(split(" ", tag(min_height)), 0)],
     1086area[/^(building|building:part)$/][building:levels][building:min_level][tag("building:levels") <= tag("building:min_level")] {
     1087  throwWarning: tr("{0} is lower or equal to {1} on {2}", "{1.key}", "{2.key}", "{0.key}");
     1088  group: tr("suspicious tag combination");
     1089}