| | 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 | |
| 233 | | *[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, |
| 234 | | *[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, |
| 235 | | *[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, |
| 236 | | *[width ][width !~ /^(([0-9]+(\.[0-9]+)?( (m|ft))?)|([0-9]+\'([0-9]+(\.[0-9]+)?\")?))$/]!.width_separator_autofix!.width_meter_autofix!.width_foot_autofix, |
| 237 | | *[maxwidth ][maxwidth !~ /^(([0-9]+(\.[0-9]+)?( (m|ft))?)|([0-9]+\'([0-9]+(\.[0-9]+)?\")?))$/]!.maxwidth_separator_autofix!.maxwidth_meter_autofix!.maxwidth_foot_autofix { |
| | 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]+)?)\")?))$/]!.building_roof_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 { |