Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
miklcct opened this issue Aug 30, 2024 · 2 comments

Comments

@miklcct
Copy link
Contributor

miklcct commented Aug 30, 2024

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
                        }
                    ]
                }
            ]
        }
    }
}
Copy link

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days

@github-actions github-actions bot added the Stale This issue is stale, no activity for 90 days. Remove stale label or comment within 30 days. label Nov 29, 2024
@miklcct
Copy link
Contributor Author

miklcct commented Dec 24, 2024

keep open for the cyclic relationship between TimetableRepository and TransitLayer mentioned in #6348

@github-actions github-actions bot removed the Stale This issue is stale, no activity for 90 days. Remove stale label or comment within 30 days. label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant