Changes between Version 10 and Version 11 of Rules/PublicTransportGtfs


Ignore:
Timestamp:
2020-07-24T20:22:17+02:00 (6 years ago)
Author:
skyper
Comment:

fixes of assert and typos

Legend:

Unmodified
Added
Removed
Modified
  • Rules/PublicTransportGtfs

    v10 v11  
    7878  group: tr("Public Transport: missing tag");
    7979  assertMatch:   "node public_transport=stop_position";
    80   assertNoMatch: "node public_transport=stop_position local_ref=2";
    8180  assertMatch:   "way public_transport=platform";
    82   assertNoMatch: "way public_transport=platform network=blabla";
     81  assertNoMatch: "node public_transport=stop_position network=a local_ref=2";
    8382}
    8483
     
    119118  assertMatch:   "relation type=route route=train";
    120119  assertMatch:   "relation type=route_master route_master=bus";
    121   assertNoMatch: "relation type=route route=train network:short=MVV";
    122   assertNoMatch: "relation type=route_master route_master=bus colour=green";
     120/* Does not make sense with that many keys above */
     121/*  assertNoMatch: "relation type=route route=train network:short=MVV";
     122  assertNoMatch: "relation type=route_master route_master=bus colour=green"; */
    123123}
    124124
     
    164164/* {0.tag} and {1.tag} without {2.key} (warning level) */
    165165/* platform */
    166 *[public_transport=platform][highway=bus_stop][bus!=yes][share_taxi!=yes][trolleybus=yes] {
     166*[public_transport=platform][highway=bus_stop][bus!=yes][share_taxi!=yes][trolleybus!=yes] {
    167167  throwWarning: tr("`{0}` with `{1}` but none of `{2}*`, `{3}*` or `{4}*`.", "{0.tag}", "{1.tag}", "{2.tag}", "{3.tag}", "{4.tag}");
    168168  group: tr("Public Transport GTFS: missing tag");
    169   assertMatch: "node public_transport=platrom highway=bus_stop";
    170   assertNoMatch: "node public_transport=platrom highway=bus_stop bus=yes";
     169  assertMatch: "node public_transport=platform highway=bus_stop";
     170  assertNoMatch: "node public_transport=platform highway=bus_stop bus=yes";
    171171}
    172172
     
    178178*[gtfs:shape_id][gtfs:shape_id             !~                           /^[0-9]{1,2}-[1-9][0-9]{0,2}(-[A-Z])?-j[1-9][0-9j]-[1-9][0-9]?\.[1-9][0-9]?\.[HR]$/],
    179179*[gtfs:trip_id][gtfs:trip_id               !~ /^[1-9][0-9]{0,3}\.T[023A]\.[0-9]{1,2}-[1-9][0-9]{0,2}(-[A-Z])?-j[1-9][0-9j]-[1-9][0-9]?\.[1-9][0-9]?\.[HR]$/],
    180 *[gtfs:trip_id:sample][gtfs:trip_id:sample !~ /^[1-9][0-9]{0,3}\.T[023A]\.[0-9]{1,2}-[1-9][0-9]{0,2}(-[A-Z])?-j[1-9][0-9j]-[1-9][0-9]?\.[1-9][0-9]?\.[HR]$/],
    181 *[gtfs:feed][gtfs:feed         !~ /^(([A-Z]{2}-){2}[a-zA-Z]{2}.*|DE-SPNV|DE-S-und-U-Bahnen|DK-Alle)$/],
    182 *[network:guid][network:guid   !~  /^([A-Z]{2}-){2}[a-zA-Z]{2}.*$/],
    183 *[operator:guid][operator:guid !~  /^([A-Z]{2}-){2}[a-zA-Z]{2}.*$/],
    184 *[gtfs:source_date][gtfs:source_date !~ /^20(1[7-9]|20)-(0[1-9]|1[0-2])-(3[01]|[12][0-9]|0[1-9])$/],
    185 *[ref:IFOPT][ref:IFOPT       !~ /^[a-z]{2}:[0-9]{5}:[1-9][0-9]{0,4}(:[0-9]{1,2}(:[1-9][0-9]?)?)?$/],
    186 *[gtfs:stop_id][gtfs:stop_id !~ /^[a-z]{2}:[0-9]{4,5}:[1-9][0-9]{0,4}(:[0-9]{1,2}(:[1-9][0-9]?)?)?$/] {
     180*[gtfs:trip_id:sample][gtfs:trip_id:sample !~ /^[1-9][0-9]{0,3}\.T[023A]\.[0-9]{1,2}-[1-9][0-9]{0,2}(-[A-Z])?-j[1-9][0-9j]-[1-9][0-9]?\.[1-9][0-9]?\.[HR]$/] {
    187181  throwError: tr("Value `{0}` for `{1}=*` does not match value syntax.", "{0.value}", "{0.key}");
    188182/*  throwError: tr("Value `{0}` for `{1}=*` does not match value syntax `{2}`.", "{0.value}", "{0.key}", "{1.value}"); */
    189183  group: tr("Public Transport GTFS: value syntax");
     184  set GtfsIdSyntax;
    190185  assertMatch:   "relation gtfs:route_id=7-342-j1j-1.H";
    191186  assertNoMatch: "relation gtfs:route_id=7-342-j1j-1";
     
    199194  assertNoMatch: "relation gtfs:trip_id=29.T0.7-342-j1j-1.50.H";
    200195  assertNoMatch: "relation gtfs:trip_id=2.TA.90-742-B-j20-1.4.R";
     196}
     197/* FIXME: Get proper syntax as regex displayed.
     198/* ref:IFOPT, gtfs:stop_id, gtfs:feed, *:guid, gtfs:source_date */
     199*[gtfs:feed][gtfs:feed         !~ /^(([A-Z]{2}-){2}[a-zA-Z]{2}.*|DE-SPNV|DE-S-und-U-Bahnen|DK-Alle)$/],
     200*[network:guid][network:guid   !~  /^([A-Z]{2}-){2}[a-zA-Z]{2}.*$/],
     201*[operator:guid][operator:guid !~  /^([A-Z]{2}-){2}[a-zA-Z]{2}.*$/],
     202*[gtfs:source_date][gtfs:source_date !~ /^20(1[7-9]|20)-(0[1-9]|1[0-2])-(3[01]|[12][0-9]|0[1-9])$/],
     203*[ref:IFOPT][ref:IFOPT       !~ /^[a-z]{2}:[0-9]{5}:[1-9][0-9]{0,4}(:[0-9]{1,2}(:[1-9][0-9]?)?)?$/],
     204*[gtfs:stop_id][gtfs:stop_id !~ /^[a-z]{2}:[0-9]{4,5}:[1-9][0-9]{0,4}(:[0-9]{1,2}(:[1-9][0-9]?)?)?$/] {
     205  throwError: tr("Value `{0}` for `{1}=*` does not match value syntax.", "{0.value}", "{0.key}");
     206/*  throwError: tr("Value `{0}` for `{1}=*` does not match value syntax `{2}`.", "{0.value}", "{0.key}", "{1.value}"); */
     207  group: tr("Public Transport GTFS: value syntax");
    201208  assertMatch:   "relation gtfs:feed=DE-SH.NAH";
    202   assertNoMatch: "relation gtfs:feed=df-SL-saarVV";
     209  assertMatch:  "relation gtfs:feed=df-SL-saarVV";
    203210  assertNoMatch: "relation gtfs:feed=DE-SH-NAH.SH";
    204211  assertNoMatch: "relation gtfs:feed=DE-BY-VVM-Mittelschwaben";
     
    225232throwError: tr("`{1}` and `{0}` are not equal.", "{0.tag}", "{1.tag}");
    226233  group: tr("Public Transport GTFS: conflicting tags");
    227 }
    228 *[gtfs:shape_id][gtfs:trip_id][!(tag("gtfs:shape_id") == get(regexp_match("^[1-9][0-9]{0,3}\\.T[023A]\\.(.+)$", tag("gtfs:trip_id")), 1))],
    229 *[gtfs:shape_id][gtfs:trip_id:sample][!(tag("gtfs:shape_id") == get(regexp_match("^[1-9][0-9]{0,3}\\.T[023A]\\.(.+)$", tag("gtfs:trip_id:sample")), 1))],
    230 *[gtfs:route_id][gtfs:shape_id][!(tag("gtfs:route_id") == get(regexp_match("^(.+)\\.[1-9][0-9]?\\.[HR]$", tag("gtfs:shape_id"), "d"), 1))],
    231 *[gtfs:route_id][gtfs:trip_id][!(tag("gtfs:route_id") == get(regexp_match("^[1-9][0-9]{0,3}\\.T[023A]\\.(.+)\\.[1-9][0-9]?\\.[HR]$", tag("gtfs:trip_id")), 1))],
    232 *[gtfs:route_id][gtfs:trip_id:sample][!(tag("gtfs:route_id") == get(regexp_match("^[1-9][0-9]{0,3}\\.T[023A]\\.(.+)\\.[1-9][0-9]?\\.[HR]$", tag("gtfs:trip_id:sample")), 1))] {
     234  assertMatch:   "relation gtfs:trip_id:sample=1108.T5.11-4-I-j20-1.10.H gtfs:trip_id=1108.T2.11-4-I-j20-1.10.H";
     235  assertNoMatch: "relation gtfs:trip_id:sample=1108.T2.11-4-I-j20-1.10.H gtfs:trip_id=1108.T2.11-4-I-j20-1.10.H";
     236}
     237*[gtfs:shape_id][gtfs:trip_id       ]!.GtfsIdSyntax[!(tag("gtfs:shape_id") == get(regexp_match("^[1-9][0-9]{0,3}\\.T[023A]\\.(.+)$", tag("gtfs:trip_id")), 1))],
     238*[gtfs:shape_id][gtfs:trip_id:sample]!.GtfsIdSyntax[!(tag("gtfs:shape_id") == get(regexp_match("^[1-9][0-9]{0,3}\\.T[023A]\\.(.+)$", tag("gtfs:trip_id:sample")), 1))],
     239*[gtfs:route_id][gtfs:shape_id      ]!.GtfsIdSyntax[!(tag("gtfs:route_id") == get(regexp_match("^(.+)\\.[1-9][0-9]?\\.[HR]$", tag("gtfs:shape_id")), 1))],
     240*[gtfs:route_id][gtfs:trip_id       ]!.GtfsIdSyntax[!(tag("gtfs:route_id") == get(regexp_match("^[1-9][0-9]{0,3}\\.T[023A]\\.(.+)\\.[1-9][0-9]?\\.[HR]$", tag("gtfs:trip_id")), 1))],
     241*[gtfs:route_id][gtfs:trip_id:sample]!.GtfsIdSyntax[!(tag("gtfs:route_id") == get(regexp_match("^[1-9][0-9]{0,3}\\.T[023A]\\.(.+)\\.[1-9][0-9]?\\.[HR]$", tag("gtfs:trip_id:sample")), 1))] {
    233242  throwError: tr("`{1}` is not a substring of `{0}`.", "{0.tag}", "{1.tag}");
    234243  group: tr("Public Transport GTFS: conflicting tags");
    235   assertMatch:   "relation gtfs:route_id=7-342-j1j-1 gtfs:shape_id=7-342-j1j-1";
    236244  assertMatch:   "relation gtfs:route_id=7-342-j1j-1 gtfs:shape_id=7-352-j1j-1.17.H";
    237   assertMatch:   "relation gtfs:route_id=7-342-j1j-1 gtfs:shape_id=T7-342-j1j-1.17.H";
    238245  assertNoMatch: "relation gtfs:route_id=7-342-j1j-1 gtfs:shape_id=7-342-j1j-1.17.H";
    239   assertMatch:  "relation gtfs:route_id=11-4-I-j20-1 gtfs:trip_id=1108.T2.11-4-I-j20-1.10.";
     246  assertNoMatch: "relation gtfs:route_id=7-342-j1j-1 gtfs:shape_id=7-342-j-1.17.H";
    240247  assertMatch:   "relation gtfs:route_id=11-4-I-j20-1 gtfs:trip_id=1108.T2.11-5-I-j20-1.10.H";
    241   assertMatch:  "relation gtfs:route_id=11-4-I-j20-1 gtfs:trip_id=1108.TB2.11-5-I-j20-1.10.H";
     248  assertNoMatch: "relation gtfs:route_id=11-4-I-j20-1 gtfs:trip_id=1108.TB2.11-5-I-j20-1.10.H";
    242249  assertNoMatch: "relation gtfs:route_id=11-4-I-j20-1 gtfs:trip_id=1108.T2.11-4-I-j20-1.10.H";
    243250}
     
    264271  group: tr("Public Transport GTFS: conflicting tags");
    265272}
     273
    266274}}}