Changeset 18385 in josm


Ignore:
Timestamp:
2022-03-04T21:46:05+01:00 (3 years ago)
Author:
stoecker
Message:

fix #21866 - railway gauge improvements - patch by gaben

Location:
trunk/resources/data
Files:
2 edited

Legend:

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

    r18369 r18385  
    9696    <chunk id="railway_service_gauge_electrified_yesno">
    9797        <reference ref="railway_service" />
    98         <combo key="tracks" text="Tracks" text_context="railway" values="1,2,3,4" length="4" />
    99         <combo key="gauge" text="Gauge (mm)" values="1668,1676,1674,1600,1524,1520,1495,1435,1067,1000,914,762,760,750" length="4" />
     98        <combo key="gauge" text="Gauge (mm)" values="1676,1668,1638,1600,1588,1581,1524,1520,1495,1458,1450,1435,1372,1219,1067,1000,914,900,891,762,760,750,610,600" length="4" />
    10099        <reference ref="railway_electrified_yesno" />
    101100    </chunk>
     
    23792378            <optional>
    23802379                <combo key="usage" text="Usage" values="main,branch,industrial,military,tourism,freight" />
    2381                 <reference ref="railway_service_gauge_electrified_yesno" />
     2380                <reference ref="railway_service" />
     2381                <combo key="gauge" text="Gauge (mm)" values="1372,1219,1067,1000,914,900,891,762,760,750,610,600" length="4" />
     2382                <reference ref="railway_electrified_yesno" />
    23822383            </optional>
    23832384        </item> <!-- Narrow Gauge Rail -->
  • trunk/resources/data/validator/numeric.mapcss

    r18384 r18385  
    391391}
    392392
    393 way[gauge][gauge !~ /^([1-9][0-9]{1,3}(;[1-9][0-9]{1,3})*|broad|standard|narrow)$/] {
     393way[gauge][gauge      =~ /^(broad|standard|narrow)$/],
     394relation[gauge][gauge =~ /^(broad|standard|narrow)$/] {
     395  throwWarning: tr("imprecise value of {0}", "{0.tag}");
     396  suggestAlternative: tr("an integer value in millimeters, without unit");
     397  set imprecise_gauge;
     398  assertNoMatch: "way gauge=something";
     399  assertNoMatch: "way gauge=1435";
     400  assertNoMatch: "way gauge=1000;1435";
     401  assertNoMatch: "way gauge=2''10'";
     402  assertMatch:   "way gauge=standard";
     403  assertMatch:   "way gauge=narrow";
     404}
     405way[gauge][gauge      !~ /^([1-9][0-9]{1,3}(;[1-9][0-9]{1,3})*)$/]!.imprecise_gauge,
     406relation[gauge][gauge !~ /^([1-9][0-9]{1,3}(;[1-9][0-9]{1,3})*)$/]!.imprecise_gauge {
    394407  throwWarning: tr("unusual value of {0}", "{0.key}");
    395   assertMatch: "way gauge=something";
     408  set unusual_gauge;
     409  assertMatch:   "way gauge=something";
     410  assertMatch:   "way gauge=2''10'";
    396411  assertNoMatch: "way gauge=1435";
    397412  assertNoMatch: "way gauge=1000;1435";
    398413  assertNoMatch: "way gauge=standard";
    399414  assertNoMatch: "way gauge=narrow";
     415}
     416/* #21866 - warn on narrow_railway gauge values outside 89..1434 range, including multi values */
     417way[/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,
     418relation[/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]{
     419  group: tr("suspicious tag combination");
     420  throwWarning:  tr("unusual {0} value on narrow gauge railway", "{1.key}");
     421  assertMatch:   "way railway=narrow_gauge gauge=88";
     422  assertNoMatch: "way railway=narrow_gauge gauge=89";
     423  assertNoMatch: "way railway=narrow_gauge gauge=1434";
     424  assertMatch:   "way railway=narrow_gauge gauge=1435";
     425  assertMatch:   "way railway=narrow_gauge gauge=1435;1500";
     426  assertMatch:   "way railway=narrow_gauge gauge=60;600";
     427  assertNoMatch: "way railway=narrow_gauge gauge=2''10'";
     428  assertNoMatch: "way railway=narrow_gauge gauge=something";
     429  assertNoMatch: "way railway=narrow_gauge gauge=narrow";
    400430}
    401431
Note: See TracChangeset for help on using the changeset viewer.