GithubHelp home page GithubHelp logo

schildbach / public-transport-enabler Goto Github PK

View Code? Open in Web Editor NEW
378.0 19.0 131.0 6.4 MB

Unleash public transport data in your Java project.

Home Page: https://groups.google.com/forum/#!forum/public-transport-enabler-discuss

License: GNU General Public License v3.0

Java 100.00%
java library public-transportation navitia hafas efa

public-transport-enabler's Introduction

Public Transport Enabler

This is a Java library allowing you to get data from public transport providers. Look into NetworkProvider.java for an overview of the API.

Using providers that require secrets

For some providers a secret like an API key is required to use their API. Copy the secrets.properties.template file to secrets.properties like so:

$ cp test/de/schildbach/pte/live/secrets.properties.template test/de/schildbach/pte/live/secrets.properties

You need to request the secrets directly from the provider. For Navitia based providers, you can request a secret here.

How to run live tests?

Make sure the test you want to run does not require a secret and if it does, see above for how to get one. Once you have the secret or if your provider does not need one, you can run the tests in your IDE. Both IntelliJ and Eclipse have excellent support for JUnit tests.

If you prefer to run tests from the command line, you can comment out the test exclude at the end of build.gradle and use this command to only execute a test for a single provider:

$ gradle -Dtest.single=ParisProviderLive test

This uses the ParisProvider as an example. Just replace it with the provider you want to test.

public-transport-enabler's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

public-transport-enabler's Issues

FrenchSouthWestProvider: NPE with parseColor when color is null

There's still a null color issue:

05-27 15:19:39.875 W/System.err: java.lang.NullPointerException
05-27 15:19:39.879 W/System.err:     at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:210)
05-27 15:19:39.887 W/System.err:     at de.schildbach.pte.dto.Style.parseColor(Style.java:116)
05-27 15:19:39.887 W/System.err:     at de.schildbach.pte.FrenchSouthWestProvider.getLineStyle(FrenchSouthWestProvider.java:63)
05-27 15:19:39.887 W/System.err:     at de.schildbach.pte.AbstractNavitiaProvider.parseLineFromSection(AbstractNavitiaProvider.java:494)
05-27 15:19:39.887 W/System.err:     at de.schildbach.pte.AbstractNavitiaProvider.parseLeg(AbstractNavitiaProvider.java:565)
05-27 15:19:39.887 W/System.err:     at de.schildbach.pte.AbstractNavitiaProvider.parseQueryTripsResult(AbstractNavitiaProvider.java:658)
05-27 15:19:39.887 W/System.err:     at de.schildbach.pte.AbstractNavitiaProvider.queryTrips(AbstractNavitiaProvider.java:1142)

PLProvider UnexpectedRedirectException

de.schildbach.pte.exception.UnexpectedRedirectException:

http://rozklad-pkp.pl/bin/query.exe/pn?start=Suchen&REQ0JourneyStopsS0ID=A%3D16%40X%3D20991985%40Y%3D52232311%40O%3D%3Felazna+51%2F53%2C+Warszawa&REQ0JourneyStopsZ0ID=A%3D16%40X%3D21027760%40Y%3D52229044%40O%3Daleja+Na+Skarpie+27%2C+Warszawa&REQ0HafasSearchForw=1&REQ0JourneyDate=17.12.14&REQ0JourneyTime=16%3A05&REQ0JourneyProduct_prod_list_1=0011111&h2g-direct=11 -> http://mt.rozklad-pkp.pl/
at de.schildbach.pte.util.ParserUtils.scrapeInputStream(ParserUtils.java:192)
at de.schildbach.pte.util.ParserUtils.scrapeInputStream(ParserUtils.java:127)
at de.schildbach.pte.AbstractHafasProvider.queryTripsBinary(AbstractHafasProvider.java:1531)
at de.schildbach.pte.AbstractHafasProvider.queryTripsBinary(AbstractHafasProvider.java:1481)
at de.schildbach.pte.AbstractHafasProvider.queryTrips(AbstractHafasProvider.java:752)

Implement AbstractOTPProvider

Some transit providers seem to have these days OpenTripPlanner as API.
It does provide calculating itineraries and could be an alternative for where navitia-support is missing or not good.
It also has an API for the number of available rental bikes at stations and supports realtime data.
I wanted to just leave this here in case it is helpful some when.

Provider VRR issue

Hi,
Found problem with VRR provider:

