Changes between Version 23 and Version 24 of Rules/PublicTransportGtfs


Ignore:
Timestamp:
2020-08-14T14:19:22+02:00 (6 years ago)
Author:
skyper
Comment:

warn about missing feed info and relative PTNA GTFS urls.

Legend:

Unmodified
Added
Removed
Modified
  • Rules/PublicTransportGtfs

    v23 v24  
    6565  set PtRouteMaster;
    6666}
    67 /* Not only relations as ferry can be a way */
    68 *[type=route              ][route        =~ /^(bus|coach|share_taxi|trolleybus|train|light_rail|subway|tram|monorail|funicular|ferry|aerialway|school_bus|walking_bus)$/] {
     67/* Note: Only relations, routes on way are not supported */
     68relation[type=route              ][route        =~ /^(bus|coach|share_taxi|trolleybus|train|light_rail|subway|tram|monorail|funicular|ferry|aerialway|school_bus|walking_bus)$/] {
    6969  set PtRoute;
    7070}
     
    7878}
    7979
     80*[public_transport =~ /^(platform|stop_area|stop_position)$/] {
     81  set PtStop;
     82}
     83
    8084/*  -----------------------
    8185 *
     
    9094/* {0.tag} without {1.key} (error level) */
    9195
    92 /* route_master and route relations, ToDo ferry on ways */
     96/* route_master and route relations */
    9397
    9498/* {0.tag} without {1.key} (warning level) */
    9599
    96 /* stop_position, platform */
     100/* stop_area, stop_position, platform */
    97101*[public_transport =~ /^(platform|stop_position)$/][public_transport][!local_ref],
    98 *[public_transport =~ /^(platform|stop_position)$/][public_transport][!network] {
     102*.PtStop[public_transport][!network] {
    99103  throwWarning: tr("`{0}` without `{1}*`.", "{1.tag}", "{2.tag}");
    100104  group: tr("Public Transport GTFS: missing tag");
     
    104108}
    105109
    106 /* stop_area */
    107 
    108 /* route_master and route relations, ToDo ferry on ways */
     110/* route_master and route relations */
    109111relation.PtRouteMaster[type=route_master][!colour],
    110112relation.PtRouteMaster[type=route_master][!fee],
     
    142144/* {0.tag} without {1.key} (info level) */
    143145
    144 /* route_master and route relations, ToDo ferry on ways */
     146/* route_master and route relations */
    145147relation.PtRouteMaster[type=route_master][!network:short],
    146148relation.PtRouteMaster[type=route_master][!operator:short],
     
    155157/* {0.tag} without {1.key} or {2.key} (warning level) */
    156158
    157 /* stop_position, platform */
    158 *[public_transport =~ /^(platform|stop_area|stop_position)$/][!ref:IFOPT][!gtfs:stop_id][public_transport] {
     159/* stop_are, stop_position, platform */
     160*.PtStop[!ref:IFOPT][!gtfs:stop_id][public_transport] {
    159161  throwWarning: tr("`{0}` without `{1}*` or `{2}*`.", "{3.tag}", "{1.tag}", "{2.tag}");
    160162  group: tr("Public Transport GTFS: missing tag");
     
    163165}
    164166
    165 /* {0.tag} without {1.key}, {2.key} or {3.key} (warning level) */
    166 
    167 /* stop_position, platform */
    168 
    169 /* stop_area */
    170 
    171 /* route_master and route relations, ToDo ferry on ways */
     167/* {0.key} without {1.key}, {2.key} or {3.key} (warning level) */
     168
     169/* stop_are, stop_position, platform */
     170*.PtStop[ref:IFOPT   ][!gtfs:feed][!network:guid][!operator:guid],
     171*.PtStop[gtfs:stop_id][!gtfs:feed][!network:guid][!operator:guid] {
     172  throwWarning: tr("Public transport stop with `{0}=*` but none of `{1}*`, `{2}*` or `{3}*`.", "{1.key}", "{2.tag}", "{3.tag}", "{4.tag}");
     173  group: tr("Public Transport GTFS: missing tag");
     174  assertMatch:   "node public_transport=stop_position ref:IFOPT=A";
     175  assertNoMatch: "node public_transport=stop_position ref:IFOPT=A gtfs:feed=A";
     176}
     177
     178/* route_master and route relations */
    172179relation["public_transport:version"=2].PtRoute[!gtfs:shape_id][!gtfs:trip_id][!gtfs:trip_id:sample],
    173180relation[gtfs:route_id].PtRouteMaster[!gtfs:feed][!network:guid][!operator:guid],
     
    179186  group: tr("Public Transport GTFS: missing tag");
    180187  assertMatch:   "relation type=route_master route_master=train gtfs:route_id=0-7-242-19j-1";
     188  assertNoMatch: "relation type=route_master route_master=train gtfs:route_id=0-7-242-19j-1 network:guid=DE-BY-MVV";
    181189  assertMatch:   "relation type=route route=bus gtfs:shape_id=0-7-242-19j-1.26.R";
    182   assertNoMatch: "relation type=route_master route_master=train gtfs:route_id=0-7-242-19j-1 network:guid=DE-BY-MVV";
    183   assertNoMatch: "relation type=route_master route=bus colour=green";
     190  assertNoMatch: "relation type=route_master route=bus";
    184191}
    185192
     
    360367relation.PtRoute[network      ][!network:short][network =~ /^[A-Z0-9]+$/] {
    361368  throwWarning: tr(" `{0}` looks like an abbreviation", "{1.tag}");
    362   group: tr("Public Transport GTFS: value syntax");
     369  group: tr("Public Transport GTFS: abbreviation as value");
    363370  suggestAlternative: "`network:short=*` and a longer form for `network=*`";
    364371  fixChangeKey: "network=>network:short";
     
    373380relation.PtRoute[operator      ][!operator:short][operator =~ /^[A-Z0-9]+$/] {
    374381  throwWarning: tr(" `{0}` looks like an abbreviation", "{1.tag}");
    375   group: tr("Public Transport GTFS: value syntax");
     382  group: tr("Public Transport GTFS: abbreviation as value");
    376383  suggestAlternative: "`operator:short=*` and a longer form for `operator=*`";
    377384  fixChangeKey: "operator=>operator:short";
     
    379386  assertNoMatch: "relation public_transport=stop_area operator=AA0AA operator:short=A";
    380387  assertNoMatch: "relation public_transport=stop_area operator=Anna";
     388}
     389
     390/* Permanet links to PTNA GTFS */
     391/* *[JOSM_search("ptna.openstreetmap.de/gtfs")][!JOSM_search("^.*network=([a-zA-Z]+[-]){2,}\\d{4}(-\\d\\d){2}.*$")] { */
     392*[url     =~ /^.*ptna\.openstreetmap\.de\/gtfs.+$/][url     !~ /^.*network=([a-zA-Z]+[-]){2,}\d{4}(-\d\d){2}.*$/],
     393*[website =~ /^.*ptna\.openstreetmap\.de\/gtfs.+$/][website !~ /^.*network=([a-zA-Z]+[-]){2,}\d{4}(-\d\d){2}.*$/],
     394*[source  =~ /^.*ptna\.openstreetmap\.de\/gtfs.+$/][source  !~ /^.*network=([a-zA-Z]+[-]){2,}\d{4}(-\d\d){2}.*$/] {
     395  throwWarning: tr("Relative GTFS url in `{0}=*`. Add the `source_date` behind the network value with a minus `-` as separator.", "{0.key}");
     396  assertMatch:   "node source=\"https://ptna.openstreetmap.de/gtfs/19\"";
     397  assertNoMatch: "node source=\"https://ptna.openstreetmap.de/gtfs/DE/trips.php?network=DE-BW-VAG-2020-07-28&route_id=10-10-I-j20-1\"";
    381398}
    382399