[13345] | 1 | /* measurement values and units warnings (tickets #8687, #15719) */
|
---|
[7937] | 2 |
|
---|
| 3 | *[/^[0-9]+$/] {
|
---|
| 4 | throwWarning: tr("numerical key");
|
---|
| 5 | assertMatch: "way 123=foo";
|
---|
| 6 | assertNoMatch: "way ref.1=foo";
|
---|
| 7 | }
|
---|
| 8 |
|
---|
[13005] | 9 | *[layer =~ /^\+\d/] {
|
---|
[13027] | 10 | throwWarning: tr("{0} value with + sign", "{0.key}");
|
---|
[7937] | 11 | fixAdd: concat("layer=", replace(tag("layer"), "+", ""));
|
---|
| 12 | assertMatch: "node layer=+1";
|
---|
| 13 | assertNoMatch: "node layer=1";
|
---|
| 14 | assertNoMatch: "node layer=-1";
|
---|
[13005] | 15 | assertNoMatch: "node layer=+foo";
|
---|
[7937] | 16 | }
|
---|
| 17 |
|
---|
| 18 | *[layer][layer !~ /^0$|^(-|\+)?[1-5]$/] {
|
---|
[13027] | 19 | throwWarning: tr("{0} should be an integer value between -5 and 5", "{0.key}");
|
---|
[7937] | 20 | assertMatch: "node layer=-50";
|
---|
| 21 | assertMatch: "node layer=6";
|
---|
[13027] | 22 | assertMatch: "node layer=+10";
|
---|
| 23 | assertMatch: "node layer=0.5";
|
---|
| 24 | assertMatch: "node layer=0;1";
|
---|
[7937] | 25 | assertNoMatch: "node layer=-5";
|
---|
| 26 | assertNoMatch: "node layer=0";
|
---|
| 27 | assertNoMatch: "node layer=2";
|
---|
[11640] | 28 | assertNoMatch: "node layer=+5"; /* this is an invalid value, but this case is already covered by the previous rule */
|
---|
[7937] | 29 | }
|
---|
| 30 |
|
---|
[17934] | 31 | /* negative values, #21026 */
|
---|
| 32 | *[building:levels^="-"] {
|
---|
| 33 | throwError: tr("negative {0} value", "{0.key}");
|
---|
| 34 | set negative_value;
|
---|
| 35 | assertMatch: "node building:levels=-1";
|
---|
| 36 | assertNoMatch: "node building:levels=+1";
|
---|
| 37 | assertNoMatch: "node building:levels=1";
|
---|
| 38 | assertNoMatch: "node building:levels=foo";
|
---|
| 39 | assertMatch: "node building:levels=-foo";
|
---|
| 40 | assertNoMatch: "node level=-1";
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | *[building:levels][building:levels !~ /^(([0-9]|[1-9][0-9]*)(\.5)?)$/]!.negative_value,
|
---|
[14273] | 44 | *[level][level !~ /^((((-*[1-9]|[0-9])|-*[1-9][0-9]*)(\.5)?)|-0\.5)(;((((-*[1-9]|[0-9])|-*[1-9][0-9]*)(\.5)?)|-0\.5))*$/] { /* all numbers from -∞ to ∞ in 0.5 steps, optional multiple values separated by a ; */
|
---|
[9737] | 45 | throwWarning: tr("{0} should have numbers only with optional .5 increments", "{0.key}");
|
---|
[7937] | 46 | assertMatch: "node level=one";
|
---|
[11640] | 47 | assertMatch: "node level=01";
|
---|
| 48 | assertMatch: "node level=-03";
|
---|
| 49 | assertMatch: "node level=-01.5";
|
---|
| 50 | assertMatch: "node level=2.3";
|
---|
| 51 | assertMatch: "node level=-0";
|
---|
[7937] | 52 | assertNoMatch: "node level=0";
|
---|
| 53 | assertNoMatch: "node level=1";
|
---|
| 54 | assertNoMatch: "node level=-1";
|
---|
| 55 | assertNoMatch: "node level=-0.5";
|
---|
| 56 | assertNoMatch: "node level=1.5";
|
---|
[11640] | 57 | assertNoMatch: "node level=12";
|
---|
| 58 | assertNoMatch: "node level=0;1";
|
---|
| 59 | assertNoMatch: "node level=1;1.5";
|
---|
| 60 | assertNoMatch: "node level=1;0.5";
|
---|
| 61 | assertNoMatch: "node level=0;-0.5";
|
---|
| 62 | assertNoMatch: "node level=-0.5;0";
|
---|
| 63 | assertNoMatch: "node level=-1;-0.5";
|
---|
[9737] | 64 | assertNoMatch: "node building:levels=1.5";
|
---|
[17939] | 65 | assertNoMatch: "node building:levels=-1"; /* tested already by rule above "negative values" and excluded here via !.negative_value in selector */
|
---|
| 66 | assertMatch: "node building:levels=1A";
|
---|
[11640] | 67 | assertNoMatch: "node building:levels=0"; /* valid because there can be building:levels:underground > 0 or roof:levels > 0 */
|
---|
[7937] | 68 | }
|
---|
| 69 |
|
---|
[17268] | 70 | *[height][height =~ /^[0-9]+(\.[0-9]+)?(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/] {
|
---|
[16685] | 71 | throwWarning: tr("unusual value of {0}: use abbreviation for unit and space between value and unit", "{0.key}");
|
---|
| 72 | set height_meter_autofix;
|
---|
| 73 | fixAdd: concat("height=", get(regexp_match("([0-9.]+)( )*(.+)",tag("height")),1)," m");
|
---|
| 74 | assertMatch: "node height=6.78 meters";
|
---|
| 75 | assertMatch: "node height=5 metre";
|
---|
| 76 | assertMatch: "node height=2m";
|
---|
| 77 | assertNoMatch: "node height=2 m";
|
---|
| 78 | assertNoMatch: "node height=5";
|
---|
| 79 | }
|
---|
[17268] | 80 | *[height][height =~ /^[0-9]+(\.[0-9]+)?(( )*(foot|Foot|feet|Feet)|ft)$/] {
|
---|
[16685] | 81 | throwWarning: tr("unusual value of {0}: use abbreviation for unit and space between value and unit", "{0.key}");
|
---|
| 82 | set height_foot_autofix;
|
---|
| 83 | fixAdd: concat("height=", get(regexp_match("([0-9.]+)( )*(.+)",tag("height")),1)," ft");
|
---|
| 84 | assertMatch: "node height=6.78 foot";
|
---|
| 85 | assertMatch: "node height=5 Feet";
|
---|
| 86 | assertMatch: "node height=2ft";
|
---|
| 87 | assertNoMatch: "node height=2 ft";
|
---|
| 88 | assertNoMatch: "node height=5";
|
---|
| 89 | }
|
---|
[13357] | 90 | *[height][height =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] {
|
---|
[13345] | 91 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
| 92 | fixAdd: concat("height=", replace(tag("height"), ",", "."));
|
---|
| 93 | set height_separator_autofix;
|
---|
| 94 | assertMatch: "node height=5,5";
|
---|
| 95 | assertMatch: "node height=12,00";
|
---|
| 96 | assertMatch: "node height=12,5 ft";
|
---|
[13357] | 97 | assertNoMatch: "node height=12,000";
|
---|
[13345] | 98 | assertNoMatch: "node height=3,50,5";
|
---|
| 99 | assertNoMatch: "node height=3.5";
|
---|
| 100 | assertNoMatch: "node height=4";
|
---|
| 101 | }
|
---|
[16685] | 102 |
|
---|
[17268] | 103 | *[maxheight][maxheight =~ /^[1-9][0-9]*(\.[0-9]+)?(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/] {
|
---|
[16685] | 104 | throwWarning: tr("unusual value of {0}: use abbreviation for unit and space between value and unit", "{0.key}");
|
---|
| 105 | set maxheight_meter_autofix;
|
---|
| 106 | fixAdd: concat("maxheight=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxheight")),1)," m");
|
---|
| 107 | assertMatch: "node maxheight=6.78 meters";
|
---|
| 108 | assertMatch: "node maxheight=5 metre";
|
---|
| 109 | assertMatch: "node maxheight=2m";
|
---|
| 110 | assertNoMatch: "node maxheight=2 m";
|
---|
| 111 | assertNoMatch: "node maxheight=5";
|
---|
[7937] | 112 | }
|
---|
[17268] | 113 | *[maxheight][maxheight =~ /^[0-9]+(\.[0-9]+)?(( )*(foot|Foot|feet|Feet)|ft)$/] {
|
---|
[16685] | 114 | throwWarning: tr("unusual value of {0}: use abbreviation for unit and space between value and unit", "{0.key}");
|
---|
| 115 | set maxheight_foot_autofix;
|
---|
| 116 | fixAdd: concat("maxheight=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxheight")),1)," ft");
|
---|
| 117 | assertMatch: "node maxheight=6.78 foot";
|
---|
| 118 | assertMatch: "node maxheight=5 Feet";
|
---|
| 119 | assertMatch: "node maxheight=2ft";
|
---|
| 120 | assertNoMatch: "node maxheight=2 ft";
|
---|
| 121 | assertNoMatch: "node maxheight=5";
|
---|
| 122 | }
|
---|
[13357] | 123 | *[maxheight][maxheight =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] {
|
---|
[13345] | 124 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
| 125 | fixAdd: concat("maxheight=", replace(tag("maxheight"), ",", "."));
|
---|
| 126 | set maxheight_separator_autofix;
|
---|
| 127 | assertMatch: "node maxheight=5,5";
|
---|
| 128 | assertMatch: "node maxheight=12,00";
|
---|
| 129 | assertMatch: "node maxheight=12,5 ft";
|
---|
[13357] | 130 | assertNoMatch: "node maxheight=12,000";
|
---|
[13345] | 131 | assertNoMatch: "node maxheight=3,50,5";
|
---|
| 132 | assertNoMatch: "node maxheight=3.5";
|
---|
| 133 | assertNoMatch: "node maxheight=4";
|
---|
| 134 | }
|
---|
[16685] | 135 |
|
---|
[17953] | 136 | *[roof:height][roof:height =~ /^0*(\.0*)?( (m|ft))?$/][roof:shape=flat] {
|
---|
| 137 | throwWarning: tr("{0} is unnecessary for {1}", "{0.tag}", "{2.tag}");
|
---|
| 138 | group: tr("unnecessary tag");
|
---|
| 139 | fixRemove: "{0.key}";
|
---|
| 140 | set zero_roof_height_flat;
|
---|
| 141 | assertMatch: "node roof:height=0 roof:shape=flat";
|
---|
| 142 | assertMatch: "node roof:shape=flat roof:height=\"00.00000 ft\" roof:shape=flat";
|
---|
| 143 | assertNoMatch: "node roof:shape=flat roof:height=2 m roof:shape=flat";
|
---|
| 144 | assertNoMatch: "node roof:height=0 roof:shape=gabled";
|
---|
| 145 | }
|
---|
| 146 | *[roof:height][roof:height =~ /^[0-9]+(\.[0-9]+)?(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/]!.zero_roof_height_flat {
|
---|
| 147 | throwWarning: tr("unusual value of {0}: use abbreviation for unit and space between value and unit", "{0.key}");
|
---|
| 148 | set roof_height_meter_autofix;
|
---|
| 149 | fixAdd: concat("roof:height=", get(regexp_match("([0-9.]+)( )*(.+)",tag("roof:height")),1)," m");
|
---|
| 150 | assertMatch: "node roof:height=6.78 meters";
|
---|
| 151 | assertMatch: "node roof:height=5 metre";
|
---|
| 152 | assertMatch: "node roof:height=2m";
|
---|
| 153 | assertNoMatch: "node roof:height=2 m";
|
---|
| 154 | assertNoMatch: "node roof:height=5";
|
---|
| 155 | }
|
---|
| 156 | *[roof:height][roof:height =~ /^[0-9]+(\.[0-9]+)?(( )*(foot|Foot|feet|Feet)|ft)$/]!.zero_roof_height_flat {
|
---|
| 157 | throwWarning: tr("unusual value of {0}: use abbreviation for unit and space between value and unit", "{0.key}");
|
---|
| 158 | set roof_height_foot_autofix;
|
---|
| 159 | fixAdd: concat("roof:height=", get(regexp_match("([0-9.]+)( )*(.+)",tag("roof:height")),1)," ft");
|
---|
| 160 | assertMatch: "node roof:height=6.78 foot";
|
---|
| 161 | assertMatch: "node roof:height=5 Feet";
|
---|
| 162 | assertMatch: "node roof:height=2ft";
|
---|
| 163 | assertNoMatch: "node roof:height=2 ft";
|
---|
| 164 | assertNoMatch: "node roof:height=5";
|
---|
| 165 | }
|
---|
| 166 | *[roof:height][roof:height =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] {
|
---|
| 167 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
| 168 | fixAdd: concat("roof:height=", replace(tag("roof:height"), ",", "."));
|
---|
| 169 | set roof_height_separator_autofix;
|
---|
| 170 | assertMatch: "node roof:height=5,5";
|
---|
| 171 | assertMatch: "node roof:height=12,00";
|
---|
| 172 | assertMatch: "node roof:height=12,5 ft";
|
---|
| 173 | assertNoMatch: "node roof:height=12,000";
|
---|
| 174 | assertNoMatch: "node roof:height=3,50,5";
|
---|
| 175 | assertNoMatch: "node roof:height=3.5";
|
---|
| 176 | assertNoMatch: "node roof:height=4";
|
---|
| 177 | }
|
---|
| 178 |
|
---|
[17268] | 179 | *[maxlength][maxlength =~ /^[1-9][0-9]*(\.[0-9]+)?(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/] {
|
---|
[16685] | 180 | throwWarning: tr("unusual value of {0}: use abbreviation for unit and space between value and unit", "{0.key}");
|
---|
| 181 | set maxlength_meter_autofix;
|
---|
| 182 | fixAdd: concat("maxlength=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxlength")),1)," m");
|
---|
| 183 | assertMatch: "node maxlength=6.78 meters";
|
---|
| 184 | assertMatch: "node maxlength=5 metre";
|
---|
| 185 | assertMatch: "node maxlength=2m";
|
---|
| 186 | assertNoMatch: "node maxlength=2 m";
|
---|
| 187 | assertNoMatch: "node maxlength=5";
|
---|
[7937] | 188 | }
|
---|
[17268] | 189 | *[maxlength][maxlength =~ /^[0-9]+(\.[0-9]+)?(( )*(foot|Foot|feet|Feet)|ft)$/] {
|
---|
[16685] | 190 | throwWarning: tr("unusual value of {0}: use abbreviation for unit and space between value and unit", "{0.key}");
|
---|
| 191 | set maxlength_foot_autofix;
|
---|
| 192 | fixAdd: concat("maxlength=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxlength")),1)," ft");
|
---|
| 193 | assertMatch: "node maxlength=6.78 foot";
|
---|
| 194 | assertMatch: "node maxlength=5 Feet";
|
---|
| 195 | assertMatch: "node maxlength=2ft";
|
---|
| 196 | assertNoMatch: "node maxlength=2 ft";
|
---|
| 197 | assertNoMatch: "node maxlength=5";
|
---|
| 198 | }
|
---|
| 199 | *[maxlength][maxlength =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] {
|
---|
| 200 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
| 201 | fixAdd: concat("maxlength=", replace(tag("maxlength"), ",", "."));
|
---|
| 202 | set maxlength_separator_autofix;
|
---|
| 203 | assertMatch: "node maxlength=5,5";
|
---|
| 204 | assertMatch: "node maxlength=12,00";
|
---|
| 205 | assertMatch: "node maxlength=12,5 ft";
|
---|
| 206 | assertNoMatch: "node maxlength=12,000";
|
---|
| 207 | assertNoMatch: "node maxlength=3,50,5";
|
---|
| 208 | assertNoMatch: "node maxlength=3.5";
|
---|
| 209 | assertNoMatch: "node maxlength=4";
|
---|
| 210 | }
|
---|
[7937] | 211 |
|
---|
[17268] | 212 | *[width][width =~ /^[0-9]+(\.[0-9]+)?(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/] {
|
---|
[16685] | 213 | throwWarning: tr("unusual value of {0}: use abbreviation for unit and space between value and unit", "{0.key}");
|
---|
| 214 | set width_meter_autofix;
|
---|
| 215 | fixAdd: concat("width=", get(regexp_match("([0-9.]+)( )*(.+)",tag("width")),1)," m");
|
---|
| 216 | assertMatch: "node width=6.78 meters";
|
---|
| 217 | assertMatch: "node width=5 metre";
|
---|
| 218 | assertMatch: "node width=2m";
|
---|
| 219 | assertNoMatch: "node width=2 m";
|
---|
| 220 | assertNoMatch: "node width=5";
|
---|
| 221 | }
|
---|
[17268] | 222 | *[width][width =~ /^[0-9]+(\.[0-9]+)?(( )*(foot|Foot|feet|Feet)|ft)$/] {
|
---|
[16685] | 223 | throwWarning: tr("unusual value of {0}: use abbreviation for unit and space between value and unit", "{0.key}");
|
---|
| 224 | set width_foot_autofix;
|
---|
| 225 | fixAdd: concat("width=", get(regexp_match("([0-9.]+)( )*(.+)",tag("width")),1)," ft");
|
---|
| 226 | assertMatch: "node width=6.78 foot";
|
---|
| 227 | assertMatch: "node width=5 Feet";
|
---|
| 228 | assertMatch: "node width=2ft";
|
---|
| 229 | assertNoMatch: "node width=2 ft";
|
---|
| 230 | assertNoMatch: "node width=5";
|
---|
| 231 | }
|
---|
[13357] | 232 | *[width][width =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] {
|
---|
[13345] | 233 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
| 234 | fixAdd: concat("width=", replace(tag("width"), ",", "."));
|
---|
| 235 | set width_separator_autofix;
|
---|
| 236 | assertMatch: "node width=5,5";
|
---|
| 237 | assertMatch: "node width=12,00";
|
---|
[13357] | 238 | assertNoMatch: "node width=12,000";
|
---|
[13345] | 239 | assertNoMatch: "node width=3,50,5";
|
---|
| 240 | assertNoMatch: "node width=3.5";
|
---|
| 241 | assertNoMatch: "node width=4";
|
---|
| 242 | }
|
---|
[16685] | 243 |
|
---|
[17268] | 244 | *[maxwidth][maxwidth=~ /^[0-9]+(\.[0-9]+)?(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/] {
|
---|
[16685] | 245 | throwWarning: tr("unusual value of {0}: use abbreviation for unit and space between value and unit", "{0.key}");
|
---|
| 246 | set maxwidth_meter_autofix;
|
---|
| 247 | fixAdd: concat("maxwidth=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxwidth")),1)," m");
|
---|
| 248 | assertMatch: "node maxwidth=6.78 meters";
|
---|
| 249 | assertMatch: "node maxwidth=5 metre";
|
---|
| 250 | assertMatch: "node maxwidth=2m";
|
---|
| 251 | assertNoMatch: "node maxwidth=2 m";
|
---|
| 252 | assertNoMatch: "node maxwidth=5";
|
---|
[7937] | 253 | }
|
---|
[17268] | 254 | *[maxwidth][maxwidth =~ /^[0-9]+(\.[0-9]+)?(( )*(foot|Foot|feet|Feet)|ft)$/] {
|
---|
[16685] | 255 | throwWarning: tr("unusual value of {0}: use abbreviation for unit and space between value and unit", "{0.key}");
|
---|
| 256 | set maxwidth_foot_autofix;
|
---|
| 257 | fixAdd: concat("maxwidth=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxwidth")),1)," ft");
|
---|
| 258 | assertMatch: "node maxwidth=6.78 foot";
|
---|
| 259 | assertMatch: "node maxwidth=5 Feet";
|
---|
| 260 | assertMatch: "node maxwidth=2ft";
|
---|
| 261 | assertNoMatch: "node maxwidth=2 ft";
|
---|
| 262 | assertNoMatch: "node maxwidth=5";
|
---|
| 263 | }
|
---|
[13357] | 264 | *[maxwidth][maxwidth =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] {
|
---|
[13345] | 265 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
| 266 | fixAdd: concat("maxwidth=", replace(tag("maxwidth"), ",", "."));
|
---|
| 267 | set maxwidth_separator_autofix;
|
---|
| 268 | assertMatch: "node maxwidth=5,5";
|
---|
| 269 | assertMatch: "node maxwidth=12,00";
|
---|
[13357] | 270 | assertNoMatch: "node maxwidth=12,000";
|
---|
[13345] | 271 | assertNoMatch: "node maxwidth=3,50,5";
|
---|
| 272 | assertNoMatch: "node maxwidth=3.5";
|
---|
| 273 | assertNoMatch: "node maxwidth=4";
|
---|
| 274 | }
|
---|
[16685] | 275 |
|
---|
[17953] | 276 | *[height ][height !~ /^(([0-9]+(\.[0-9]+)?( (m|ft))?)|([1-9][0-9]*\'((10|11|[0-9])((\.[0-9]+)?)\")?))$/]!.height_separator_autofix!.height_meter_autofix!.height_foot_autofix,
|
---|
| 277 | *[maxheight ][maxheight !~ /^(([1-9][0-9]*(\.[0-9]+)?( (m|ft))?)|([0-9]+\'(([0-9]|10|11)(\.[0-9]*)?\")?)|none|default|below_default)$/]!.maxheight_separator_autofix!.maxheight_meter_autofix!.maxheight_foot_autofix,
|
---|
| 278 | *[roof:height][roof:height !~ /^(([0-9]+(\.[0-9]+)?( (m|ft))?)|([1-9][0-9]*\'((10|11|[0-9])((\.[0-9]+)?)\")?))$/]!.roof_height_separator_autofix!.roof_height_meter_autofix!.roof_height_foot_autofix!.zero_roof_height_flat,
|
---|
| 279 | *[maxlength ][maxlength !~ /^(([1-9][0-9]*(\.[0-9]+)?( (m|ft))?)|([0-9]+\'(([0-9]|10|11)(\.[0-9]*)?\")?)|none|default|below_default)$/]!.maxlength_separator_autofix!.maxlength_meter_autofix!.maxlength_foot_autofix,
|
---|
| 280 | *[width ][width !~ /^(([0-9]+(\.[0-9]+)?( (m|ft))?)|([0-9]+\'([0-9]+(\.[0-9]+)?\")?))$/]!.width_separator_autofix!.width_meter_autofix!.width_foot_autofix,
|
---|
| 281 | *[maxwidth ][maxwidth !~ /^(([0-9]+(\.[0-9]+)?( (m|ft))?)|([0-9]+\'([0-9]+(\.[0-9]+)?\")?))$/]!.maxwidth_separator_autofix!.maxwidth_meter_autofix!.maxwidth_foot_autofix {
|
---|
[17955] | 282 | throwWarning: tr("unusual value of {0}: {1} is default; only positive values; point is decimal separator; if units, put space then unit", "{0.key}", tr("meters"));
|
---|
[16685] | 283 | assertMatch: "node height=medium";
|
---|
| 284 | assertMatch: "node maxheight=-5";
|
---|
| 285 | assertMatch: "node maxlength=0";
|
---|
| 286 | assertMatch: "node maxlength=10'13\"";
|
---|
[17266] | 287 | assertMatch: "node width=10'2.\"";
|
---|
| 288 | assertMatch: "node maxheight=\"2. m\"";
|
---|
| 289 | assertMatch: "node height=\"12. m\"";
|
---|
[16685] | 290 | assertNoMatch: "node height=6.78 meters";
|
---|
| 291 | assertNoMatch: "node height=5 metre";
|
---|
| 292 | assertNoMatch: "node height=2m";
|
---|
| 293 | assertNoMatch: "node height=3";
|
---|
| 294 | assertNoMatch: "node height=2.22 m";
|
---|
| 295 | assertNoMatch: "node height=7.8";
|
---|
| 296 | assertNoMatch: "node maxwidth=7 ft";
|
---|
| 297 | assertNoMatch: "node height=22'";
|
---|
| 298 | assertNoMatch: "node width=10'5\"";
|
---|
[17266] | 299 | assertNoMatch: "node width=10'";
|
---|
[7937] | 300 | }
|
---|
[13345] | 301 |
|
---|
[18731] | 302 | *[min_height][min_height =~ /^-?[0-9]+(\.[0-9]+)?(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/] {
|
---|
| 303 | throwWarning: tr("unusual value of {0}: use abbreviation for unit and space between value and unit", "{0.key}");
|
---|
| 304 | fixAdd: concat("min_height=", get(regexp_match("(-?[0-9.]+)( )*(.+)",tag("min_height")),1)," m");
|
---|
| 305 | set min_height_meter_autofix;
|
---|
| 306 | assertMatch: "node min_height=6.78 meters";
|
---|
| 307 | assertMatch: "node min_height=5 metre";
|
---|
| 308 | assertMatch: "node min_height=2m";
|
---|
| 309 | assertNoMatch: "node min_height=2 m";
|
---|
| 310 | assertNoMatch: "node min_height=5";
|
---|
| 311 | }
|
---|
| 312 | *[min_height][min_height =~ /^-?[0-9]+,[0-9][0-9]?( m|\')?$/] {
|
---|
| 313 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
| 314 | fixAdd: concat("min_height=", replace(tag("min_height"), ",", "."));
|
---|
| 315 | set min_height_separator_autofix;
|
---|
| 316 | assertMatch: "node min_height=5,5";
|
---|
| 317 | assertMatch: "node min_height=12,00";
|
---|
| 318 | assertMatch: "node min_height=12,5'";
|
---|
| 319 | assertNoMatch: "node min_height=12,000";
|
---|
| 320 | assertNoMatch: "node min_height=3,50,5";
|
---|
| 321 | assertNoMatch: "node min_height=3.5";
|
---|
| 322 | assertNoMatch: "node min_height=4";
|
---|
| 323 | }
|
---|
| 324 | *[min_height ][min_height !~ /^(-?([0-9]+(\.[0-9]+)?( m)?)|(-?[1-9][0-9]*\'((10|11|[0-9])((\.[0-9]+)?)\")?))$/]!.min_height_separator_autofix!.min_height_meter_autofix!.min_height_foot_autofix {
|
---|
| 325 | throwWarning: tr("unusual value of {0}: {1} is default; point is decimal separator; if units, put space then unit", "{0.key}", tr("meters"));
|
---|
| 326 | assertMatch: "node min_height=\"12. m\"";
|
---|
| 327 | assertNoMatch: "node min_height=-5";
|
---|
| 328 | }
|
---|
| 329 |
|
---|
[16685] | 330 | *[maxaxleload][maxaxleload =~ /^[0-9]+,[0-9][0-9]?( (t|kg|st|lbs))?$/] {
|
---|
[13345] | 331 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
[16685] | 332 | fixAdd: concat("maxaxleload=", replace(tag("maxaxleload"), ",", "."));
|
---|
| 333 | set maxaxleload_separator_autofix;
|
---|
| 334 | assertMatch: "node maxaxleload=5,5";
|
---|
| 335 | assertMatch: "node maxaxleload=12,00";
|
---|
| 336 | assertNoMatch: "node maxaxleload=12,000";
|
---|
| 337 | assertNoMatch: "node maxaxleload=3,50,5";
|
---|
| 338 | assertNoMatch: "node maxaxleload=3.5";
|
---|
| 339 | assertNoMatch: "node maxaxleload=4";
|
---|
| 340 | }
|
---|
| 341 |
|
---|
| 342 | *[maxweight][maxweight =~ /^[0-9]+,[0-9][0-9]?( (t|kg|st|lbs))?$/] {
|
---|
| 343 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
[13345] | 344 | fixAdd: concat("maxweight=", replace(tag("maxweight"), ",", "."));
|
---|
| 345 | set maxweight_separator_autofix;
|
---|
| 346 | assertMatch: "node maxweight=5,5";
|
---|
| 347 | assertMatch: "node maxweight=12,00";
|
---|
[13357] | 348 | assertNoMatch: "node maxweight=12,000";
|
---|
[13345] | 349 | assertNoMatch: "node maxweight=3,50,5";
|
---|
| 350 | assertNoMatch: "node maxweight=3.5";
|
---|
| 351 | assertNoMatch: "node maxweight=4";
|
---|
| 352 | }
|
---|
[16685] | 353 |
|
---|
[17267] | 354 | *[maxaxleload][maxaxleload !~ /^([0-9]+(\.[0-9]+)?( (t|kg|st|lbs))?)$/]!.maxaxleload_separator_autofix,
|
---|
| 355 | *[maxweight][maxweight !~ /^([0-9]+(\.[0-9]+)?( (t|kg|st|lbs))?)$/]!.maxweight_separator_autofix {
|
---|
[17955] | 356 | throwWarning: tr("unusual value of {0}: {1} is default; only positive values; point is decimal separator; if units, put space then unit", "{0.key}", tr("tonne"));
|
---|
[16685] | 357 | assertMatch: "node maxaxleload=something";
|
---|
| 358 | assertMatch: "node maxweight=-5";
|
---|
| 359 | assertNoMatch: "node maxaxleload=2";
|
---|
| 360 | assertNoMatch: "node maxaxleload=2.5";
|
---|
| 361 | assertNoMatch: "node maxaxleload=7 kg";
|
---|
[8701] | 362 | }
|
---|
[13345] | 363 |
|
---|
[8700] | 364 | way[maxspeed][maxspeed !~ /^(signals|none|unposted|variable|walk|[1-9][0-9]*( [a-z]+)?|[A-Z][A-Z]:(urban|rural|living_street|motorway))$/],
|
---|
| 365 | way[maxspeed:forward][maxspeed:forward !~ /^(signals|none|unposted|variable|walk|[1-9][0-9]*( [a-z]+)?|[A-Z][A-Z]:(urban|rural|living_street|motorway))$/],
|
---|
| 366 | way[maxspeed:backward][maxspeed:backward !~ /^(signals|none|unposted|variable|walk|[1-9][0-9]*( [a-z]+)?|[A-Z][A-Z]:(urban|rural|living_street|motorway))$/] {
|
---|
[17955] | 367 | throwWarning: tr("unusual value of {0}: {1} is default; only positive values; point is decimal separator; if units, put space then unit", "{0.key}", tr("km/h"));
|
---|
[7937] | 368 | assertMatch: "way maxspeed=something";
|
---|
| 369 | assertMatch: "way maxspeed=-50";
|
---|
| 370 | assertMatch: "way maxspeed=0";
|
---|
| 371 | assertNoMatch: "way maxspeed=50";
|
---|
| 372 | assertNoMatch: "way maxspeed=30 mph";
|
---|
| 373 | assertNoMatch: "way maxspeed=RO:urban";
|
---|
| 374 | assertNoMatch: "way maxspeed=RU:rural";
|
---|
| 375 | assertNoMatch: "way maxspeed=RU:living_street";
|
---|
| 376 | assertNoMatch: "way maxspeed=DE:motorway";
|
---|
| 377 | assertNoMatch: "way maxspeed=signals";
|
---|
| 378 | assertNoMatch: "way maxspeed=none";
|
---|
| 379 | assertNoMatch: "way maxspeed=variable";
|
---|
| 380 | }
|
---|
| 381 |
|
---|
[13357] | 382 | *[distance][distance =~ /^[0-9]+,[0-9][0-9]?( (m|km|mi|nmi))?$/] {
|
---|
[13345] | 383 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
| 384 | fixAdd: concat("distance=", replace(tag("distance"), ",", "."));
|
---|
| 385 | set distance_separator_autofix;
|
---|
| 386 | assertMatch: "node distance=5,5";
|
---|
| 387 | assertMatch: "node distance=12,00";
|
---|
[13357] | 388 | assertNoMatch: "node distance=12,000";
|
---|
[13345] | 389 | assertNoMatch: "node distance=3,50,5";
|
---|
| 390 | assertNoMatch: "node distance=3.5";
|
---|
| 391 | assertNoMatch: "node distance=4";
|
---|
| 392 | }
|
---|
[17268] | 393 | *[distance][distance !~ /^(([0-9]+(\.[0-9]+)?( (m|km|mi|nmi))?)|([0-9]+\'([0-9]+(\.[0-9]+)?\")?))$/]!.distance_separator_autofix {
|
---|
[17955] | 394 | throwWarning: tr("unusual value of {0}: {1} is default; only positive values; point is decimal separator; if units, put space then unit", "{0.key}", tr("kilometers"));
|
---|
[8725] | 395 | assertMatch: "way distance=something";
|
---|
| 396 | assertMatch: "way distance=-5";
|
---|
[17266] | 397 | assertMatch: "way distance=5.";
|
---|
[8725] | 398 | assertNoMatch: "way distance=2";
|
---|
| 399 | assertNoMatch: "way distance=2.5";
|
---|
| 400 | assertNoMatch: "way distance=7 mi";
|
---|
| 401 | }
|
---|
| 402 |
|
---|
[18535] | 403 | way[voltage][voltage =~ /(.*[A-Za-z].*)|.*,.*|.*( ).*/],
|
---|
| 404 | way[voltage:primary][voltage:primary =~ /(.*[A-Za-z].*)|.*,.*|.*( ).*/],
|
---|
| 405 | way[voltage:secondary][voltage:secondary =~ /(.*[A-Za-z].*)|.*,.*|.*( ).*/],
|
---|
| 406 | way[voltage:tertiary][voltage:tertiary =~ /(.*[A-Za-z].*)|.*,.*|.*( ).*/] {
|
---|
[7937] | 407 | throwWarning: tr("voltage should be in volts with no units/delimiter/spaces");
|
---|
| 408 | assertMatch: "way voltage=medium";
|
---|
| 409 | assertNoMatch: "way voltage=15000";
|
---|
| 410 | }
|
---|
| 411 |
|
---|
| 412 | /* some users are using frequency for other purposes (not electromagnetic)
|
---|
| 413 | with the values 'perennial' and 'intermittent'; the vast majority are 0, 16.7, 50 and 60 */
|
---|
| 414 | way[frequency][frequency !~ /^(0|[1-9][0-9]*(\.[0-9]+)?)( (kHz|MHz|GHz|THz))?$/] {
|
---|
[13343] | 415 | throwWarning: tr("unusual value of {0}", "{0.key}");
|
---|
[7937] | 416 | assertMatch: "way frequency=something";
|
---|
| 417 | assertNoMatch: "way frequency=0"; /* DC */
|
---|
| 418 | assertNoMatch: "way frequency=16.7";
|
---|
| 419 | assertNoMatch: "way frequency=50";
|
---|
| 420 | assertNoMatch: "way frequency=680 kHz";
|
---|
| 421 | assertNoMatch: "way frequency=123.5 MHz";
|
---|
| 422 | }
|
---|
| 423 |
|
---|
[18385] | 424 | way[gauge][gauge =~ /^(broad|standard|narrow)$/],
|
---|
| 425 | relation[gauge][gauge =~ /^(broad|standard|narrow)$/] {
|
---|
| 426 | throwWarning: tr("imprecise value of {0}", "{0.tag}");
|
---|
| 427 | suggestAlternative: tr("an integer value in millimeters, without unit");
|
---|
| 428 | set imprecise_gauge;
|
---|
| 429 | assertNoMatch: "way gauge=something";
|
---|
| 430 | assertNoMatch: "way gauge=1435";
|
---|
| 431 | assertNoMatch: "way gauge=1000;1435";
|
---|
| 432 | assertNoMatch: "way gauge=2''10'";
|
---|
| 433 | assertMatch: "way gauge=standard";
|
---|
| 434 | assertMatch: "way gauge=narrow";
|
---|
| 435 | }
|
---|
| 436 | way[gauge][gauge !~ /^([1-9][0-9]{1,3}(;[1-9][0-9]{1,3})*)$/]!.imprecise_gauge,
|
---|
| 437 | relation[gauge][gauge !~ /^([1-9][0-9]{1,3}(;[1-9][0-9]{1,3})*)$/]!.imprecise_gauge {
|
---|
[13343] | 438 | throwWarning: tr("unusual value of {0}", "{0.key}");
|
---|
[18385] | 439 | set unusual_gauge;
|
---|
| 440 | assertMatch: "way gauge=something";
|
---|
| 441 | assertMatch: "way gauge=2''10'";
|
---|
[7937] | 442 | assertNoMatch: "way gauge=1435";
|
---|
| 443 | assertNoMatch: "way gauge=1000;1435";
|
---|
| 444 | assertNoMatch: "way gauge=standard";
|
---|
| 445 | assertNoMatch: "way gauge=narrow";
|
---|
| 446 | }
|
---|
[18385] | 447 | /* #21866 - warn on narrow_railway gauge values outside 89..1434 range, including multi values */
|
---|
| 448 | way[/railway$/ =~ /^narrow_gauge$/][gauge][gauge !~ /^((14(?:3[0-4]|[4-9])|(?:14[0-2]|(?:1[0-3]|9)[0-9])[0-9]?|143|(?:[2-7][0-9]|1[5-9])[0-9]|8(?:[0-8][0-9]|9[0-9]?));?)+$/]!.imprecise_gauge!.unusual_gauge,
|
---|
| 449 | relation[/railway$/ =~ /^narrow_gauge$/][gauge][gauge !~ /^((14(?:3[0-4]|[4-9])|(?:14[0-2]|(?:1[0-3]|9)[0-9])[0-9]?|143|(?:[2-7][0-9]|1[5-9])[0-9]|8(?:[0-8][0-9]|9[0-9]?));?)+$/]!.imprecise_gauge!.unusual_gauge[type=route]{
|
---|
| 450 | group: tr("suspicious tag combination");
|
---|
| 451 | throwWarning: tr("unusual {0} value on narrow gauge railway", "{1.key}");
|
---|
| 452 | assertMatch: "way railway=narrow_gauge gauge=88";
|
---|
| 453 | assertNoMatch: "way railway=narrow_gauge gauge=89";
|
---|
| 454 | assertNoMatch: "way railway=narrow_gauge gauge=1434";
|
---|
| 455 | assertMatch: "way railway=narrow_gauge gauge=1435";
|
---|
| 456 | assertMatch: "way railway=narrow_gauge gauge=1435;1500";
|
---|
| 457 | assertMatch: "way railway=narrow_gauge gauge=60;600";
|
---|
| 458 | assertNoMatch: "way railway=narrow_gauge gauge=2''10'";
|
---|
| 459 | assertNoMatch: "way railway=narrow_gauge gauge=something";
|
---|
| 460 | assertNoMatch: "way railway=narrow_gauge gauge=narrow";
|
---|
| 461 | }
|
---|
[7937] | 462 |
|
---|
| 463 | /* the numbers for percentage and degrees include could probably be bracketed a bit more precisely */
|
---|
| 464 | way[incline][incline !~ /^(up|down|-?([0-9]+?(\.[1-9]%)?|100)[%°]?)$/] {
|
---|
[13343] | 465 | throwWarning: tr("unusual value of {0}", "{0.key}");
|
---|
| 466 | suggestAlternative: "x%";
|
---|
| 467 | suggestAlternative: "x°";
|
---|
| 468 | suggestAlternative: "up";
|
---|
| 469 | suggestAlternative: "down";
|
---|
[7937] | 470 | assertMatch: "way incline=extreme";
|
---|
| 471 | assertNoMatch: "way incline=up";
|
---|
| 472 | assertNoMatch: "way incline=down";
|
---|
| 473 | assertNoMatch: "way incline=10%";
|
---|
| 474 | assertNoMatch: "way incline=-5%";
|
---|
| 475 | assertNoMatch: "way incline=10°";
|
---|
| 476 | }
|
---|
| 477 |
|
---|
| 478 | /* see ticket #9631 */
|
---|
| 479 | *[population][population !~ /^[0-9]+$/ ] {
|
---|
| 480 | throwWarning: tr("{0} must be a numeric value", "{0.key}");
|
---|
| 481 | }
|
---|
| 482 |
|
---|
[7998] | 483 | /* must be an integer positive number only and not 0, see #10837 (lanes), #11055 (screen) */
|
---|
[16316] | 484 | node[seats][seats !~ /^[1-9]([0-9]*)$/][amenity=bench],
|
---|
| 485 | way[seats][seats !~ /^[1-9]([0-9]*)$/][amenity=bench],
|
---|
[7998] | 486 | way[lanes][lanes !~ /^[1-9]([0-9]*)$/][highway],
|
---|
| 487 | way["lanes:backward"]["lanes:backward" !~ /^[1-9]([0-9]*)$/][highway],
|
---|
| 488 | way["lanes:forward"]["lanes:forward" !~ /^[1-9]([0-9]*)$/][highway],
|
---|
| 489 | *[screen][screen !~ /^[1-9]([0-9]*)$/][amenity=cinema] {
|
---|
| 490 | throwError: tr("{0} must be a positive integer number", "{0.key}");
|
---|
[7937] | 491 | assertMatch: "way highway=residential lanes=-1";
|
---|
| 492 | assertMatch: "way highway=residential lanes=5.5";
|
---|
| 493 | assertMatch: "way highway=residential lanes=1;2";
|
---|
| 494 | assertMatch: "way highway=residential lanes:forward=-1";
|
---|
| 495 | assertMatch: "way highway=residential lanes:backward=-1";
|
---|
| 496 | assertNoMatch: "way highway=residential lanes=1";
|
---|
[7998] | 497 | assertMatch: "node amenity=cinema screen=led";
|
---|
| 498 | assertNoMatch: "node amenity=cinema screen=8";
|
---|
[7937] | 499 | }
|
---|
[9050] | 500 | *[admin_level][admin_level !~ /^(1|2|3|4|5|6|7|8|9|10|11|12)$/] {
|
---|
[13343] | 501 | throwWarning: tr("unusual value of {0}", "{0.key}");
|
---|
[9050] | 502 | assertMatch: "node admin_level=0";
|
---|
| 503 | assertMatch: "node admin_level=-1";
|
---|
| 504 | assertMatch: "node admin_level=13";
|
---|
| 505 | assertNoMatch: "node admin_level=5";
|
---|
[11338] | 506 | }
|
---|
| 507 |
|
---|
[12493] | 508 | /* #14989 */
|
---|
| 509 | *[direction][direction<0],
|
---|
[15383] | 510 | *[direction][direction>=360],
|
---|
[15965] | 511 | *[direction][direction !~ /^([0-9][0-9]?[0-9]?|north|east|south|west|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW|forward|backward|both|clockwise|anti-clockwise|anticlockwise|up|down)((-|;)([0-9][0-9]?[0-9]?|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW))*$/] {
|
---|
[13343] | 512 | throwWarning: tr("unusual value of {0}", "{0.key}");
|
---|
[12493] | 513 | assertMatch: "node direction=north-down";
|
---|
| 514 | assertMatch: "node direction=rome";
|
---|
| 515 | assertMatch: "node direction=C";
|
---|
| 516 | assertMatch: "node direction=NNNE";
|
---|
| 517 | assertMatch: "node direction=1360";
|
---|
| 518 | assertNoMatch: "node direction=NE-S"; /* ranges are used at tourism=viewpoint*/
|
---|
| 519 | assertMatch: "node direction=north-south"; /* ranges only in numbers or short NESW form */
|
---|
| 520 | assertMatch: "node direction=north-east"; /* if range use N-E, if single direcion use NE */
|
---|
| 521 | assertNoMatch: "node direction=0-360"; /* complete panorama view */
|
---|
| 522 | assertNoMatch: "node direction=45-100;190-250;300-360";
|
---|
[15965] | 523 | assertMatch: "node direction=45-100;190-250;300-";
|
---|
| 524 | assertNoMatch: "node direction=45-100;190-250;300";
|
---|
| 525 | assertNoMatch: "node direction=90;270";
|
---|
[11338] | 526 | assertNoMatch: "node direction=up";
|
---|
| 527 | assertNoMatch: "node direction=down"; /* up/down are replaced by incline tag, has separate warning */
|
---|
[15383] | 528 | assertMatch: "node direction=-10";
|
---|
[11338] | 529 | assertNoMatch: "node direction=0";
|
---|
| 530 | assertNoMatch: "node direction=45";
|
---|
[15383] | 531 | assertMatch: "node direction=360";
|
---|
[11338] | 532 | assertNoMatch: "node direction=N";
|
---|
| 533 | assertNoMatch: "node direction=NNE";
|
---|
| 534 | assertNoMatch: "node direction=west";
|
---|
| 535 | assertNoMatch: "node direction=forward";
|
---|
| 536 | assertNoMatch: "node direction=anti-clockwise";
|
---|
| 537 | assertNoMatch: "node direction=anticlockwise"; /* both spellings are in use and even wiki uses both */
|
---|
[12215] | 538 | }
|
---|
| 539 |
|
---|
| 540 | /* #14786 (should be safe to just remove the meters unit from the value) */
|
---|
| 541 | *[ele][ele =~ /^-?[0-9]+(\.[0-9]+)? ?m$/] {
|
---|
| 542 | throwWarning: tr("{0} must be a numeric value, in meters and without units", "{0.key}");
|
---|
| 543 | fixAdd: concat("ele=", trim(replace(tag("ele"), "m", "")));
|
---|
[13345] | 544 | set ele_meter_remove_autofix;
|
---|
[12215] | 545 | assertMatch: "node ele=12m";
|
---|
| 546 | assertMatch: "node ele=12 m";
|
---|
| 547 | assertNoMatch: "node ele=12km";
|
---|
| 548 | assertMatch: "node ele=12.1m";
|
---|
| 549 | assertMatch: "node ele=-12.1 m";
|
---|
| 550 | assertNoMatch: "node ele=12";
|
---|
| 551 | assertNoMatch: "node ele=high";
|
---|
| 552 | }
|
---|
[13357] | 553 | *[ele][ele =~ /^[0-9]+,[0-9][0-9]?$/] {
|
---|
[13345] | 554 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
| 555 | fixAdd: concat("ele=", replace(tag("ele"), ",", "."));
|
---|
| 556 | set ele_separator_autofix;
|
---|
| 557 | assertMatch: "node ele=5,5";
|
---|
| 558 | assertMatch: "node ele=12,00";
|
---|
[13357] | 559 | assertNoMatch: "node ele=8,848"; /* wrongly used thousands separator */
|
---|
[13345] | 560 | assertNoMatch: "node ele=3,50,5";
|
---|
| 561 | assertNoMatch: "node ele=3.5";
|
---|
| 562 | assertNoMatch: "node ele=4";
|
---|
| 563 | }
|
---|
[14593] | 564 | *[ele][ele !~ /^-?[0-9]+(\.[0-9]+)?$/]!.ele_meter_remove_autofix!.ele_separator_autofix {
|
---|
[12215] | 565 | throwWarning: tr("{0} must be a numeric value, in meters and without units", "{0.key}");
|
---|
| 566 | assertNoMatch: "node ele=12m";
|
---|
| 567 | assertNoMatch: "node ele=12 m";
|
---|
| 568 | assertMatch: "node ele=12km";
|
---|
| 569 | assertNoMatch: "node ele=12.1m";
|
---|
| 570 | assertNoMatch: "node ele=-12.1 m";
|
---|
| 571 | assertNoMatch: "node ele=12";
|
---|
| 572 | assertMatch: "node ele=high";
|
---|
[14273] | 573 | }
|
---|
[14593] | 574 |
|
---|
[14940] | 575 | /* #17530 */
|
---|
| 576 | *[ele][ele =~ /^-?[0-9]+\.[0-9][0-9][0-9]+$/] {
|
---|
| 577 | throwWarning: tr("{0}", "{0.tag}");
|
---|
| 578 | group: tr("Unnecessary amount of decimal places");
|
---|
| 579 | fixAdd: concat("ele=", round(tag("ele")*100)/100);
|
---|
| 580 | assertNoMatch: "node ele=12";
|
---|
| 581 | assertNoMatch: "node ele=1.12";
|
---|
| 582 | assertMatch: "node ele=12.123";
|
---|
| 583 | assertMatch: "node ele=12.1234";
|
---|
| 584 | assertMatch: "node ele=-12.6789";
|
---|
| 585 | assertNoMatch: "node ele=12.123 m";
|
---|
| 586 | assertNoMatch: "node ele=high";
|
---|
| 587 | }
|
---|
| 588 |
|
---|
[14593] | 589 | /* #15774 */
|
---|
| 590 | node[fire_hydrant:pressure="#"] {
|
---|
| 591 | throwError: tr("unusual value of {0}", "{0.key}");
|
---|
[14728] | 592 | }
|
---|
| 593 |
|
---|
[18384] | 594 | *[interval][interval !~ /^([0-9][0-9]?[0-9]?|[0-9]+[0-9]:[0-5][0-9](:[0-5][0-9])?)$/] {
|
---|
[14728] | 595 | throwWarning: tr("unusual value of {0}", "{0.key}");
|
---|
| 596 | assertNoMatch: "way interval=5";
|
---|
| 597 | assertNoMatch: "way interval=20";
|
---|
| 598 | assertNoMatch: "way interval=00:05";
|
---|
| 599 | assertNoMatch: "way interval=00:05:00";
|
---|
| 600 | assertNoMatch: "way interval=03:00:00";
|
---|
[18384] | 601 | assertNoMatch: "relation interval=168:00:00";
|
---|
| 602 | assertNoMatch: "relation interval=120";
|
---|
[14728] | 603 | assertMatch: "way interval=0:5:0";
|
---|
| 604 | assertMatch: "way interval=00:65:00";
|
---|
[18384] | 605 | assertMatch: "way interval=00:15:90";
|
---|
[14728] | 606 | }
|
---|
[15325] | 607 |
|
---|
| 608 | /* #15107 */
|
---|
| 609 | *[aeroway=helipad ][iata][iata!~/^[A-Z]{3}$/],
|
---|
| 610 | *[aeroway=aerodrome][iata][iata!~/^[A-Z]{3}$/] {
|
---|
| 611 | throwWarning: tr("wrong value: {0}", "{1.tag}");
|
---|
| 612 | group: tr("Airport tagging");
|
---|
| 613 | assertNoMatch: "way aeroway=aerodrome iata=BER";
|
---|
| 614 | assertMatch: "way aeroway=aerodrome iata=BERL";
|
---|
| 615 | assertMatch: "way aeroway=aerodrome iata=BE";
|
---|
| 616 | assertMatch: "way aeroway=aerodrome iata=ber";
|
---|
| 617 | }
|
---|
| 618 | *[aeroway=helipad ][icao][icao!~/^[A-Z]{4}$/],
|
---|
| 619 | *[aeroway=aerodrome][icao][icao!~/^[A-Z]{4}$/] {
|
---|
| 620 | throwWarning: tr("wrong value: {0}", "{1.tag}");
|
---|
| 621 | group: tr("Airport tagging");
|
---|
| 622 | assertNoMatch: "way aeroway=aerodrome icao=EDDB";
|
---|
| 623 | assertMatch: "way aeroway=aerodrome icao=EDDBA";
|
---|
| 624 | assertMatch: "way aeroway=aerodrome icao=EDD";
|
---|
| 625 | assertMatch: "way aeroway=aerodrome icao=eddb";
|
---|
| 626 | }
|
---|
| 627 | *[aeroway=helipad ][icao][icao!~/^(AG|AN|AY|BG|BI|BK|C|DA|DB|DF|DG|DI|DN|DR|DT|DX|EB|ED|EE|EF|EG|EH|EI|EK|EL|EN|EP|ES|ET|EV|EY|FA|FB|FC|FD|FE|FG|FH|FI|FJ|FK|FL|FM|FN|FO|FP|FQ|FS|FT|FV|FW|FX|FY|FZ|GA|GB|GC|GE|GF|GG|GL|GM|GO|GQ|GS|GU|GV|HA|HB|HC|HD|HE|HH|HK|HL|HR|HS|HT|HU|K|LA|LB|LC|LD|LE|LF|LG|LH|LI|LJ|LK|LL|LM|LN|LO|LP|LQ|LR|LS|LT|LU|LV|LW|LX|LY|LZ|MB|MD|MG|MH|MK|MM|MN|MP|MR|MS|MT|MU|MW|MY|MZ|NC|NF|NG|NI|NL|NS|NT|NV|NW|NZ|OA|OB|OE|OI|OJ|OK|OL|OM|OO|OP|OR|OS|OT|OY|PA|PB|PC|PF|PG|PH|PJ|PK|PL|PM|PO|PP|PT|PW|RC|RJ|RK|RO|RP|SA|SB|SC|SD|SE|SF|SG|SH|SI|SJ|SK|SL|SM|SN|SO|SP|SS|SU|SV|SW|SY|TA|TB|TD|TF|TG|TI|TJ|TK|TL|TN|TQ|TR|TT|TU|TV|TX|U|UA|UB|UC|UD|UG|UK|UM|UT|VA|VC|VD|VE|VG|VH|VI|VL|VM|VN|VO|VQ|VR|VT|VV|VY|WA|WB|WI|WM|WP|WQ|WR|WS|Y|Z|ZK|ZM)/],
|
---|
| 628 | *[aeroway=aerodrome][icao][icao!~/^(AG|AN|AY|BG|BI|BK|C|DA|DB|DF|DG|DI|DN|DR|DT|DX|EB|ED|EE|EF|EG|EH|EI|EK|EL|EN|EP|ES|ET|EV|EY|FA|FB|FC|FD|FE|FG|FH|FI|FJ|FK|FL|FM|FN|FO|FP|FQ|FS|FT|FV|FW|FX|FY|FZ|GA|GB|GC|GE|GF|GG|GL|GM|GO|GQ|GS|GU|GV|HA|HB|HC|HD|HE|HH|HK|HL|HR|HS|HT|HU|K|LA|LB|LC|LD|LE|LF|LG|LH|LI|LJ|LK|LL|LM|LN|LO|LP|LQ|LR|LS|LT|LU|LV|LW|LX|LY|LZ|MB|MD|MG|MH|MK|MM|MN|MP|MR|MS|MT|MU|MW|MY|MZ|NC|NF|NG|NI|NL|NS|NT|NV|NW|NZ|OA|OB|OE|OI|OJ|OK|OL|OM|OO|OP|OR|OS|OT|OY|PA|PB|PC|PF|PG|PH|PJ|PK|PL|PM|PO|PP|PT|PW|RC|RJ|RK|RO|RP|SA|SB|SC|SD|SE|SF|SG|SH|SI|SJ|SK|SL|SM|SN|SO|SP|SS|SU|SV|SW|SY|TA|TB|TD|TF|TG|TI|TJ|TK|TL|TN|TQ|TR|TT|TU|TV|TX|U|UA|UB|UC|UD|UG|UK|UM|UT|VA|VC|VD|VE|VG|VH|VI|VL|VM|VN|VO|VQ|VR|VT|VV|VY|WA|WB|WI|WM|WP|WQ|WR|WS|Y|Z|ZK|ZM)/] {
|
---|
| 629 | throwWarning: tr("wrong value: {0}", "{1.tag}");
|
---|
| 630 | group: tr("Airport tagging");
|
---|
| 631 | assertNoMatch: "way aeroway=aerodrome icao=EDDB";
|
---|
| 632 | assertMatch: "way aeroway=aerodrome icao=EQQQ";
|
---|
[15715] | 633 | }
|
---|
| 634 |
|
---|
| 635 | /* #18573 */
|
---|
| 636 | *[isced:level][isced:level !~ /^(0|1|2|3|4|5|6|7|8)((;|-)(1|2|3|4|5|6|7|8))*$/] {
|
---|
| 637 | throwWarning: tr("unusual value of {0}", "{0.key}");
|
---|
| 638 | assertMatch: "node isced:level=secondary";
|
---|
| 639 | assertMatch: "node isced:level=0,1,2,3";
|
---|
| 640 | assertMatch: "node isced:level=9";
|
---|
| 641 | assertMatch: "node isced:level=10";
|
---|
| 642 | assertNoMatch: "node isced:level=0;1;2;3";
|
---|
| 643 | assertNoMatch: "node isced:level=0";
|
---|
| 644 | assertNoMatch: "node isced:level=5";
|
---|
| 645 | assertNoMatch: "node isced:level=0-3";
|
---|
[16340] | 646 | }
|
---|
| 647 |
|
---|
| 648 | /* #11253, maxstay=0 is unclear. Was in presets. */
|
---|
| 649 | *[maxstay=0] {
|
---|
| 650 | throwWarning: tr("Definition of {0} is unclear", "{0.tag}");
|
---|
| 651 | assertMatch: "node maxstay=0";
|
---|
| 652 | assertMatch: "way maxstay=0";
|
---|
| 653 | assertNoMatch: "node maxstay=2";
|
---|
| 654 | assertNoMatch: "way maxstay=no";
|
---|
| 655 | }
|
---|
| 656 |
|
---|
| 657 | /* #11253, maxstay needs unit. Was in presets without it. Autofixes for the most common cases. */
|
---|
| 658 | *[maxstay][maxstay =~ /^([1-9][0-9]*(\.[0-9]+)? min)$/][maxstay!="1 min"] {
|
---|
| 659 | throwWarning: tr("unusual value of {0}: set unit e.g. {1} or {2}; only positive values; point is decimal separator; space between value and unit", "{0.key}", "minutes", "hours");
|
---|
| 660 | fixAdd: concat("maxstay=", replace(tag("maxstay"), "min", "minutes"));
|
---|
| 661 | set maxstay_autofix;
|
---|
| 662 | assertMatch: "node maxstay=\"5 min\"";
|
---|
| 663 | assertMatch: "node maxstay=\"15 min\"";
|
---|
| 664 | assertNoMatch: "node maxstay=\"1 min\"";
|
---|
| 665 | assertNoMatch: "node maxstay=\"02 minutes\"";
|
---|
| 666 | assertNoMatch: "node maxstay=\"2 minutes\"";
|
---|
| 667 | }
|
---|
| 668 | *[maxstay="1h"],
|
---|
| 669 | *[maxstay="1 h"],
|
---|
| 670 | *[maxstay="1 hr"] {
|
---|
| 671 | throwWarning: tr("unusual value of {0}: set unit e.g. {1} or {2}; only positive values; point is decimal separator; space between value and unit", "{0.key}", "minutes", "hours");
|
---|
| 672 | fixAdd: "maxstay=1 hour";
|
---|
| 673 | set maxstay_autofix;
|
---|
| 674 | assertMatch: "node maxstay=1h";
|
---|
| 675 | assertMatch: "node maxstay=\"1 h\"";
|
---|
| 676 | assertMatch: "node maxstay=\"1 hr\"";
|
---|
| 677 | }
|
---|
| 678 | *[maxstay][maxstay =~ /^([1-9][0-9]*(\.[0-9]+)? h)$/][maxstay!="1 h"] {
|
---|
| 679 | throwWarning: tr("unusual value of {0}: set unit e.g. {1} or {2}; only positive values; point is decimal separator; space between value and unit", "{0.key}", "minutes", "hours");
|
---|
| 680 | fixAdd: concat("maxstay=", replace(tag("maxstay"), "h", "hours"));
|
---|
| 681 | set maxstay_autofix;
|
---|
| 682 | assertMatch: "node maxstay=\"5 h\"";
|
---|
| 683 | assertMatch: "node maxstay=\"15 h\"";
|
---|
| 684 | assertNoMatch: "node maxstay=\"1 h\"";
|
---|
| 685 | assertNoMatch: "node maxstay=\"02 hours\"";
|
---|
| 686 | assertNoMatch: "node maxstay=\"2 hours\"";
|
---|
| 687 | }
|
---|
| 688 | *[maxstay][maxstay =~ /^([1-9][0-9]*(\.[0-9]+)? hr)$/][maxstay!="1 hr"] {
|
---|
| 689 | throwWarning: tr("unusual value of {0}: set unit e.g. {1} or {2}; only positive values; point is decimal separator; space between value and unit", "{0.key}", "minutes", "hours");
|
---|
| 690 | fixAdd: concat("maxstay=", replace(tag("maxstay"), "hr", "hours"));
|
---|
| 691 | set maxstay_autofix;
|
---|
| 692 | assertMatch: "node maxstay=\"5 hr\"";
|
---|
| 693 | assertMatch: "node maxstay=\"15 hr\"";
|
---|
| 694 | assertNoMatch: "node maxstay=\"1 hr\"";
|
---|
| 695 | assertNoMatch: "node maxstay=\"02 hours\"";
|
---|
| 696 | assertNoMatch: "node maxstay=\"2 hours\"";
|
---|
| 697 | }
|
---|
| 698 | *[maxstay][maxstay =~ /^([1-9][0-9]*(\.[0-9]+)?h)$/][maxstay!="1h"] {
|
---|
| 699 | throwWarning: tr("unusual value of {0}: set unit e.g. {1} or {2}; only positive values; point is decimal separator; space between value and unit", "{0.key}", "minutes", "hours");
|
---|
| 700 | fixAdd: concat("maxstay=", replace(tag("maxstay"), "h", " hours"));
|
---|
| 701 | set maxstay_autofix;
|
---|
| 702 | assertMatch: "node maxstay=5h";
|
---|
| 703 | assertMatch: "node maxstay=15h";
|
---|
| 704 | assertNoMatch: "node maxstay=1h";
|
---|
| 705 | assertNoMatch: "node maxstay=02hours";
|
---|
| 706 | assertNoMatch: "node maxstay=2hours";
|
---|
| 707 | assertNoMatch: "node maxstay=\"2 h\"";
|
---|
| 708 | assertNoMatch: "node maxstay=\"2 hr\"";
|
---|
| 709 | }
|
---|
| 710 | /* the rest without autofix */
|
---|
| 711 | *[maxstay][maxstay !~ /^(([1-9][0-9]*(\.[0-9]+)?( (minute|minutes|hour|hours|day|days|week|weeks|month|months|year|years)))|(no|unlimited|0|load-unload))$/]!.maxstay_autofix {
|
---|
| 712 | throwWarning: tr("unusual value of {0}: set unit e.g. {1} or {2}; only positive values; point is decimal separator; space between value and unit", "{0.key}", "minutes", "hours");
|
---|
| 713 | assertMatch: "node maxstay=something";
|
---|
| 714 | assertMatch: "node maxstay=-5";
|
---|
| 715 | assertMatch: "node maxstay=180";
|
---|
| 716 | assertMatch: "node maxstay=66minutes";
|
---|
| 717 | assertMatch: "node maxstay=\"1. hours\"";
|
---|
| 718 | assertMatch: "node maxstay=\"0 minutes\"";
|
---|
| 719 | assertNoMatch: "node maxstay=0";
|
---|
| 720 | assertNoMatch: "node maxstay=no";
|
---|
| 721 | assertNoMatch: "node maxstay=\"7 h\"";
|
---|
| 722 | assertNoMatch: "node maxstay=\"7 hr\"";
|
---|
| 723 | assertNoMatch: "node maxstay=unlimited";
|
---|
| 724 | assertNoMatch: "node maxstay=load-unload";
|
---|
| 725 | assertNoMatch: "node maxstay=\"66 minutes\"";
|
---|
| 726 | assertNoMatch: "node maxstay=\"2.5 hours\"";
|
---|
[16772] | 727 | }
|
---|
| 728 |
|
---|
| 729 | /* #19536 */
|
---|
| 730 | *[name][name =~ /^([0-9.,]+)$/] {
|
---|
| 731 | throwOther: tr("Numeric name: {0}. Maybe {1} or {2} is meant.", "{0.value}", "ref", "addr:housenumber");
|
---|
| 732 | assertMatch: "node name=12";
|
---|
| 733 | assertMatch: "node name=3.5";
|
---|
| 734 | assertNoMatch: "node name=\"1. Chemnitzer Billardclub 1952 e.V.\"";
|
---|
[18384] | 735 | }
|
---|