java.lang.RuntimeException: uncategorized problem while processing http://efa.vrr.de/standard/XSLT_TRIP_REQUEST2?outputFormat=XML&language=de&stateless=1&coordOutputFormat=WGS84&sessionID=0&requestID=0&coordListOutputFormat=STRING&type_origin=stop&name_origin=20018235&type_destination=stop&name_destination=22000892&itdDate=20160714&itdTime=0800&itdTripDateTimeDepArr=dep&calcNumberOfTrips=6&ptOptionsActive=1&itOptionsActive=1&changeSpeed=normal&includedMeans=checkbox&inclMOT_0=on&inclMOT_0=on&inclMOT_1=on&inclMOT_2=on&inclMOT_3=on&inclMOT_4=on&inclMOT_5=on&inclMOT_6=on&inclMOT_7=on&inclMOT_9=on&inclMOT_8=on&inclMOT_10=on&trITMOTvalue100=10&locationServerActive=1&useRealtime=1&nextDepsPerLeg=1&inclMOT_11=on 
at de.schildbach.pte.AbstractEfaProvider.queryTrips(AbstractEfaProvider.java:2187) 
...
Caused by: java.lang.IllegalStateException: cannot normalize mot='0' symbol='RE6a' name='RE6a' long='R-Bahn RE6a' trainType='null' trainNum='RE6a' trainName='null' 
at de.schildbach.pte.AbstractEfaProvider.parseLine(AbstractEfaProvider.java:1487) 
at de.schildbach.pte.VrrProvider.parseLine(VrrProvider.java:111)
 at de.schildbach.pte.AbstractEfaProvider.processPublicLeg(AbstractEfaProvider.java:2693) 
at de.schildbach.pte.AbstractEfaProvider.queryTrips(AbstractEfaProvider.java:2509) 
at de.schildbach.pte.AbstractEfaProvider.queryTrips(AbstractEfaProvider.java:2179) ... 15 more

ErrorCode 13

Hello. Do you know what does it mean errorCode 13?

VRS: SignatureException on Android 2.3.3

java.lang.RuntimeException: IO problem while processing de.schildbach.oeffi.directions.DirectionsActivity$23[f:Location{STATION, 18, place=Köln-Innenstadt, name=Chlodwigplatz}|v:null|t:Location{STATION, 35, place=Köln-Innenstadt, name=Ebertplatz}|depart in 0 min|[ON_DEMAND, CABLECAR, BUS, SUBURBAN_TRAIN, SUBWAY, FERRY, REGIONAL_TRAIN, TRAM]|NORMAL|NEUTRAL] on de.schildbach.pte.VrsProvider@40637650 (try 4)
at de.schildbach.oeffi.directions.QueryTripsRunnable.run(QueryTripsRunnable.java:140)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.os.HandlerThread.run(HandlerThread.java:60)
Caused by: javax.net.ssl.SSLHandshakeException: org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate signature.
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:477)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:328)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.setupSecureSocket(HttpConnection.java:185)
at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:433)
at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.makeConnection(HttpsURLConnectionImpl.java:378)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.retrieveResponse(HttpURLConnectionImpl.java:1018)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:726)
at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:121)
at de.schildbach.pte.util.ParserUtils.scrapeInputStream(ParserUtils.java:182)
at de.schildbach.pte.util.ParserUtils.scrape(ParserUtils.java:98)
at de.schildbach.pte.util.ParserUtils.scrape(ParserUtils.java:88)
at de.schildbach.pte.util.ParserUtils.scrape(ParserUtils.java:82)
at de.schildbach.pte.VrsProvider.queryTrips(VrsProvider.java:746)
at de.schildbach.oeffi.directions.QueryTripsRunnable.run(QueryTripsRunnable.java:93)
... 4 more
Caused by: java.security.cert.CertificateException: org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate signature.
at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:161)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocketImpl.java:664)
at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_do_handshake(Native Method)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:474)
... 17 more
Caused by: org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate signature.
at org.bouncycastle.jce.provider.RFC3280CertPathUtilities.processCertA(RFC3280CertPathUtilities.java:1504)
at org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi.engineValidate(PKIXCertPathValidatorSpi.java:399)
at java.security.cert.CertPathValidator.validate(CertPathValidator.java:197)
at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:156)
... 20 more
Caused by: java.security.SignatureException: Signature was not verified
at org.apache.harmony.security.provider.cert.X509CertImpl.fastVerify(X509CertImpl.java:562)
at org.apache.harmony.security.provider.cert.X509CertImpl.verify(X509CertImpl.java:487)
at org.bouncycastle.jce.provider.CertPathValidatorUtilities.verifyX509Certificate(CertPathValidatorUtilities.java:1551)
at org.bouncycastle.jce.provider.RFC3280CertPathUtilities.processCertA(RFC3280CertPathUtilities.java:1496)
... 23 more

