alexander-albers / tripkit

Swift library for querying data from public transport providers.
MIT License
77 stars 8 forks source link

AbstractEfaWebProvider queryJourneyDetail seems not to work for Bvb #87

Closed cseh17 closed 1 year ago

cseh17 commented 1 year ago

queryJourneyDetail in the AbstractEfaWebProvider for BvB (Basel) always delivers an invalidId as a response. From what I was able to check, this might happen due to a missing suffix for the lineId that is provided in the QueryJourneyDetailContext that is used for the request. (lucky guess, but maybe ":1") - checked on the Bvb website.

Could you please check this?

alexander-albers commented 1 year ago

Could you please provide an example? I did not have any problems in the TripKit test case:

Departures:

https://www.efa-bw.de/bvb3/XSLT_DM_REQUEST?outputFormat=XML&language=en&stateless=1&coordOutputFormat=WGS84&type_dm=stop&name_dm=51000095&itdDate=20230726&itdTime=0945&useRealtime=1&mode=direct&ptOptionsActive=1&deleteAssignedStops_dm=1&useProxFootSearch=0&mergeDep=1&limit=5&itdDateTimeDepArr=dep

Journey detail:

https://www.efa-bw.de/bvb3/XML_STOPSEQCOORD_REQUEST?outputFormat=XML&language=en&stateless=1&coordOutputFormat=WGS84&stopID=51000095&tripCode=44&line=bvb:01003:%20:R:n23&date=20230726&time=0948&tStOTType=all

cseh17 commented 1 year ago

Thanks for the feedback! As it seems, the stationId is wrong in my request. Where do you get yours from? It seems that is not from GTFS.

alexander-albers commented 1 year ago

You can use NetworkProvider.suggestLocations to query the stationId for your desired station name. Why the ids from GTFS aren't compatible is an entirely different topic and a pet peeve of mine. Unfortunately, there isn't much that we can do.

cseh17 commented 1 year ago

Yep, this works. Thank you a lot! This was a big help. And sorry for the confusion, it was not an issue at all.