| 75 | | *[public_transport][public_transport =~ /^(platform|stop_position)$/][!local_ref], |
| 76 | | *[public_transport][public_transport =~ /^(platform|stop_position)$/][!network] { |
| 77 | | throwWarning: tr("`{0}` without `{1}*`.", "{0.tag}", "{2.tag}"); |
| 78 | | group: tr("Public Transport: missing tag"); |
| | 86 | *[public_transport =~ /^(platform|stop_position)$/][public_transport][!local_ref], |
| | 87 | *[public_transport =~ /^(platform|stop_position)$/][public_transport][!network] { |
| | 88 | throwWarning: tr("`{0}` without `{1}*`.", "{1.tag}", "{2.tag}"); |
| | 89 | group: tr("Public Transport GTFS: missing tag"); |
| 140 | | relation.PtRouteMaster[gtfs:route_id][!gtfs:feed][!network:guid][!operator:guid], |
| 141 | | relation.PtRoute["public_transport:version"=2][!gtfs:shape_id][!gtfs:trip_id][!gtfs:trip_id:sample], |
| 142 | | relation.PtRoute[gtfs:route_id][!gtfs:feed][!network:guid][!operator:guid], |
| 143 | | relation.PtRoute[gtfs:shape_id][!gtfs:feed][!network:guid][!operator:guid], |
| 144 | | relation.PtRoute[gtfs:trip_id][!gtfs:feed][!network:guid][!operator:guid], |
| 145 | | relation.PtRoute[gtfs:trip_id:sample][!gtfs:feed][!network:guid][!operator:guid] { |
| 146 | | throwWarning: tr("Public transport relation with `{0}` but none of `{1}*`, `{2}*` or `{3}*`.", "{1.tag}", "{2.tag}", "{3.tag}", "{4.tag}"); |
| 147 | | group: tr("Public Transport: missing tag"); |
| | 154 | relation[gtfs:route_id][!gtfs:feed][!network:guid][!operator:guid].PtRouteMaster, |
| | 155 | relation["public_transport:version"=2][!gtfs:shape_id][!gtfs:trip_id][!gtfs:trip_id:sample].PtRoute, |
| | 156 | relation[gtfs:route_id][!gtfs:feed][!network:guid][!operator:guid].PtRoute, |
| | 157 | relation[gtfs:shape_id][!gtfs:feed][!network:guid][!operator:guid].PtRoute, |
| | 158 | relation[gtfs:trip_id][!gtfs:feed][!network:guid][!operator:guid].PtRoute, |
| | 159 | relation[gtfs:trip_id:sample][!gtfs:feed][!network:guid][!operator:guid].PtRoute { |
| | 160 | throwWarning: tr("Public transport relation with `{0}` but none of `{1}*`, `{2}*` or `{3}*`.", "{0.tag}", "{1.tag}", "{2.tag}", "{3.tag}"); |
| | 161 | group: tr("Public Transport GTFS: missing tag"); |
| 156 | | node[public_transport][public_transport=stop_position][train=yes][railway!=stop], |
| 157 | | *[public_transport][public_transport =~ /^(platform|stop_position)$/][train=yes][!ref] { |
| 158 | | throwWarning: tr("`{0}` with `{1}` but without `{2}`.", "{0.tag}", "{2.tag}", "{3.tag}"); |
| 159 | | group: tr("Public Transport: missing tag"); |
| | 171 | node[public_transport=stop_position][train=yes][railway!=stop][public_transport], |
| | 172 | *[public_transport =~ /^(platform|stop_position)$/][train=yes][!ref][public_transport] { |
| | 173 | throwWarning: tr("`{0}` with `{1}` but without `{2}`.", "{3.tag}", "{1.tag}", "{2.tag}"); |
| | 174 | group: tr("Public Transport GTFS: missing tag"); |
| 173 | | /* value syntax */ |
| 174 | | |
| 175 | | /* FIXME: Get proper syntax as regex displayed. |
| 176 | | /* ref:IFOPT, gtfs:stop_id, route/shape/trip_id */ |
| 177 | | *[gtfs:route_id][gtfs:route_id !~ /^[0-9]{1,2}-[1-9][0-9]{0,2}(-[A-Z])?-j[1-9][0-9j]-[1-9][0-9]?$/], |
| 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 | | *[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]$/] { |
| | 189 | |
| | 190 | /* ----------------------- |
| | 191 | * value syntax |
| | 192 | */ |
| | 193 | |
| | 194 | /* ref:IFOPT, gtfs:stop_id, route_id, shape_id, trip_id */ |
| | 195 | /* FIXME: Get proper syntax as regex displayed. */ |
| | 196 | *[gtfs:route_id ][gtfs:route_id !~ /^[0-9]{1,2}-[1-9][0-9]{0,2}(-[A-Z])?-j[1-9][0-9j]-[1-9][0-9]?(;[ ]?[0-9]{1,2}-[1-9][0-9]{0,2}(-[A-Z])?-j[1-9][0-9j]-[1-9][0-9]?)*$/], |
| | 197 | *[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](;[ ]?[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])*$/], |
| | 198 | *[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](;[ ]?[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])*$/], |
| | 199 | *[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](;[ ]?[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])*$/] { |
| 226 | | /* ---------------- |
| | 246 | /* route_id, shape_id, trip_id */ |
| | 247 | *[gtfs:route_id ][count(split(";", tag("gtfs:route_id"))) > 1], |
| | 248 | *[gtfs:shape_id ][count(split(";", tag("gtfs:shape_id"))) > 1], |
| | 249 | *[gtfs:trip_id ][count(split(";", tag("gtfs:trip_id"))) > 1], |
| | 250 | *[gtfs:trip_id:sample][count(split(";", tag("gtfs:trip_id:sample"))) > 1] { |
| | 251 | throwOther: tr("Multiple values `{0}` for `{1}=*`.", "{0.value}", "{0.key}"); |
| | 252 | group: tr("Public Transport GTFS: value syntax"); |
| | 253 | set MultipleID; |
| | 254 | assertMatch: "relation gtfs:route_id=7-342-j1j-1;7-342-j1j-5"; |
| | 255 | assertNoMatch: "relation gtfs:route_id=7-342-j1j-1.H"; |
| | 256 | } |
| | 257 | |
| | 258 | |
| | 259 | /* ----------------------- |
| 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))] { |
| | 271 | *[gtfs:route_id]!.MultipleID!.GtfsIdSyntax[gtfs:shape_id ][!(tag("gtfs:route_id") == get(regexp_match("^(.+)\\.[1-9][0-9]?\\.[HR]$", tag("gtfs:shape_id")), 1))], |
| | 272 | *[gtfs:route_id]!.MultipleID!.GtfsIdSyntax[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))], |
| | 273 | *[gtfs:route_id]!.MultipleID!.GtfsIdSyntax[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")), 3))], |
| | 274 | *[gtfs:shape_id]!.MultipleID!.GtfsIdSyntax[gtfs:trip_id ][!(tag("gtfs:shape_id") == get(regexp_match("^[1-9][0-9]{0,3}\\.T[023A]\\.(.+)$", tag("gtfs:trip_id")), 1))], |
| | 275 | *[gtfs:shape_id]!.MultipleID!.GtfsIdSyntax[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))] { |
| 265 | | relation.ChildMasterRoute_id[gtfs:shape_id][parent_tag("gtfs:route_id")][!gtfs:route_id][!(parent_tag("gtfs:route_id") == replace(tag("gtfs:shape_id"), "\\.\\d+\\.[HR]$", ""))], |
| 266 | | relation.ChildMasterRoute_id[gtfs:trip_id][parent_tag("gtfs:route_id")][!gtfs:route_id][!gtfs:shape_id][!(parent_tag("gtfs:route_id") == get(regexp_match("^\\d+\\.T[023A]\\.(.+)\\.\\d+\\.[HR]$", tag("gtfs:trip_id")), 1))], |
| 267 | | relation.ChildMasterRoute_id[gtfs:trip_id:sample][parent_tag("gtfs:route_id")][!gtfs:route_id][!gtfs:shape_id][!(parent_tag("gtfs:route_id") == get(regexp_match("^\\d+\\.T[023A]\\.(.+)\\.\\d+\\.[HR]$", tag("gtfs:trip_id:sample")), 1))], |
| 268 | | relation.ChildMasterRoute_id[gtfs:route_id][parent_tag("gtfs:route_id")][!(parent_tag("gtfs:route_id") == tag("gtfs:route_id"))] { |
| 269 | | throwWarning: tr("`{0}` conflicts with `gtfs:route_id=*` of the `route_master` relation.", "{1.tag}"); |
| 270 | | /* throwWarning: tr("`{0}` differs to `route_id={1}` of the `route_master` relation.", "{1.tag}", "{2.value}"); */ |
| | 288 | relation[gtfs:route_id ][parent_tag("gtfs:route_id")]!.MultipleID[count(split(";", parent_tag("gtfs:route_id"))) == 1][!(parent_tag("gtfs:route_id") == tag("gtfs:route_id"))].ChildMasterRoute_id, |
| | 289 | relation[gtfs:shape_id ][parent_tag("gtfs:route_id")]!.MultipleID[count(split(";", parent_tag("gtfs:route_id"))) == 1][!gtfs:route_id][!(parent_tag("gtfs:route_id") == get(regexp_match("(.+)\\.\\d+\\.[HR]$", tag("gtfs:shape_id")), 1))].ChildMasterRoute_id, |
| | 290 | relation[gtfs:trip_id ][parent_tag("gtfs:route_id")]!.MultipleID[count(split(";", parent_tag("gtfs:route_id"))) == 1][!gtfs:route_id][!gtfs:shape_id][!(parent_tag("gtfs:route_id") == get(regexp_match("^\\d+\\.T[023A]\\.(.+)\\.\\d+\\.[HR]$", tag("gtfs:trip_id")), 1))].ChildMasterRoute_id, |
| | 291 | relation[gtfs:trip_id:sample][parent_tag("gtfs:route_id")]!.MultipleID[count(split(";", parent_tag("gtfs:route_id"))) == 1][!gtfs:route_id][!gtfs:shape_id][!(parent_tag("gtfs:route_id") == get(regexp_match("^\\d+\\.T[023A]\\.(.+)\\.\\d+\\.[HR]$", tag("gtfs:trip_id:sample")), 1))].ChildMasterRoute_id { |
| | 292 | throwWarning: tr("`{0}` conflicts with `gtfs:route_id=*` of the `route_master` relation.", "{0.tag}"); |
| | 293 | /* throwWarning: tr("`{0}` differs to `route_id={1}` of the `route_master` relation.", "{0.tag}", "{1.value}"); */ |
| | 295 | /* assertMatch: "relation gtfs:shape_id=10-20-I-j20-1.1.R parent_tag(\"type\")=route_master parent_tag(\"gtfs:route_id\")=10-19-I-j20-1"; |
| | 296 | assertNoMatch: "relation gtfs:shape_id=10-19-I-j20-1.1.R parent_tag(\"type\")=route_master parent_tag(\"gtfs:route_id\")=10-19-I-j20-1"; */ |
| | 297 | } |
| | 298 | |
| | 299 | /* ref:IFOPT, gtfs:stop_id, local_ref */ |
| | 300 | *[public_transport][public_transport =~ /^(platform|stop_position)$/][!(tag("local_ref") == get(regexp_match("^(.*:){4}([1-9][0-9]?)", tag("ref:IFOPT")), 2))][local_ref][ref:IFOPT] { |
| | 301 | throwWarning: tr("`{0}` conflicts with `{1}`.", "{3.tag}", "{4.tag}"); |
| | 302 | group: tr("Public Transport GTFS: conflicting tags"); |
| | 303 | assertMatch: "relation public_transport=platform local_ref=14 ref:IFOPT=de:08315:6504:0:1"; |
| | 304 | assertNoMatch: "relation public_transport=platform local_ref=14 ref:IFOPT=de:08315:6504:0:14"; |
| | 305 | assertNoMatch: "relation public_transport=platform local_ref=14 ref:IFOPT=de:08315:6504:14"; |
| | 306 | } |
| | 307 | |
| | 308 | |
| | 309 | /* ----------------------- |
| | 310 | * Geometry |
| | 311 | */ |
| | 312 | |
| | 313 | /* stop_position */ |
| | 314 | /* FIXME: How to use assert with :class and evalexpression? */ |
| | 315 | node[public_transport=stop_position]:unconnected:in-downloaded-area, |
| | 316 | node[public_transport=stop_position]:unconnected:new { |
| | 317 | throwError: tr("`{0}` is not part of any way.", "{0.tag}"); |
| | 318 | assertMatch: "node public_transport=stop_position "; |
| | 319 | assertNoMatch: "node public_transport=stop_position :unconnected !:new !:in-downloaded-area"; |
| | 320 | assertNoMatch: "node public_transport=platform :unconnected :new"; |
| | 321 | /* assertMatch: "node public_transport=stop_position :unconnected :in-downloaded-area"; |
| | 322 | * assertMatch: "node public_transport=stop_position :unconnected :new"; |
| | 323 | * assertNoMatch: "node public_transport=stop_position :unconnected !:new !:in-downloaded-area"; |
| | 324 | * assertNoMatch: "node public_transport=platform :unconnected :new"; |
| | 325 | */ |