AbstractNavitiaProvider: Trip Sorting Issues

Hi @aelkhour,

when querying for trips with dep=false for "date is arrival time", then the trips are given in reverse chronological order with latest tips first and earliest at the end.

Similar, when querying for earlier trips with queryMoreTrips, then the earlier trips are also in reverse chronological order.

I'm not sure whether providers are supposed to give data in the proper order or whether its the consumer who is responsible for ordering correctly. Maybe @schildbach can shed some light on that. I would of course appreciate to get the correct trip order from PTE without having to re-sort trips myself chronologically.

Add GPS capability

In grote/Transportr#102, I requested disabling GPS for NS, as NS does not support it. If I understood the reply to my issue correctly, Transportr simply asks PTE what the network supports, but there is no way to check if it supports GPS positions. It would be good to be able to query PTE to see if the transport network supports GPS locations.

If I understood it incorrectly, I apologize, hopefully @grote can explain better then.

Navitia: No enum constant BSS_RENT

When I was running ParisProviderLiveTest today, I got this:

java.lang.IllegalArgumentException: No enum constant de.schildbach.pte.AbstractNavitiaProvider.SectionType.BSS_RENT
at java.lang.Enum.valueOf(Enum.java:238)
at de.schildbach.pte.AbstractNavitiaProvider$SectionType.valueOf(AbstractNavitiaProvider.java:1)
at de.schildbach.pte.AbstractNavitiaProvider.parseLeg(AbstractNavitiaProvider.java:459)
at de.schildbach.pte.AbstractNavitiaProvider.parseQueryTripsResult(AbstractNavitiaProvider.java:571)
at de.schildbach.pte.AbstractNavitiaProvider.queryTrips(AbstractNavitiaProvider.java:1107)
at de.schildbach.pte.live.AbstractProviderLiveTest.queryTrips(AbstractProviderLiveTest.java:135)
at de.schildbach.pte.live.ParisProviderLiveTest.queryTripSlowWalk(ParisProviderLiveTest.java:252)

Error Message

Unknown error message after searching for an connection.
screenshot_2016-06-30-22-42-17

AbstractNavitiaProvider: queryNearbyLocations does not respect maxDistance=0

The documentation of queryNearbyLocations() says

maxDistance
           maximum distance in meters, or 0

In all NetworkProviders, using 0 means don't limit the distance. In the AbstractNavitiaProvider however, 0 really means 0m, so no stations are found.
This should probably be changed to mean unlimited as well. I would do a PR, if this behavior is indeed expected.

HAFAS stationboard result has different style

I would like to add a RmvProvider, nearby locations works and trip queries do as well (these are the ones I tested so far).
What I noticed however is that rmv's hafas ignores the L=vs_java3 parameter and just puts out the website code when querying the stationboard:
http://www.rmv.de/auskunft/bin/jp/stboard.exe/dn?productsFilter=111111111111&boardType=dep&disableEquivs=1&maxJourneys=10&input=3000010&date=11.11.16&time=22%3A23&L=vs_java3&hcount=0&start=yes
There does however seem to be another way to get the data and that is appending &output=xml
http://www.rmv.de/auskunft/bin/jp/stboard.exe/dn?productsFilter=111111111111&boardType=dep&disableEquivs=1&maxJourneys=10&input=3000010&date=11.11.16&time=22%3A23&hcount=0&start=yes&output=xml
The result of this however has a different and more complicated xml structure, it even is providing intermediate stops, similar to the trip query results, that the current AbstractHafasProvider isn't compatible with. Is this known from other networks and could/will this be added in the future?

NPE in France North East Provider

09-02 12:24:07.911 W/System.err: java.lang.NullPointerException
09-02 12:24:07.911 W/System.err:     at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:210)
09-02 12:24:07.911 W/System.err:     at de.schildbach.pte.dto.Style.parseColor(Style.java:116)
09-02 12:24:07.911 W/System.err:     at de.schildbach.pte.FranceNorthEastProvider.getLineStyle(FranceNorthEastProvider.java:66)
09-02 12:24:07.911 W/System.err:     at de.schildbach.pte.AbstractNavitiaProvider.parseLineFromSection(AbstractNavitiaProvider.java:494)
09-02 12:24:07.911 W/System.err:     at de.schildbach.pte.AbstractNavitiaProvider.parseLeg(AbstractNavitiaProvider.java:565)
09-02 12:24:07.911 W/System.err:     at de.schildbach.pte.AbstractNavitiaProvider.parseQueryTripsResult(AbstractNavitiaProvider.java:658)
09-02 12:24:07.911 W/System.err:     at de.schildbach.pte.AbstractNavitiaProvider.queryTrips(AbstractNavitiaProvider.java:1144)

