| | 1 | Validator rules for tactile_indicator=*, see [https://wiki.openstreetmap.org/wiki/Key:tactile_indicator Key:tactile_indicator] |
| | 2 | |
| | 3 | {{{ |
| | 4 | #!rule |
| | 5 | meta { |
| | 6 | title: "Tactile indicator"; |
| | 7 | version: "1.[[revision]]_[[date]]"; |
| | 8 | description: "Checks tagging of tactile_indicator=*"; |
| | 9 | author: "maxbrc"; |
| | 10 | link: "https://wiki.openstreetmap.org/wiki/Key:tactile_indicator"; |
| | 11 | baselanguage: "en"; |
| | 12 | } |
| | 13 | |
| | 14 | /* "On its own" = not on a host feature (no highway, barrier, kerb, |
| | 15 | railway or public_transport tag, and not a |
| | 16 | type=public_transport relation). Multipolygon areas count as "on its own". */ |
| | 17 | |
| | 18 | /* ---------- Main value ---------- */ |
| | 19 | |
| | 20 | *[tactile_indicator][!highway][!barrier][!kerb][!railway][!public_transport][type!=public_transport][tactile_indicator!~/^(attention|locating|guide|boundary)$/] { |
| | 21 | throwWarning: tr("tactile_indicator on its own must be attention, locating, guide or boundary (one value, no semicolons)"); |
| | 22 | group: tr("Tactile indicator"); |
| | 23 | } |
| | 24 | |
| | 25 | *[tactile_indicator][has_tag_key("highway") || has_tag_key("barrier") || has_tag_key("kerb") || has_tag_key("railway") || has_tag_key("public_transport") || tag("type")=="public_transport"][tactile_indicator!~/^(yes|no|separate|(attention|locating|guide|boundary)(;(attention|locating|guide|boundary))*)$/] { |
| | 26 | throwWarning: tr("Unknown tactile_indicator value. Use yes, no, separate, or attention/locating/guide/boundary (several joined with ;)"); |
| | 27 | group: tr("Tactile indicator"); |
| | 28 | } |
| | 29 | |
| | 30 | /* ---------- Crossings ---------- */ |
| | 31 | |
| | 32 | node[highway=crossing][tactile_indicator=~/(^|;)guide(;|$)/], |
| | 33 | way[footway=crossing][tactile_indicator=~/(^|;)guide(;|$)/] { |
| | 34 | throwWarning: tr("A guide strip across a crossing is mapped as its own way"); |
| | 35 | group: tr("Tactile indicator"); |
| | 36 | } |
| | 37 | |
| | 38 | node[barrier=kerb] < way[footway=crossing][tactile_indicator][tactile_indicator!=separate], |
| | 39 | node[kerb][!highway] < way[footway=crossing][tactile_indicator][tactile_indicator!=separate] { |
| | 40 | throwWarning: tr("This crossing has kerb nodes. Tag tactile_indicator on the kerbs instead of the crossing"); |
| | 41 | group: tr("Tactile indicator"); |
| | 42 | } |
| | 43 | |
| | 44 | /* ---------- Geometry ---------- */ |
| | 45 | |
| | 46 | node[tactile_indicator=~/^(locating|guide|boundary)$/][!highway][!barrier][!kerb][!railway][!public_transport][type!=public_transport] { |
| | 47 | throwWarning: tr("Only attention fields are mapped as a point. Map guide, locating and boundary as a line along the middle of the strip"); |
| | 48 | group: tr("Tactile indicator"); |
| | 49 | } |
| | 50 | |
| | 51 | way[tactile_indicator][area!=yes][!highway][!barrier][!kerb][!railway][!public_transport] ⧉ way[highway=~/^(footway|cycleway|path)$/], |
| | 52 | way[tactile_indicator][area!=yes][!highway][!barrier][!kerb][!railway][!public_transport] ⧉ way[tactile_indicator][area!=yes][!highway][!barrier][!kerb][!railway][!public_transport] { |
| | 53 | throwWarning: tr("Tactile indicator crosses a footway, cycleway, path or another indicator without a shared node"); |
| | 54 | group: tr("Tactile indicator"); |
| | 55 | } |
| | 56 | |
| | 57 | /* ---------- Sides ---------- */ |
| | 58 | |
| | 59 | node[/^tactile_indicator:(left|right|both)$/] { |
| | 60 | throwWarning: tr("tactile_indicator:left/right/both only works on ways"); |
| | 61 | group: tr("Tactile indicator"); |
| | 62 | } |
| | 63 | |
| | 64 | way[/^tactile_indicator:(left|right|both)$/][!highway][!barrier][!kerb][!railway][!public_transport] { |
| | 65 | throwWarning: tr("tactile_indicator:left/right/both only works on the way the indicator belongs to, not on the indicator itself"); |
| | 66 | group: tr("Tactile indicator"); |
| | 67 | } |
| | 68 | |
| | 69 | way[tactile_indicator=separate][/^tactile_indicator:(left|right|both)$/] { |
| | 70 | throwWarning: tr("Sides are only used when no indicator is mapped separately"); |
| | 71 | group: tr("Tactile indicator"); |
| | 72 | } |
| | 73 | |
| | 74 | *[tactile_indicator:left][tactile_indicator:left!~/^(yes|no|(attention|locating|guide|boundary)(;(attention|locating|guide|boundary))*)$/], |
| | 75 | *[tactile_indicator:right][tactile_indicator:right!~/^(yes|no|(attention|locating|guide|boundary)(;(attention|locating|guide|boundary))*)$/], |
| | 76 | *[tactile_indicator:both][tactile_indicator:both!~/^(yes|no|(attention|locating|guide|boundary)(;(attention|locating|guide|boundary))*)$/] { |
| | 77 | throwWarning: tr("Unknown value for {0}. Use yes, no, or attention/locating/guide/boundary (several joined with ;)", "{0.key}"); |
| | 78 | group: tr("Tactile indicator"); |
| | 79 | } |
| | 80 | |
| | 81 | *[sidewalk:left:tactile_indicator][sidewalk:left:tactile_indicator!~/^(yes|no|separate|(attention|locating|guide|boundary)(;(attention|locating|guide|boundary))*)$/], |
| | 82 | *[sidewalk:right:tactile_indicator][sidewalk:right:tactile_indicator!~/^(yes|no|separate|(attention|locating|guide|boundary)(;(attention|locating|guide|boundary))*)$/], |
| | 83 | *[sidewalk:both:tactile_indicator][sidewalk:both:tactile_indicator!~/^(yes|no|separate|(attention|locating|guide|boundary)(;(attention|locating|guide|boundary))*)$/] { |
| | 84 | throwWarning: tr("Unknown value for {0}", "{0.key}"); |
| | 85 | group: tr("Tactile indicator"); |
| | 86 | } |
| | 87 | |
| | 88 | /* ---------- Pattern and other subkeys (plain and per side) ---------- */ |
| | 89 | |
| | 90 | *[tactile_indicator=~/^(attention|locating|guide|boundary)$/][!highway][!barrier][!kerb][!railway][!public_transport][type!=public_transport][!tactile_indicator:pattern] { |
| | 91 | throwWarning: tr("Add tactile_indicator:pattern (yes if it's proper but you don't know which)"); |
| | 92 | group: tr("Tactile indicator"); |
| | 93 | } |
| | 94 | |
| | 95 | *[tactile_indicator:pattern][tactile_indicator:pattern!~/^(domes|bars|other|yes|no)$/], |
| | 96 | *[tactile_indicator:left:pattern][tactile_indicator:left:pattern!~/^(domes|bars|other|yes|no)$/], |
| | 97 | *[tactile_indicator:right:pattern][tactile_indicator:right:pattern!~/^(domes|bars|other|yes|no)$/], |
| | 98 | *[tactile_indicator:both:pattern][tactile_indicator:both:pattern!~/^(domes|bars|other|yes|no)$/] { |
| | 99 | throwWarning: tr("Unknown value for {0}", "{0.key}"); |
| | 100 | group: tr("Tactile indicator"); |
| | 101 | } |
| | 102 | |
| | 103 | *[tactile_indicator:pattern:orientation][tactile_indicator:pattern!=bars], |
| | 104 | *[tactile_indicator:left:pattern:orientation][tactile_indicator:left:pattern!=bars], |
| | 105 | *[tactile_indicator:right:pattern:orientation][tactile_indicator:right:pattern!=bars], |
| | 106 | *[tactile_indicator:both:pattern:orientation][tactile_indicator:both:pattern!=bars] { |
| | 107 | throwWarning: tr("{0} only applies to bars", "{0.key}"); |
| | 108 | group: tr("Tactile indicator"); |
| | 109 | } |
| | 110 | |
| | 111 | *[tactile_indicator:pattern:orientation][tactile_indicator:pattern:orientation!~/^(parallel|perpendicular|[0-9]|[1-9][0-9]|1[0-7][0-9])$/], |
| | 112 | *[tactile_indicator:left:pattern:orientation][tactile_indicator:left:pattern:orientation!~/^(parallel|perpendicular|[0-9]|[1-9][0-9]|1[0-7][0-9])$/], |
| | 113 | *[tactile_indicator:right:pattern:orientation][tactile_indicator:right:pattern:orientation!~/^(parallel|perpendicular|[0-9]|[1-9][0-9]|1[0-7][0-9])$/], |
| | 114 | *[tactile_indicator:both:pattern:orientation][tactile_indicator:both:pattern:orientation!~/^(parallel|perpendicular|[0-9]|[1-9][0-9]|1[0-7][0-9])$/] { |
| | 115 | throwWarning: tr("{0} must be parallel, perpendicular or an angle from 0 to 179", "{0.key}"); |
| | 116 | group: tr("Tactile indicator"); |
| | 117 | } |
| | 118 | |
| | 119 | *[tactile_indicator:pattern:design][!tactile_indicator:pattern], |
| | 120 | *[tactile_indicator:left:pattern:design][!tactile_indicator:left:pattern], |
| | 121 | *[tactile_indicator:right:pattern:design][!tactile_indicator:right:pattern], |
| | 122 | *[tactile_indicator:both:pattern:design][!tactile_indicator:both:pattern] { |
| | 123 | throwWarning: tr("{0} needs pattern too", "{0.key}"); |
| | 124 | group: tr("Tactile indicator"); |
| | 125 | } |
| | 126 | |
| | 127 | *[tactile_indicator:pattern:design][tactile_indicator:pattern:design!~/^[A-Z]{2}:[a-z_]+$/], |
| | 128 | *[tactile_indicator:left:pattern:design][tactile_indicator:left:pattern:design!~/^[A-Z]{2}:[a-z_]+$/], |
| | 129 | *[tactile_indicator:right:pattern:design][tactile_indicator:right:pattern:design!~/^[A-Z]{2}:[a-z_]+$/], |
| | 130 | *[tactile_indicator:both:pattern:design][tactile_indicator:both:pattern:design!~/^[A-Z]{2}:[a-z_]+$/] { |
| | 131 | throwWarning: tr("{0} must be a country code and a lowercase name, like GB:corduroy", "{0.key}"); |
| | 132 | group: tr("Tactile indicator"); |
| | 133 | } |
| | 134 | |
| | 135 | *[tactile_indicator:contrast][tactile_indicator:contrast!~/^(yes|no)$/], |
| | 136 | *[tactile_indicator:left:contrast][tactile_indicator:left:contrast!~/^(yes|no)$/], |
| | 137 | *[tactile_indicator:right:contrast][tactile_indicator:right:contrast!~/^(yes|no)$/], |
| | 138 | *[tactile_indicator:both:contrast][tactile_indicator:both:contrast!~/^(yes|no)$/], |
| | 139 | *[tactile_indicator:condition][tactile_indicator:condition!~/^(intact|worn|unusable)$/], |
| | 140 | *[tactile_indicator:left:condition][tactile_indicator:left:condition!~/^(intact|worn|unusable)$/], |
| | 141 | *[tactile_indicator:right:condition][tactile_indicator:right:condition!~/^(intact|worn|unusable)$/], |
| | 142 | *[tactile_indicator:both:condition][tactile_indicator:both:condition!~/^(intact|worn|unusable)$/], |
| | 143 | *[tactile_indicator:misplaced][tactile_indicator:misplaced!~/^(yes|no)$/], |
| | 144 | *[tactile_indicator:left:misplaced][tactile_indicator:left:misplaced!~/^(yes|no)$/], |
| | 145 | *[tactile_indicator:right:misplaced][tactile_indicator:right:misplaced!~/^(yes|no)$/], |
| | 146 | *[tactile_indicator:both:misplaced][tactile_indicator:both:misplaced!~/^(yes|no)$/] { |
| | 147 | throwWarning: tr("Unknown value for {0}", "{0.key}"); |
| | 148 | group: tr("Tactile indicator"); |
| | 149 | } |
| | 150 | |
| | 151 | *[tactile_indicator:pattern=other][!tactile_indicator:pattern:design], |
| | 152 | *[tactile_indicator:left:pattern=other][!tactile_indicator:left:pattern:design], |
| | 153 | *[tactile_indicator:right:pattern=other][!tactile_indicator:right:pattern:design], |
| | 154 | *[tactile_indicator:both:pattern=other][!tactile_indicator:both:pattern:design] { |
| | 155 | throwOther: tr("Consider adding pattern:design to say which pattern it is"); |
| | 156 | group: tr("Tactile indicator"); |
| | 157 | } |
| | 158 | }}} |