Changes between Version 10 and Version 11 of Rules/PublicTransportGtfs
- Timestamp:
- 2020-07-24T20:22:17+02:00 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Rules/PublicTransportGtfs
v10 v11 78 78 group: tr("Public Transport: missing tag"); 79 79 assertMatch: "node public_transport=stop_position"; 80 assertNoMatch: "node public_transport=stop_position local_ref=2";81 80 assertMatch: "way public_transport=platform"; 82 assertNoMatch: " waypublic_transport=platformnetwork=blabla";81 assertNoMatch: "node public_transport=stop_position network=a local_ref=2"; 83 82 } 84 83 … … 119 118 assertMatch: "relation type=route route=train"; 120 119 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"; */ 123 123 } 124 124 … … 164 164 /* {0.tag} and {1.tag} without {2.key} (warning level) */ 165 165 /* 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] { 167 167 throwWarning: tr("`{0}` with `{1}` but none of `{2}*`, `{3}*` or `{4}*`.", "{0.tag}", "{1.tag}", "{2.tag}", "{3.tag}", "{4.tag}"); 168 168 group: tr("Public Transport GTFS: missing tag"); 169 assertMatch: "node public_transport=plat rom highway=bus_stop";170 assertNoMatch: "node public_transport=plat rom 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"; 171 171 } 172 172 … … 178 178 *[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]$/], 179 179 *[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]$/] { 187 181 throwError: tr("Value `{0}` for `{1}=*` does not match value syntax.", "{0.value}", "{0.key}"); 188 182 /* throwError: tr("Value `{0}` for `{1}=*` does not match value syntax `{2}`.", "{0.value}", "{0.key}", "{1.value}"); */ 189 183 group: tr("Public Transport GTFS: value syntax"); 184 set GtfsIdSyntax; 190 185 assertMatch: "relation gtfs:route_id=7-342-j1j-1.H"; 191 186 assertNoMatch: "relation gtfs:route_id=7-342-j1j-1"; … … 199 194 assertNoMatch: "relation gtfs:trip_id=29.T0.7-342-j1j-1.50.H"; 200 195 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"); 201 208 assertMatch: "relation gtfs:feed=DE-SH.NAH"; 202 assert NoMatch:"relation gtfs:feed=df-SL-saarVV";209 assertMatch: "relation gtfs:feed=df-SL-saarVV"; 203 210 assertNoMatch: "relation gtfs:feed=DE-SH-NAH.SH"; 204 211 assertNoMatch: "relation gtfs:feed=DE-BY-VVM-Mittelschwaben"; … … 225 232 throwError: tr("`{1}` and `{0}` are not equal.", "{0.tag}", "{1.tag}"); 226 233 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))] { 233 242 throwError: tr("`{1}` is not a substring of `{0}`.", "{0.tag}", "{1.tag}"); 234 243 group: tr("Public Transport GTFS: conflicting tags"); 235 assertMatch: "relation gtfs:route_id=7-342-j1j-1 gtfs:shape_id=7-342-j1j-1";236 244 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";238 245 assertNoMatch: "relation gtfs:route_id=7-342-j1j-1 gtfs:shape_id=7-342-j1j-1.17.H"; 239 assert Match:"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"; 240 247 assertMatch: "relation gtfs:route_id=11-4-I-j20-1 gtfs:trip_id=1108.T2.11-5-I-j20-1.10.H"; 241 assert Match:"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"; 242 249 assertNoMatch: "relation gtfs:route_id=11-4-I-j20-1 gtfs:trip_id=1108.T2.11-4-I-j20-1.10.H"; 243 250 } … … 264 271 group: tr("Public Transport GTFS: conflicting tags"); 265 272 } 273 266 274 }}}