Israel-provider JET down

It seems to me that the JetProvider does not function. At least the server behind the API_BASE-address cannot be reached.

Support France-North-West

Hi, I would like to see support for France-North-West (especially Rennes).
There is Navitia-data available as "fr-nw". I have forked this project and started to add fr-nw in https://github.com/patkan/public-transport-enabler/tree/add-fr-nw-provider.
However I am currently stuck at testing, since I applied for a Navitia-account but haven't been activated yet.
If someone has the time and a Navitia-account I would be happy if he or she could verify my live-tests.
I will create a Pull Request as soon as I have managed to test this.

SFProvider: IllegalStateException: cannot normalize

Search trip from "Railey's Market" to "Sausalito" and get this:

java.lang.RuntimeException: uncategorized problem while processing http://tripplanner.transit.511.org/mtc/XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&sessionID=0&requestID=0&language=de&coordListOutputFormat=STRING&type_origin=coord&name_origin=-122.049232:37.550440:WGS84&type_destination=coord&name_destination=-122.480496:37.856952:WGS84&itdDate=20141221&itdTime=0145&itdTripDateTimeDepArr=dep&calcNumberOfTrips=6&ptOptionsActive=1&itOptionsActive=1&changeSpeed=normal&includedMeans=checkbox&inclMOT_0=on&inclMOT_0=on&inclMOT_1=on&inclMOT_2=on&inclMOT_3=on&inclMOT_4=on&inclMOT_5=on&inclMOT_6=on&inclMOT_7=on&inclMOT_9=on&inclMOT_8=on&inclMOT_10=on&inclMOT_11=on&locationServerActive=1&useRealtime=1&useProxFootSearch=1&nextDepsPerLeg=1
 at de.schildbach.pte.AbstractEfaProvider.queryTrips(AbstractEfaProvider.java:2187)
 Caused by: java.lang.IllegalStateException: cannot normalize mot='0' symbol='XAC' name='Fremont / Richmond' long='Train Fremont / Richmond' trainType='null' trainNum='Fremont / Richmond' trainName='null'
 at de.schildbach.pte.AbstractEfaProvider.parseLine(AbstractEfaProvider.java:1389)
 at de.schildbach.pte.SfProvider.parseLine(SfProvider.java:83)
 at de.schildbach.pte.AbstractEfaProvider.queryTrips(AbstractEfaProvider.java:2578)
 at de.schildbach.pte.AbstractEfaProvider.queryTrips(AbstractEfaProvider.java:2179)

New Capability: VIA and REALTIME

Hi @schildbach,

Navitia does not support Via for trip planning and they don't intent to do so (hove-io/navitia#1589). Maybe we should introduce a VIA capability and set it to false for all Navitia based providers. What do you think?

While we are at it, how about a capability for providers that provide real-time data for delays? When they don't, options such as reloading a connection can be disabled/removed.

Kind Regards,
Torsten

Documentation

The project is missing a readme, documentation and/or examples.

Add Flixbus provider

I'm currently working on adding a provider for Flixbus, a german/european provider of long distance buses, but I'm having some issues that I'd like to discuss before putting any larger effort into it:

  • They don't have a public documentation of their API, so the only way one can get information about it is by using mitmproxy to analyze their app or website (an excerpt of network traffic generated by the iOS app can be found here). This poses two problems:
    • I'm not sure if using the API or providing an implementation of an API client would be strictly legal. Their answer to an email stated that a public API is not going to happen ("für uns nicht in Frage kommt").
    • There's no guaranty of API stability or availability, but I guess since they don't want to lose customers stuck with an old version of the app this should be a non-issue.
  • There doesn't seem to be a way to search for stations neither by name nor by location. The way the iOS app seems to solve this is by retrieving a list of all stations served and storing it locally. I'm going to investigate if maybe the Android app does this differently but otherwise, we'll have to either retrieve the list and cache it for a certain (relatively large) time or process this list of >1MB in size each time (that seems undoable to me). What's your opinion on this? I know that OkHttp can deal with caching, so somebody using pte could provide the path to the cache directory when instantiating a provider that makes use of it.

I'd be happy if @schildbach and @grote could comment on this :-)

GvhProvider: MalformedURLException

The GVH Provider seems to be broken at the moment. It does not do location auto-completion anymore:

