Skip to content

Original stop ID is returned from the journey planner for the intermediate and alighting stop even after stop consolidation #6032

Open
@miklcct

Description

@miklcct

Expected behavior

The primary stop ID is returned for all purposes.

Observed behavior

The primary stop ID is only used for the "from" location of a leg in the journey planner, while "intermediate" and "to" locations are still the secondary stop IDs.

Version of OTP used (exact commit hash or JAR name)

2.6.0-SNAPSHOT

Data sets in use (links to GTFS and OSM PBF files)

The London DfT GTFS (can be downloaded at Bus Open Data Service) and a custom GTFS file for National Rail services generated using dtd2mysql.

Router config and graph build config JSON

build-config.json

{
	"boardingLocationTags": ["ref", "naptan:AtcoCode", "naptan:NaptanCode"],
	"osmDefaults" : {
		"timeZone" : "Europe/London",
		"osmTagMapping" : "uk"
	},
	"transitFeeds" : [
		{
			"type" : "gtfs",
			"feedId" : "DfT",
			"source" : "gtfs-dft.zip"
		},
		{
			"type" : "gtfs",
			"feedId" : "NR",
			"source" : "national_rail_gtfs.zip"
		}
	],
	"stopConsolidationFile" : "consolidated-stops.csv"
}

Steps to reproduce the problem

  1. Build the graph with 2 GTFS files with stop consolidation
  2. Run OTP
  3. Do journey plan for a journey which is served by lines in both feeds.

Our test server is located at https://test.open-trip-planner.jnction.co.uk/ which is loaded with London transport data. All rail data (National Rail, including Overground and Elizabeth line) comes from a feed called "NR", and the tube data comes from a feed called "DfT". The Lioness Line (National Rail) and Bakerloo (tube) schedules come from two different feeds but in reality they use the same tracks and platforms, therefore I have made a consolidation file for all stations along the route to replace all the DfT tube stop IDs with National Rail stop IDs.

