Skip to content

Add code to expand transfers to/from stations. - #2410

Merged
abyrd merged 2 commits into
masterfrom
parent-station-transfers
Mar 22, 2017
Merged

Add code to expand transfers to/from stations.#2410
abyrd merged 2 commits into
masterfrom
parent-station-transfers

Conversation

@mattwigway

@mattwigway mattwigway commented Mar 1, 2017

Copy link
Copy Markdown
Member

When a parent station is listed as the to or from station in transfers.txt, this PR creates transfers
to/from all child stops.

Currently, parent station transfers cause OTP to crash because there are no graph vertices associated with these stations. This patch causes it to instead expand parent station transfers into transfers between all child stops of those parent stations. The only concern here is that it could lead to large transfer tables, but I don't really see a way around that.

Fixes #2404 and possibly #2406.

When a parent station is listed as the to or from station in transfers.txt, we create transfers
to/from all child stops.

Fixes #2404 and possibly #2406.
@mattwigway
mattwigway requested review from abyrd and landonreed March 1, 2017 20:57

@landonreed landonreed left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattwigway, LGTM. Only thing is a nit-picky question about variable modifiers.

private GtfsStopContext context = new GtfsStopContext();

// the location types for transfers.txt
public int STOP_LOCATION_TYPE = 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should STOP_LOCATION_TYPE and PARENT_STATION_LOCATION_TYPE be static final?

@mattwigway

mattwigway commented Mar 2, 2017 via email

Copy link
Copy Markdown
Member Author

@abyrd abyrd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mattwigway. I don't understand your initial description of the PR though. You say "When a parent station is listed as the to or from station in transfers.txt, we create transfers to/from all child stops... This patch causes it to instead expand parent station transfers into transfers between all child stops of those parent stations."

Isn't the current situation that we don't create transfers between child stops, and we instead attempt to make transfers between the parent stations, which don't exist as vertices?

That's what this PR appears to fix, and it looks good for that purpose. If you can add the "static final" modifiers and update the PR description for posterity, I think this should be merged.

@mattwigway

Copy link
Copy Markdown
Member Author

Fixed.

@mattwigway mattwigway assigned abyrd and unassigned mattwigway Mar 14, 2017
@NasNasingud

Copy link
Copy Markdown

Hi, thanks for pursuing this issue!
Today I tried again to build a new graph with the latest JAR. but it still throws a NullPointerException at

org.opentripplanner.routing.edgetype.factory.GTFSPatternHopFactory.loadTransfers(GTFSPatternHopFactory.java:1067)

Obviously, it happens directly after the message "Done finding interlining trips and creating the corresponding edges." occurs...

Thank you very much for your support!

By the way, do you know a workaround to avoid this issue until it is solved, e.g. by manipulating the GTFS-Files?

@mattwigway

Copy link
Copy Markdown
Member Author

This change has not yet made it into master. @abyrd can you confirm that this is ready?

@abyrd
abyrd merged commit 31e712d into master Mar 22, 2017
@abyrd
abyrd deleted the parent-station-transfers branch March 22, 2017 09:06
@muenchhagen

Copy link
Copy Markdown

Is this problem fixed for otp-1.1.0-shaded.jar ( from: https://repo1.maven.org/maven2/org/opentripplanner/otp/ ) Because it occured for me today when trying to build a new graph.

@abyrd

abyrd commented Mar 29, 2017

Copy link
Copy Markdown
Member

@muenchhagen no, I merged it just after the 1.1.0 release, so you'd need to use a newer build to get this fix. All more recent builds should be at https://oss.sonatype.org/content/repositories/staging/org/opentripplanner/otp/1.2.0-SNAPSHOT/

@NasNasingud

Copy link
Copy Markdown

Today I tried it again, and now it worked fine, the graph was successfully created! Thank you so much for the quick troubleshooting!

@demory demory mentioned this pull request Aug 16, 2017
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 this pull request may close these issues.

5 participants