java.net.MalformedURLException: Protocol not found: C2C_User=ASBXML_STOPFINDER_REQUEST?outputFormat=JSON&language=de&stateless=1&coordOutputFormat=WGS84&locationServerActive=1&regionID_sf=1&type_sf=any&name_sf=test&anyObjFilter_sf=126&reducedAnyPostcodeObjFilter_sf=64&reducedAnyTooManyObjFilter_sf=2&useHouseNumberList=true&anyMaxSizeHitList=500
     at java.net.URL.<init>(URL.java:176)
     at java.net.URL.<init>(URL.java:125)
     at de.schildbach.pte.util.HttpClient.getInputStream(HttpClient.java:134)
     at de.schildbach.pte.util.HttpClient.get(HttpClient.java:105)
     at de.schildbach.pte.util.HttpClient.get(HttpClient.java:95)
     at de.schildbach.pte.AbstractEfaProvider.jsonStopfinderRequest(AbstractEfaProvider.java:272)
     at de.schildbach.pte.AbstractEfaProvider.suggestLocations(AbstractEfaProvider.java:708)

And with ambiguous locations, it does not find trips:

java.net.MalformedURLException: Protocol not found: C2C_User=ASBXSLT_TRIP_REQUEST2?outputFormat=XML&language=de&stateless=1&coordOutputFormat=WGS84&sessionID=0&requestID=0&coordListOutputFormat=STRING&type_origin=any&name_origin=tesz&type_destination=any&name_destination=test&itdDate=20151206&itdTime=1659&itdTripDateTimeDepArr=dep&calcNumberOfTrips=6&ptOptionsActive=1&itOptionsActive=1&routeType=LEASTTIME&changeSpeed=normal&includedMeans=checkbox&inclMOT_0=on&inclMOT_0=on&inclMOT_1=on&inclMOT_2=on&inclMOT_3=on&inclMOT_4=on&inclMOT_5=on&inclMOT_6=on&inclMOT_7=on&inclMOT_9=on&inclMOT_8=on&inclMOT_10=on&useProxFootSearch=1&trITMOTvalue100=10&locationServerActive=1&useRealtime=1&nextDepsPerLeg=1
     at java.net.URL.<init>(URL.java:176)
     at java.net.URL.<init>(URL.java:125)
     at de.schildbach.pte.util.HttpClient.getInputStream(HttpClient.java:134)
     at de.schildbach.pte.util.HttpClient.getInputStream(HttpClient.java:119)
     at de.schildbach.pte.AbstractEfaProvider.queryTrips(AbstractEfaProvider.java:2166)

ParisProvider: Unnecessary Walks For Trip Start and End

It seems that Trip Results have a 0m/0min walk at the beginning and the end of the trip with the same name as the actual station. If the Navitia API outputs these, maybe they should just be skipped and not returned via PTE? Also, there seems to be an issue with departure and arrival times.
See the screenshot below for an example.

This is probably for @aelkhour.

footway

Secrets.java - get an error during compilation.

Hi!
when I pull and run mvn clean install i get the following error:
[ERROR] /public-transport-enabler/enabler/test/de/schildbach/pte/live/ParisProviderLiveTest.java:[51,41] cannot find symbol
[ERROR] symbol: variable Secrets
I saw Secrets.java in .gitignore file and Secrets.java.templete file.
I can't understand how does it work and what is the purpose. Could you please give me some hint.

Thank you.

ParisProvider: RAPIDTRANSIT is not a constant in AbstractNavitiaProvider

When searching for trips with the new ParisProvider, I get the following backtrace:

java.lang.IllegalArgumentException: RAPIDTRANSIT is not a constant in de.schildbach.pte.AbstractNavitiaProvider$CommercialMode
at java.lang.Enum.valueOf(Enum.java:200)
at de.schildbach.pte.AbstractNavitiaProvider$CommercialMode.valueOf(AbstractNavitiaProvider.java:92)
at de.schildbach.pte.AbstractNavitiaProvider.parseLineProductFromMode(AbstractNavitiaProvider.java:599)
at de.schildbach.pte.AbstractNavitiaProvider.parseLineFromSection(AbstractNavitiaProvider.java:396)
at de.schildbach.pte.AbstractNavitiaProvider.parseLeg(AbstractNavitiaProvider.java:469)
at de.schildbach.pte.AbstractNavitiaProvider.parseQueryTripsResult(AbstractNavitiaProvider.java:562)
at de.schildbach.pte.AbstractNavitiaProvider.queryTrips(AbstractNavitiaProvider.java:1034)

aelkhour@775a09c#diff-f6454ee376ea2d0e9102dccfc90115f7R1021 seems not to be merged, but also doesn't seem to fix this. Maybe @aelkhour knows more.

RuntimeException 'cannot parse' in AbstractEfaProvider.jsonStopfinderRequest