stop_group_id,feed_id,stop_id,is_primary
Queen's Park (Platform 2),NR,9100QPRK2,1
Queen's Park (Platform 2),DfT,9400ZZLUQPS2,0
Queen's Park (Platform 3),NR,9100QPRK3,1
Queen's Park (Platform 3),DfT,9400ZZLUQPS1,0
Queen's Park Station,NR,910GQPRK,1
Queen's Park Station,DfT,940GZZLUQPS,0
Kensal Green (Platform 1),NR,9100KENSLG1,1
Kensal Green (Platform 1),DfT,9400ZZLUKSL1,0
Kensal Green (Platform 2),NR,9100KENSLG2,1
Kensal Green (Platform 2),DfT,9400ZZLUKSL2,0
Kensal Green Station,NR,910GKENSLG,1
Kensal Green Station,DfT,940GZZLUKSL,0
Willesden Junction (Platform 1),NR,9100WLSDNJL1,1
Willesden Junction (Platform 1),DfT,9400ZZLUWJN2,0
Willesden Junction (Platform 3),NR,9100WLSDNJL3,1
Willesden Junction (Platform 3),DfT,9400ZZLUWJN1,0
Willesden Junction Station,NR,910GWLSDJHL,1
Willesden Junction Station,DfT,940GZZLUWJN,0
Harlesden (Platform 1),NR,9100HARLSDN1,1
Harlesden (Platform 1),DfT,9400ZZLUHSN1,0
Harlesden (Platform 2),NR,9100HARLSDN2,1
Harlesden (Platform 2),DfT,9400ZZLUHSN2,0
Harlesden Station,NR,910GHARLSDN,1
Harlesden Station,DfT,940GZZLUHSN,0
Stonebridge Park (Platform 1),NR,9100STNBGPK1,1
Stonebridge Park (Platform 1),DfT,9400ZZLUSGP1,0
Stonebridge Park (Platform 2),NR,9100STNBGPK2,1
Stonebridge Park (Platform 2),DfT,9400ZZLUSGP2,0
Stonebridge Park Station,NR,910GSTNBGPK,1
Stonebridge Park Station,DfT,940GZZLUSGP,0
Wembley Central (Platform 1),NR,9100WMBYDC1,1
Wembley Central (Platform 1),DfT,9400ZZLUWYC2,0
Wembley Central (Platform 2),NR,9100WMBYDC2,1
Wembley Central (Platform 2),DfT,9400ZZLUWYC1,0
Wembley Central Station,NR,910GWMBY,1
Wembley Central Station,DfT,940GZZLUWYC,0
North Wembley (Platform 1),NR,9100NWEMBLY1,1
North Wembley (Platform 1),DfT,9400ZZLUNWY2,0
North Wembley (Platform 2),NR,9100NWEMBLY2,1
North Wembley (Platform 2),DfT,9400ZZLUNWY1,0
North Wembley Station,NR,910GNWEMBLY,1
North Wembley Station,DfT,940GZZLUNWY,0
South Kenton (Platform 1),NR,9100SKENTON1,1
South Kenton (Platform 1),DfT,9400ZZLUSKT2,0
South Kenton (Platform 2),NR,9100SKENTON2,1
South Kenton (Platform 2),DfT,9400ZZLUSKT1,0
South Kenton Station,NR,910GSKENTON,1
South Kenton Station,DfT,940GZZLUSKT,0
Kenton (Platform 1),NR,9100KTON1,1
Kenton (Platform 1),DfT,9400ZZLUKEN2,0
Kenton (Platform 2),NR,9100KTON2,1
Kenton (Platform 2),DfT,9400ZZLUKEN1,0
Kenton Station,NR,910GKTON,1
Kenton Station,DfT,940GZZLUKEN,0
Harrow & Wealdstone (Platform 1),NR,9100HROWDC1,1
Harrow & Wealdstone (Platform 1),DfT,9400ZZLUHAW2,0
Harrow & Wealdstone (Platform 2),NR,9100HROWDC2,1
Harrow & Wealdstone (Platform 2),DfT,9400ZZLUHAW1,0
Harrow & Wealdstone Station,NR,910GHROW,1
Harrow & Wealdstone Station,DfT,940GZZLUHAW,0

The query I issue to the server is:

query GtfsExampleQuery {
  plan(from:{lat: 51.53247, lon: -0.24454}, to:{lat:51.54401,lon:-0.2762003}, numItineraries: 10) {
    itineraries {
      legs {
        route {
          shortName
        }
        headsign
        from {
          name
          stop {
            gtfsId
            name
          }
        }
        intermediatePlaces {
          name
          stop {
            gtfsId
            name
          }
        }
        to {
          name
          stop {
            gtfsId
            name
          }
        }
        nextLegs(numberOfLegs: 3, originModesWithParentStation: [SUBWAY, RAIL], destinationModesWithParentStation: [SUBWAY, RAIL]) {
          route {
          	shortName
        	}
        	headsign
        }
      }
    }
  }
}

Run the above query during the opening hours of the tube and Overground. The resultant journeys have the substituted stop ID only for the from object, but the original for the intermediatePlaces and to objects. The nextLegs also fail to show for the tube journeys, while for the National Rail journeys, both tube and National Rail legs are returned in the nextLegs.

Here are 2 itineraries returned from the result, which show the unexpected difference between the places. As seen below, the tube journey still has all places listed in the original DfT stop IDs, with the exception of the boarding place which has been rewritten to the NR stop ID, and without any nextLegs, while I expect that all IDs to be the same as the Lioness line journey with both Lioness line and Bakerloo shown in nextLegs.

