- Timestamp:
- 2018-01-20T15:42:45+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/validator/numeric.mapcss
r13035 r13343 56 56 57 57 *[height][height !~ /^(([0-9]+\.?[0-9]*( (m|ft))?)|([1-9][0-9]*\'((10|11|[0-9])((\.[0-9]+)?)\")?))$/] { 58 throwWarning: tr(" {0}: meters is default; period is separator; if units, put space then unit", "height");58 throwWarning: tr("unusual value of {0}: meters is default; point is separator; if units, put space then unit", "{0.key}"); 59 59 assertMatch: "node height=medium"; 60 60 assertMatch: "node height=-5"; … … 67 67 68 68 *[maxheight][maxheight !~ /^(([1-9][0-9]*(\.[0-9]+)?( (m|ft))?)|([0-9]+\'(([0-9]|10|11)(\.[0-9]*)?\")?)|none|default)$/] { 69 throwWarning: tr(" {0}: meters is default; period is separator; if units, put space then unit", "maxheight");69 throwWarning: tr("unusual value of {0}: meters is default; point is separator; if units, put space then unit", "{0.key}"); 70 70 assertMatch: "node maxheight=something"; 71 71 assertMatch: "node maxheight=-5"; … … 80 80 81 81 way[width][width !~ /^(([0-9]+\.?[0-9]*( [a-z]+)?)|([0-9]+\'([0-9]+\.?[0-9]*\")?))$/] { 82 throwWarning: tr(" {0}: meters is default; period is separator; if units, put space then unit", "width");82 throwWarning: tr("unusual value of {0}: meters is default; point is separator; if units, put space then unit", "{0.key}"); 83 83 assertMatch: "way width=something"; 84 84 assertMatch: "way width=-5"; … … 92 92 93 93 *[maxwidth][maxwidth !~ /^(([0-9]+\.?[0-9]*( (m|ft))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/] { 94 throwWarning: tr(" {0}: meters is default; period is separator; if units, put space then unit", "maxwidth");94 throwWarning: tr("unusual value of {0}: meters is default; point is separator; if units, put space then unit", "{0.key}"); 95 95 assertMatch: "way maxwidth=something"; 96 96 assertMatch: "way maxwidth=-5"; … … 101 101 } 102 102 *[maxweight][maxweight !~ /^(([0-9]+\.?[0-9]*( (t|kg|lbs))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/] { 103 throwWarning: tr(" {0}: tonne is default; period is separator; if units, put space then unit", "maxweight");103 throwWarning: tr("unusual value of {0}: tonne is default; point is separator; if units, put space then unit", "{0.key}"); 104 104 assertMatch: "way maxweight=something"; 105 105 assertMatch: "way maxweight=-5"; … … 112 112 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))$/], 113 113 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))$/] { 114 throwWarning: tr("unusual {0} format", "maxspeed");114 throwWarning: tr("unusual value of {0}", "{0.key}"); 115 115 assertMatch: "way maxspeed=something"; 116 116 assertMatch: "way maxspeed=-50"; … … 128 128 129 129 *[distance][distance !~ /^(([0-9]+\.?[0-9]*( (m|km|mi|nmi))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/] { 130 throwWarning: tr(" {0}: kilometers is default; period is separator; if units, put space then unit", "distance");130 throwWarning: tr("unusual value of {0}: kilometers is default; point is separator; if units, put space then unit", "{0.key}"); 131 131 assertMatch: "way distance=something"; 132 132 assertMatch: "way distance=-5"; … … 145 145 with the values 'perennial' and 'intermittent'; the vast majority are 0, 16.7, 50 and 60 */ 146 146 way[frequency][frequency !~ /^(0|[1-9][0-9]*(\.[0-9]+)?)( (kHz|MHz|GHz|THz))?$/] { 147 throwWarning: tr("unusual {0} specification", "frequency");147 throwWarning: tr("unusual value of {0}", "{0.key}"); 148 148 assertMatch: "way frequency=something"; 149 149 assertNoMatch: "way frequency=0"; /* DC */ … … 155 155 156 156 way[gauge][gauge !~ /^([1-9][0-9]{1,3}(;[1-9][0-9]{1,3})*|broad|standard|narrow)$/] { 157 throwWarning: tr("unusual train track gauge; use mm with no separator");157 throwWarning: tr("unusual value of {0}", "{0.key}"); 158 158 assertMatch: "way gauge=something"; 159 159 assertNoMatch: "way gauge=1435"; … … 165 165 /* the numbers for percentage and degrees include could probably be bracketed a bit more precisely */ 166 166 way[incline][incline !~ /^(up|down|-?([0-9]+?(\.[1-9]%)?|100)[%°]?)$/] { 167 throwWarning: tr("unusual incline; use percentages/degrees or up/down"); 167 throwWarning: tr("unusual value of {0}", "{0.key}"); 168 suggestAlternative: "x%"; 169 suggestAlternative: "x°"; 170 suggestAlternative: "up"; 171 suggestAlternative: "down"; 168 172 assertMatch: "way incline=extreme"; 169 173 assertNoMatch: "way incline=up"; … … 195 199 } 196 200 *[admin_level][admin_level !~ /^(1|2|3|4|5|6|7|8|9|10|11|12)$/] { 197 throwWarning: tr("unusual value of {0}", "{ 1.key}");201 throwWarning: tr("unusual value of {0}", "{0.key}"); 198 202 assertMatch: "node admin_level=0"; 199 203 assertMatch: "node admin_level=-1"; … … 205 209 *[direction][direction<0], 206 210 *[direction][direction>=360] { 207 throwWarning: tr("unusual value of {0}", "{ 1.key}");211 throwWarning: tr("unusual value of {0}", "{0.key}"); 208 212 assertMatch: "node direction=-10"; 209 213 assertMatch: "node direction=360"; … … 211 215 } 212 216 *[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))?(;([0-9][0-9]?[0-9]?|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW)-([0-9][0-9]?[0-9]?|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW))*$/] { 213 throwWarning: tr("unusual value of {0}", "{ 1.key}");217 throwWarning: tr("unusual value of {0}", "{0.key}"); 214 218 assertMatch: "node direction=north-down"; 215 219 assertMatch: "node direction=rome";
Note:
See TracChangeset
for help on using the changeset viewer.