Sometimes, I get this when trying to get auto-complete results in the VRR network for 'Schadow' with latest git master HEAD:

Caused by: java.lang.RuntimeException: cannot parse: '{ "parameters": [ { "name":"requestID", "value":"0" }, { "name":"sessionID", "value":"0" } ], "stopFinder": { "message": [ { "name":"code", "value":"-8020" }, { "name":"error", "value":"" } ], "input": { "input":"sch" }, "points": null } }' on http://app.vrr.de/standard/XML_STOPFINDER_REQUEST?outputFormat=JSON&coordOutputFormat=WGS84&locationServerActive=1&type_sf=any&name_sf=sch&SpEncId=0&anyObjFilter_sf=126&reducedAnyPostcodeObjFilter_sf=64&reducedAnyTooManyObjFilter_sf=2&useHouseNumberList=true&anyMaxSizeHitList=500
            at de.schildbach.pte.AbstractEfaProvider.jsonStopfinderRequest(AbstractEfaProvider.java:300)
            at de.schildbach.pte.AbstractEfaProvider.suggestLocations(AbstractEfaProvider.java:705)
Caused by: org.json.JSONException: Value null at points of type org.json.JSONObject$1 cannot be converted to JSONArray
            at org.json.JSON.typeMismatch(JSON.java:100)
            at org.json.JSONObject.getJSONArray(JSONObject.java:588)
            at de.schildbach.pte.AbstractEfaProvider.jsonStopfinderRequest(AbstractEfaProvider.java:284)
            at de.schildbach.pte.AbstractEfaProvider.suggestLocations(AbstractEfaProvider.java:705)

Add providers for long distance buses

I don't know about the rest of the world, but here in Germany long distance buses (Fernbusse) are getting more and more important.
Sadly, I don't know of any bus company that has a publicly available API. But this can be changed if we convince them that a public API is worth the effort.
What do you think about adding long distance buses?

[Navitia] NotFoundException: fr-sw/stop_point

When trying to find nearby stations for "Bardanac" I am getting this exception:

de.schildbach.pte.exception.NotFoundException: http://api.navitia.io/v1/coverage/fr-sw/stop_point/stop_area:O33:SA:19727/places_nearby?type[]=stop_point&distance=0&count=5&depth=0
     at de.schildbach.pte.util.HttpClient.getInputStream(HttpClient.java:228) 
     at de.schildbach.pte.util.HttpClient.get(HttpClient.java:105)
     at de.schildbach.pte.util.HttpClient.get(HttpClient.java:95)
     at de.schildbach.pte.util.HttpClient.get(HttpClient.java:90)
     at de.schildbach.pte.AbstractNavitiaProvider.queryNearbyLocations(AbstractNavitiaProvider.java:795)

@kalon33 or @aelkhour might want to look at this one since it happens with Navitia and the newly added FR-SW region.

ParisProvider: queryTrips returns only 1 trip

I queried a couple of trips and there's usually only one trip returned while all the other providers return at least 3 trips.

Also, querying for earlier or later trips does not work for me, at least not the same way it does for other providers.

This is probably for @aelkhour.

AbstractHafasProvider: IllegalStateException: error 12

Hi Andreas,

I get an unhandled Exception (AbstractHafasProvider:2048). It seems to get the error code 12 back witch is is not handled in the code. Is the Bahn-Api broken?

Exception in thread "Thread-2" java.lang.IllegalStateException: error 12 on http://reiseauskunft.bahn.de/bin/query.exe/dn?start=Suchen&REQ0JourneyStopsS0ID=A%3D16%40X%3D7896912%40Y%3D50493485%40O%3DStartort&REQ0JourneyStopsZ0ID=A%3D16%40X%3D7892370%40Y%3D50484897%40O%3DZielort&REQ0HafasSearchForw=0&REQ0JourneyDate=06.01.15&REQ0JourneyTime=06%3A30&REQ0JourneyProduct_prod_list_1=11111111110000&h2g-direct=11

Thanks for this great piece of software.

Greetings,

Gregor.

EFA longer walking times to stations

HAFAS does only seem to provide a distance (instead of walking duration) as parameter.
Currently EFA only searches for stations near the start/target.

The fix is simple, just add a parameter to the method xsltTripRequestParameters like so:

uri.append("&trITMOTvalue100=").append(20); // 20 minutes walking is ok

It would be better if the walking times could be changed or made longer. What's the best way to provide that to AbstractEfaProvider? A Getter/Setter? Just add it hardcoded? Add the value to the WalkingSpeed-Enum? I can provide a PullRequest if you tell me the optimal way to do it since there are many possibilities.