{
    "data": {
        "plan": {
            "itineraries": [
                {
                    "legs": [
                        {
                            "route": null,
                            "headsign": null,
                            "from": {
                                "name": "Origin",
                                "stop": null
                            },
                            "intermediatePlaces": null,
                            "to": {
                                "name": "Willesden Junction (Platform 3)",
                                "stop": {
                                    "gtfsId": "NR:9100WLSDNJL3",
                                    "name": "Willesden Junction (Platform 3)"
                                }
                            },
                            "nextLegs": null
                        },
                        {
                            "route": {
                                "shortName": "Lioness line"
                            },
                            "headsign": "Watford Junction",
                            "from": {
                                "name": "Willesden Junction (Platform 3)",
                                "stop": {
                                    "gtfsId": "NR:9100WLSDNJL3",
                                    "name": "Willesden Junction (Platform 3)"
                                }
                            },
                            "intermediatePlaces": [
                                {
                                    "name": "Harlesden",
                                    "stop": {
                                        "gtfsId": "NR:9100HARLSDN",
                                        "name": "Harlesden"
                                    }
                                }
                            ],
                            "to": {
                                "name": "Stonebridge Park",
                                "stop": {
                                    "gtfsId": "NR:9100STNBGPK",
                                    "name": "Stonebridge Park"
                                }
                            },
                            "nextLegs": [
                                {
                                    "route": {
                                        "shortName": "Bakerloo"
                                    },
                                    "headsign": "Harrow & Wealdstone"
                                },
                                {
                                    "route": {
                                        "shortName": "Bakerloo"
                                    },
                                    "headsign": "Stonebridge Park"
                                },
                                {
                                    "route": {
                                        "shortName": "Lioness line"
                                    },
                                    "headsign": "Watford Junction"
                                }
                            ]
                        },
                        {
                            "route": null,
                            "headsign": null,
                            "from": {
                                "name": "Stonebridge Park",
                                "stop": {
                                    "gtfsId": "NR:9100STNBGPK",
                                    "name": "Stonebridge Park"
                                }
                            },
                            "intermediatePlaces": null,
                            "to": {
                                "name": "Destination",
                                "stop": null
                            },
                            "nextLegs": null
                        }
                    ]
                },
                {
                    "legs": [
                        {
                            "route": null,
                            "headsign": null,
                            "from": {
                                "name": "Origin",
                                "stop": null
                            },
                            "intermediatePlaces": null,
                            "to": {
                                "name": "Willesden Junction Underground Station",
                                "stop": {
                                    "gtfsId": "DfT:9400ZZLUWJN1",
                                    "name": "Willesden Junction Underground Station"
                                }
                            },
                            "nextLegs": null
                        },
                        {
                            "route": {
                                "shortName": "Bakerloo"
                            },
                            "headsign": "Harrow & Wealdstone",
                            "from": {
                                "name": "Willesden Junction (Platform 3)",
                                "stop": {
                                    "gtfsId": "NR:9100WLSDNJL3",
                                    "name": "Willesden Junction (Platform 3)"
                                }
                            },
                            "intermediatePlaces": [
                                {
                                    "name": "Harlesden Underground Station",
                                    "stop": {
                                        "gtfsId": "DfT:9400ZZLUHSN2",
                                        "name": "Harlesden Underground Station"
                                    }
                                }
                            ],
                            "to": {
                                "name": "Stonebridge Park Underground Station",
                                "stop": {
                                    "gtfsId": "DfT:9400ZZLUSGP2",
                                    "name": "Stonebridge Park Underground Station"
                                }
                            },
                            "nextLegs": []
                        },
                        {
                            "route": null,
                            "headsign": null,
                            "from": {
                                "name": "Stonebridge Park Underground Station",
                                "stop": {
                                    "gtfsId": "DfT:9400ZZLUSGP2",
                                    "name": "Stonebridge Park Underground Station"
                                }
                            },
                            "intermediatePlaces": null,
                            "to": {
                                "name": "Destination",
                                "stop": null
                            },
                            "nextLegs": null
                        }
                    ]
                }
            ]
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThis issue is stale, no activity for 90 days. Remove stale label or comment within 30 days.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions