Changeset 18731 in josm for trunk


Ignore:
Timestamp:
2023-05-16T23:30:39+02:00 (11 months ago)
Author:
taylor.smock
Message:

Fix #21286: Add validator rule for min_height < height (patch by skyper, modified)

This additionally fixes an error introduced in r18730.

Location:
trunk/resources/data
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/resources/data/defaultpresets.xml

    r18730 r18731  
    60116011            <optional>
    60126012                <combo key="avalanche_protection" values="snow_bridge,dam,berm,mound,shed,gas_ignition" />
    6013                 <check key="barrier" value="fence" />
     6013                <check key="barrier" value_on="fence" />
    60146014            </optional>
    60156015        </item> <!-- Avalanche Protection -->
  • trunk/resources/data/validator/combinations.mapcss

    r18674 r18731  
    4848way[canal                      ][!waterway],
    4949way[have_riverbank             ][!waterway],
     50area[min_height                ][!height][/^(building|building:part)$/], /* #21286 */
     51area[building:min_level        ][!building:levels][/^(building|building:part)$/], /* #21286 */
    5052*[border_type                  ][!boundary],
    5153*[piste:difficulty             ][!piste:type],
     
    10771079  group: tr("suspicious tag combination");
    10781080}
     1081
     1082/* #21286 */
     1083area[/^(building|building:part)$/][height =~ /^[0-9]+(\.[0-9]+)?( m)?$/][min_height =~ /^[0-9]+(\.[0-9]+)?( m)?$/][get(split(" ", tag(height)), 0) <= get(split(" ", tag(min_height)), 0)],
     1084area[/^(building|building:part)$/][building:levels][building:min_level][tag("building:levels") <= tag("building:min_level")] {
     1085  throwWarning: tr("{0} is lower or equal to {1} on {2}", "{1.key}", "{2.key}", "{0.key}");
     1086  group: tr("suspicious tag combination");
     1087}
     1088
  • trunk/resources/data/validator/ignoretags.cfg

    r18730 r18731  
    769769K:historic=bomb_crater
    770770; May be duplicate of older tagging, `hiking=yes` + `bicycle=yes` versus `guidepost=hiking;bicycle`
    771 K:guidepost
     771E:guidepost
    772772K:indoor=area
    773773K:indoor=corridor
  • trunk/resources/data/validator/numeric.mapcss

    r18535 r18731  
    298298  assertNoMatch: "node width=10'5\"";
    299299  assertNoMatch: "node width=10'";
     300}
     301
     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";
    300328}
    301329
Note: See TracChangeset for help on using the changeset viewer.