Caltrain Baby Bullet not working

When the app tries to use the Caltrain, it returns an exception. Attached is a screenshot.

Installed from F-Droid
Note 4
Sprint
Android 6.1

IllegalStateException: cannot normalize mot='0' symbol='BAB' name='Baby Bullet' long='Train BABY BULLET' trainType='null' trainNum='BABY BULLET' trainName='null'
screenshot_2016-06-05-15-19-02

Map in Transportr for all routes in Vienna puts one waypoint in Atlantic Ocean

I first reported this on Transportr here and was then directed to consider the WienerLinien API or the public-transport-enabler as the source of the issue. I attempted to recreate the issue on wienerlinien.at and both the Qando Wien and WienMobil Lab apps but all maps displayed fine there. I don't have an Android development environment setup, so can't test the API and public-transport-enabler together myself—hence the report here.

On Transportr 1.1.4 (from f-Droid) / Android 7.0 / Nexus 5x, the maps for many longer routes (more than two legs I think) generated in Vienna put one waypoint (transfer/endpoint) in the Atlantic Ocean (south of Accra and west of Libreville). The point is labeled as one of the actual points on the route, and when you do zoom in to Vienna, the route is correct but doesn't include the legs surrounding the errant waypoint.

It's a minor annoyance to have to zoom in every time I look at the map from so far out, but overall it is not a major bug. It seems to happen on all longer routes in Vienna but I haven't been systematic about my testing.

See attached screenshots for more. They show, in order: 1) the route; 2) the first screen shown after clicking the map button for a route, auto-zoomed out to include the errant waypoint; 3) the info about the errant point; 4) the full actual route on the map of Vienna; 5) the route zoomed to the missing section around the point (here "Simmering S+U") that is missing/in the Atlantic.

1 2 3 4 5

Support for Paris public transporation network

Hello,

I regularly use the Paris public transportation network, and I haven't seen yet any application that offers as nice UI and features as Offi Directions.

I was wondering if you have already thought of providing support for Paris, as I am sure a lot of people would benefit from it.

Thanks for all your work!

KVV: expecting attribute: project

The KVV provider stopped working some days ago. Unfortunately, I don't know enough about pte to fix it on my own. Would be great if someone could have a look at it :)

W/System.err(32605): java.lang.RuntimeException: uncategorized problem while processing http://213.144.24.66/oeffi/XSLT_TRIP_REQUEST2?outputFormat=XML&language=de&stateless=1&coordOutputFormat=WGS84&sessionID=0&requestID=0&coordListOutputFormat=STRING&type_origin=stop&name_origin=7000089&type_destination=stop&name_destination=7000073&itdDate=20160109&itdTime=2313&itdTripDateTimeDepArr=dep&calcNumberOfTrips=6&ptOptionsActive=1&itOptionsActive=1&routeType=LEASTTIME&changeSpeed=normal&includedMeans=checkbox&inclMOT_0=on&inclMOT_0=on&inclMOT_1=on&inclMOT_2=on&inclMOT_3=on&inclMOT_4=on&inclMOT_5=on&inclMOT_6=on&inclMOT_7=on&inclMOT_9=on&inclMOT_8=on&inclMOT_10=on&useProxFootSearch=1&trITMOTvalue100=10&locationServerActive=1&useRealtime=1&nextDepsPerLeg=1
W/System.err(32605):    at de.schildbach.pte.AbstractEfaProvider.queryTrips(AbstractEfaProvider.java:2166)
W/System.err(32605):    at de.grobox.liberario.tasks.AsyncQueryTripsTask.doInBackground(AsyncQueryTripsTask.java:99)
W/System.err(32605):    at de.grobox.liberario.tasks.AsyncQueryTripsTask.doInBackground(AsyncQueryTripsTask.java:41)
W/System.err(32605):    at android.os.AsyncTask$2.call(AsyncTask.java:292)
W/System.err(32605):    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
W/System.err(32605):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
W/System.err(32605):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
W/System.err(32605):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
W/System.err(32605):    at java.lang.Thread.run(Thread.java:818)
W/System.err(32605): Caused by: java.lang.IllegalStateException: expecting attribute: project
W/System.err(32605):    at de.schildbach.pte.util.XmlPullUtil.attr(XmlPullUtil.java:133)
W/System.err(32605):    at de.schildbach.pte.AbstractEfaProvider.processPublicLeg(AbstractEfaProvider.java:2662)
W/System.err(32605):    at de.schildbach.pte.AbstractEfaProvider.queryTrips(AbstractEfaProvider.java:2486)
W/System.err(32605):    at de.schildbach.pte.AbstractEfaProvider.queryTrips(AbstractEfaProvider.java:2158)
W/System.err(32605):    ... 8 more

