Question on GTFS Station types and pathway stops

40 views
Skip to first unread message

Freddy Guime

unread,
Jul 22, 2021, 5:08:49 PM7/22/21
to OpenTripPlanner Developers
Hello! 

(new to the forum, so let me know if there's a better place or way to ask the question).

I was standing up an OTP2 branch server and was importing the Regional San Francisco GTFS Feed (https://www.interline.io/blog/mtc-regional-gtfs-feed-release/) and failing with a

10:35:25.778 ERROR (OTPMain.java:59) An uncaught error occurred inside OTP: null
java.lang.NullPointerException: null
at org.opentripplanner.graph_builder.module.AddTransitModelEntitiesToGraph.createPathwayEdgesAndAddThemToGraph(AddTransitModelEntitiesToGraph.java:231) ~[classes/:na]
at org.opentripplanner.graph_builder.module.AddTransitModelEntitiesToGraph.applyToGraph(AddTransitModelEntitiesToGraph.java:89) ~[classes/:na]

As I followed through, what seems to be happening is that a "toStop" is not created for Pathways with Station Types  as stops (https://github.com/opentripplanner/OpenTripPlanner/blob/dev-2.x/src/main/java/org/opentripplanner/gtfs/mapping/PathwayMapper.java#L76

which in turn, when adding the TransitModelEntities to the map, fails on the toVertex retrieve, and eventually on the log.warn message


(Being a little unfamiliar with GTFS data and just getting my feet wet with OTP, I'm unsure what the right solution is?) Is It just the warn message that can be ignored? (as I presume OTP has been handling stations fine before)... or is it a data feed problem? Or is station support differently?

Let me know! (and if there something I can do to help).

Thanks!

Freddy Guime
Principal Engineer, 
Expedia Group





mpa...@actransit.org

unread,
Jul 26, 2021, 6:56:04 PM7/26/21
to OpenTripPlanner Developers
Hi Freddy,

I don't have a solution to your answer but a workaround.  For our trip planner, we have the same issue with the "RG" feed (all feeds in one).  Instead, we load all feeds individually except "RS" and "S*".   I am unsure why the two approaches would be different, assuming the RG dataset isn't being transformed in any way (non-concat).


Hope that helps.

Andrew Byrd

unread,
Jul 28, 2021, 3:25:42 AM7/28/21
to Freddy Guime, opentripplanner-dev
Hi,

Thanks for digging into the error message and for your summary. We looked at this at yesterday's meeting and our guess was that one of the GTFS pathways simply didn't have a specified toStop, so remained null in the internal model. But now looking at it again, now I see what you mean by "Station Types as stops". These switch statements in PathwayMapper handle all the LOCATION_TYPE_X constants except LOCATION_TYPE_STATION. I believe this is intentional - the pathways are intended to micro-map the connections between specific places like entrances and platforms, and it's not clear what it would mean for a pathway to end at an entire station. The guidance at https://developers.google.com/transit/gtfs/reference#pathwaystxt says to_stop_id "contains a stop_id that identifies a platform, entrance/exit, generic node or boarding area", which are exactly the four cases covered by the switch statement. If a pathway in your input data has a station as a to_stop_id I think this would be considered incorrect input data. But this code just fails silently on unrecognized or missing values.

We have a fix lined up so at least we'll log the warning successfully; the pathway would just be skipped and not added to the graph. But I'll confer with the primary authors of the GTFS mapping code about adding some more logging of missing or invalid from/to stops in pathways.

Regards,
Andrew


--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/opentripplanner-dev/cbad27f0-c28f-419a-bf67-75d8121bafdcn%40googlegroups.com.

Freddy Guime

unread,
Jul 29, 2021, 12:30:10 PM7/29/21
to OpenTripPlanner Developers
thank you for looking into it! : ). Makes sense
Reply all
Reply to author
Forward
0 new messages