Changes between Version 22 and Version 23 of Rules/PublicTransportGtfs


Ignore:
Timestamp:
2020-08-13T02:16:42+02:00 (6 years ago)
Author:
skyper
Comment:

Warn about abbreviations of network and operator; Only warn about missing gtfs:source_date with GTFS-tags

Legend:

Unmodified
Added
Removed
Modified
  • Rules/PublicTransportGtfs

    v22 v23  
    111111relation.PtRouteMaster[type=route_master][!gtfs:name],
    112112relation.PtRouteMaster[type=route_master][!gtfs:route_id],
    113 relation.PtRouteMaster[type=route_master][!gtfs:source_date],
    114113relation.PtRouteMaster[type=route_master][!network],
    115114relation.PtRouteMaster[type=route_master][!operator],
     
    125124relation.PtRoute[type=route][!gtfs:name]["public_transport:version"=1],
    126125relation.PtRoute[type=route][!gtfs:route_id],
    127 relation.PtRoute[type=route][!gtfs:source_date],
    128126relation.PtRoute[type=route][!network],
    129127relation.PtRoute[type=route][!opening_hours],
     
    219217}
    220218
     219/* One of many {0.key} but no {1.key} */
     220
     221/* gtfs:source_date */
     222*[/(^gtfs:|:gtfs|^ref:IFOPT)/][!gtfs:source_date] {
     223  throwWarning: tr("GTFS tag without `{0}*`.", "{1.tag}");
     224  group: tr("Public Transport GTFS: missing tag");
     225  assertMatch:   "node gtfs:route_id=1";
     226  assertMatch:   "node note:gtfs=A";
     227  assertMatch:   "node ref:IFOPT=1";
     228  assertNoMatch: "node ref:IFOPT=1 gtfs:source_date=2019";
     229}
    221230
    222231/*  -----------------------
     
    344353}
    345354
     355/* abbreviatons */
     356
     357/* network */
     358*[public_transport   ][network][!network:short][network =~ /^[A-Z0-9]+$/],
     359relation.PtRouteMaster[network][!network:short][network =~ /^[A-Z0-9]+$/],
     360relation.PtRoute[network      ][!network:short][network =~ /^[A-Z0-9]+$/] {
     361  throwWarning: tr(" `{0}` looks like an abbreviation", "{1.tag}");
     362  group: tr("Public Transport GTFS: value syntax");
     363  suggestAlternative: "`network:short=*` and a longer form for `network=*`";
     364  fixChangeKey: "network=>network:short";
     365  assertMatch:   "relation public_transport=stop_area network=AA0AA";
     366  assertNoMatch: "relation public_transport=stop_area network=AA0AA network:short=A";
     367  assertNoMatch: "relation public_transport=stop_area network=Anna";
     368}
     369
     370/* operator */
     371*[public_transport   ][operator][!operator:short][operator =~ /^[A-Z0-9]+$/],
     372relation.PtRouteMaster[operator][!operator:short][operator =~ /^[A-Z0-9]+$/],
     373relation.PtRoute[operator      ][!operator:short][operator =~ /^[A-Z0-9]+$/] {
     374  throwWarning: tr(" `{0}` looks like an abbreviation", "{1.tag}");
     375  group: tr("Public Transport GTFS: value syntax");
     376  suggestAlternative: "`operator:short=*` and a longer form for `operator=*`";
     377  fixChangeKey: "operator=>operator:short";
     378  assertMatch:   "relation public_transport=stop_area operator=AA0AA";
     379  assertNoMatch: "relation public_transport=stop_area operator=AA0AA operator:short=A";
     380  assertNoMatch: "relation public_transport=stop_area operator=Anna";
     381}
     382
    346383/*  -----------------------
    347384 *  conflicting tags