TransitFeeds vs. navitia.io

I'm not quite sure about the differences between TransitFeeds and navitia.io.

  • TransitFeeds seems to support GTFS-realtime, even though the API for that seems cumbersome.
  • TransitFeeds does not seem to limit the amount of free API requests.
  • I think (but this is more like a feeling) that TransitFeeds supports more providers (718 at the moment). I know that once GTFS data is public, it can also be published on navitia.io, but that's extra work.
  • TransitFeeds isn't open source as far as I know.

So overall, I think that TransitFeeds may be a better choice than navitia.io for those providers that use GTFS. What do you think?

Did someone actually consider this alternative when implementing a navitia.io provider?

Getting error : cannot find symbol : variable Secrets in de.schildbach.pte.live.VgnProviderLiveTest class

Hi,

NEED URGENT HELP !!!!

I am trying to create a jar file from the package but it is not working. using information from https://code.google.com/p/public-transport-enabler/ I am using $ mvn clean package -DskipTests it gives me this error in VgnProviderLiveTest.java :

[WARNING] /mvv-code/fromgithub/public-transport-enabler/enabler/test/de/schildbach/pte/live/NasaProviderLiveTest.java: Recompile with -Xlint:deprecation for details.
[INFO] 2 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /mvv-code/fromgithub/public-transport-enabler/enabler/test/de/schildbach/pte/live/VgnProviderLiveTest.java:[42,39] cannot find symbol
symbol: variable Secrets
location: class de.schildbach.pte.live.VgnProviderLiveTest
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] base .............................................. SUCCESS [ 2.198 s]
[INFO] enabler ........................................... FAILURE [ 8.980 s]
[INFO] service ........................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE

Kindly help me out at your earliest. I am participating in a hackathon (after 1 day) and my project needs to use this library in an Android app. Do you already have a Jar file which i can use ? I just need to fetch MVV timings for train (ubahn & sbahn) , tram and bus.

Thanks in advance !

Wahib

EFA provider issue

Hi,
found an issue with EFA provider:

java.lang.RuntimeException: uncategorized problem while processing http://bhb.efa.de/bhb/XSLT_TRIP_REQUEST2?outputFormat=XML&language=de&stateless=1&coordOutputFormat=WGS84&sessionID=0&requestID=0&coordListOutputFormat=STRING&type_origin=stop&name_origin=90001782&type_destination=stop&name_destination=24035532&itdDate=20160530&itdTime=0800&itdTripDateTimeDepArr=dep&calcNumberOfTrips=6&ptOptionsActive=1&itOptionsActive=1&changeSpeed=normal&includedMeans=checkbox&inclMOT_0=on&inclMOT_0=on&inclMOT_1=on&inclMOT_2=on&inclMOT_3=on&inclMOT_4=on&inclMOT_5=on&inclMOT_6=on&inclMOT_7=on&inclMOT_9=on&inclMOT_8=on&inclMOT_10=on&useProxFootSearch=1&trITMOTvalue100=10&locationServerActive=1&useRealtime=1&nextDepsPerLeg=1
    at de.schildbach.pte.AbstractEfaProvider.queryTrips(AbstractEfaProvider.java:2187)
    .....
Caused by: java.lang.IllegalStateException: cannot normalize mot='0' symbol='null' name='74073' long='SE 74073 ABELLIO Rail Mitteldeutschland GmbH' trainType='SE' trainNum='74073' trainName='ABELLIO Rail Mitteldeutschland GmbH'
    at de.schildbach.pte.AbstractEfaProvider.parseLine(AbstractEfaProvider.java:1487)
    at de.schildbach.pte.GvhProvider.parseLine(GvhProvider.java:64)
    at de.schildbach.pte.AbstractEfaProvider.processPublicLeg(AbstractEfaProvider.java:2693)
    at de.schildbach.pte.AbstractEfaProvider.queryTrips(AbstractEfaProvider.java:2509)
    at de.schildbach.pte.AbstractEfaProvider.queryTrips(AbstractEfaProvider.java:2179)
    ... 21 more

IllegalStateException cannot exceed strings table size

Hi, I had this error message using Liberario (who apparently use your library) by doing this:

When I set SBB (Switzerland) timetable with direction from "Morges" city to "Salins, Le Parfait" bus stop, a toast message is displaying "IllegalStateException pointer 4 cannot exceed strings table size 0"

Please check out this ticket if you want a little more information (screenshot in Liverario)

grote/Transportr#78

Please ask me if you need more information to debug. I still have this error a lot of time with this specific route

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.