Ticket #16898: josm_16898_v3.patch

File josm_16898_v3.patch, 3.5 KB (added by skyper, 6 years ago)

validator patch including values in feet

  • src/org/openstreetmap/josm/resources/data/validator/combinations.mapcss

     
    123123  group: tr("missing tag");
    124124}
    125125
    126 /* {0.tag} without {1.key} (warning level), #18411, #18246 */
     126/* {0.tag} without {1.key} (warning level), #18411, #18246, #16898 */
    127127way[railway=construction][!construction],
    128128way[highway=construction][!construction],
    129129node[traffic_sign=maxspeed][!maxspeed],
     
    143143*[office=government][!government],
    144144*[power=generator][!generator:source],
    145145*[amenity=social_facility][!social_facility],
    146 *[amenity=place_of_worship][!religion] {
     146*[amenity=place_of_worship][!religion],
     147*[man_made=tower][!tower:type] {
    147148  throwWarning: tr("{0} without {1}", "{0.tag}", "{1.key}");
    148149  group: tr("missing tag");
    149150}
     
    694695  throwWarning: tr("{0} without {1} or {2}", "{0.key}", "maxspeed", "maxspeed:*");
    695696  group: tr("missing tag");
    696697}
     698 No newline at end of file
     699
     700/* tower vs. communications_tower, #16898 */
     701*[man_made=tower][tower:type=communication][material=concrete][height =~ /^([1-9][0-9][0-9][0-9]*(\.[0-9]*)?( m)?|([1-9][0-9][0-9][0-9]+|[4-9][0-9][0-9]|3([3-9][0-9]|2[89]))((\.[0-9]*)?( ft|\')|\'(11|10|[0-9])(\.[0-9]*)?\"))$/] { /* 100m ~ 328 ft ~ 328' TODO "'" */
     702  throwWarning: tr("{0} together with {1}, {2} and {3} equal or greater 100. Consider using man_made=communications_tower instead", "{0.tag}", "{1.tag}", "{2.tag}", "{3.key}");
     703  group: tr("suspicious tag combination");
     704  assertMatch: "node man_made=tower tower:type=communication material=concrete height=\"100 m\"";
     705  assertMatch: "node man_made=tower tower:type=communication material=concrete height=100.72";
     706  assertMatch: "way man_made=tower tower:type=communication material=concrete height=\"328.22 ft\"";
     707  assertMatch: "relation man_made=tower tower:type=communication material=concrete height=2358'8\"";
     708  assertNoMatch: "node man_made=tower tower:type=communication material=concrete height=\"99 m\"";
     709  assertNoMatch: "node man_made=tower tower:type=communication material=concrete height=0.8";
     710  assertNoMatch: "way man_made=tower tower:type=communication material=concrete height=\"324.22 ft\"";
     711  assertNoMatch: "relation man_made=tower material=concrete height=358'";
     712}
     713*[man_made=communications_tower][height =~ /^([1-9]?[0-9](\.[0-9]*)?( m)?|([12]?[0-9]?[0-9]|31[0-9]|32[0-7])((\.[0-9]*)?( ft|\')|\'(11|10|[0-9])(\.[0-9]*)?\"))$/] {
     714  throwWarning: tr("{0} and {1} below 100. Consider using man_made=tower with tower:type=communication instead", "{0.tag}", "{1.key}");
     715  group: tr("suspicious tag combination");
     716  assertMatch: "relation man_made=communications_tower height=58";
     717  assertMatch: "node man_made=communications_tower height=\"99 m\"";
     718  assertMatch: "node man_made=communications_tower height=0.8";
     719  assertMatch: "relation man_made=communications_tower height=326'";
     720  assertMatch: "way man_made=communications_tower height=\"224.22 ft\"";
     721  assertMatch: "way man_made=communications_tower height=317'10.22\"";
     722  assertNoMatch: "node man_made=communications_tower height=\"100 m\"";
     723  assertNoMatch: "node man_made=communications_tower height=100.72";
     724  assertNoMatch: "way man_made=communications_tower height=\"328.22 ft\"";
     725  assertNoMatch: "relation man_made=communications_tower height=4358'8\"";
     726  assertNoMatch: "relation height=4358'";