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

Investigate and setup Transitime to generate our own realtime predictions #210

Closed
luqmaan opened this issue Jul 23, 2015 · 19 comments
Closed

Comments

@luqmaan
Copy link
Owner

luqmaan commented Jul 23, 2015

Transitime is an open-source real-time transit information system. It combines readily available GPS data and GTFS data to provide real-time arrival information such as "next bus is in 5 minutes".

Transitime sounds amazing! Lets set it up and document our progress here.

If we're able to get Transitime working, we can feed the predictions into OneBusAway and get a OneBusAway server running for Austin.

http://www.transitime.org
https://github.com/Transitime/core/wiki/
http://transitime.github.io/core/javadocs/

open-austin/project-ideas#21

🚌💨💨💨

@luqmaan
Copy link
Owner Author

luqmaan commented Jul 23, 2015

Can use this to generate Trip Updates feed:

https://github.com/Transitime/core/wiki/API#gtfs-realtime-commands

The tripUpdates command for outputting prediction information in GTFS-realtime format. Can use query string option format=human for human readable output.
http://DOMAIN/api/v1/key/TEST_KEY/agency/sfmta/command/gtfs-rt/tripUpdates?OPTIONS

And I guess this is where we link to the vehicle position feed for gtfs rt?

https://github.com/Transitime/core/blob/08561cbfc57ddf39bfd24a8590dc65dda2152b0d/transitime/src/test/resources/testConfig.xml

@walkeriniraq
Copy link

Stream of consciousness from getting this running:

Downloaded source and packaged with "mvn install -DskipTests"

SQL schema in transitime-core/transitime/target/classes/ddl_*

java -jar processGTFSFile.jar -c db.properties -gtfsDirectoryName ~/Downloads/transit/

db.properties:
transitime.db.dbName=transitime
transitime.db.dbType=postgresql
transitime.db.dbUserName=nathan
transitime.db.dbPassword=*******
transitime.hibernate.configFile=postgres_hibernate.cfg.xml

postgres_hibernate.cfg.xml copied from target/classes folder

Run with:
java -Dtransitime.hibernate.configFile=postgres_hibernate.cfg.xml -Dtransitime.avl.gtfsRealtimeFeedURI="https://data.texas.gov/download/i5qp-g5fd/application/octet-stream" -Dtransitime.modules.optionalModulesList=org.transitime.avl.GtfsRealtimeModule -Dtransitime.core.agencyId=transitime -jar core.jar

CURRENT STATUS: failing to correctly parse data from CapMetro.

Failure from log:
ERROR thread=avlClient-1 [o.t.a.AvlClient:82] Throwing away avlReport AvlReport [vehicleId=9310, time=01-17-1970 10:19:18.198 CST, location=[30.48167, -97.78945], speed=7.7m/s, heading=NaN, source=GTFS-rt, assignmentId=983, assignmentType=ROUTE_ID] because Time of 01-17-1970 10:19:18 CST is more than 10 years old. 

message example:
entity {
  id: "159"
  vehicle {
    trip {
      trip_id: "1491703"
      start_time: "20:52"
      start_date: "20150901"
      route_id: "983"
    }
    position {
      latitude: 30.40891
      longitude: -97.74563
      speed: 37.52
    }
    timestamp: 1441158775
    vehicle {
      id: "9103"
    }
  }
}

@walkeriniraq
Copy link

Added a PR for fixing a bug in transitime GTFS-RT to AVL timestamps here: Transitime/core#16

@walkeriniraq
Copy link

I have the webapps up and running in tomcat. Fairly easy to deploy.

  1. Download tomcat and extract.
  2. Extract api.war and web.war inside of the tomcat/webapps folder.
  3. Change web/WEB-INF/web.xml to point to correct properties file with database info
  4. Change api/WEB-INF/web.xml to point to correct properties file with database info
  5. Use transitime.db.webstructs.WebAgency to add record to database.
  6. Start tomcat

@luqmaan
Copy link
Owner Author

luqmaan commented Sep 7, 2015

🎆 🎆 🎆

Nice work man!

Now we need to get it running on a server.

@luqmaan
Copy link
Owner Author

luqmaan commented Sep 7, 2015

Should we meet up sometime next week to get started on that?

I think it would be worthwhile to get the stuff running in a Docker container.

http://azure.microsoft.com/en-us/marketplace/partners/canonical/ubuntuserver1504/
http://azure.microsoft.com/en-us/marketplace/partners/canonicalandmsopentech/dockeronubuntuserver1404lts/

@walkeriniraq
Copy link

Let's make sure I can get predictions working first.
On Sep 7, 2015 12:31 PM, "Luqmaan Dawoodjee" notifications@github.com
wrote:

Should we meet up sometime next week to get started on that?

I think it would be worthwhile to get the stuff running in a Docker
container.

http://azure.microsoft.com/en-us/marketplace/partners/canonical/ubuntuserver1504/

http://azure.microsoft.com/en-us/marketplace/partners/canonicalandmsopentech/dockeronubuntuserver1404lts/


Reply to this email directly or view it on GitHub
#210 (comment).

@luqmaan luqmaan mentioned this issue Oct 31, 2015
@ndarilek
Copy link

Not sure if this comment is off-topic for this issue. I found it because I'm trying to get a OneBusAway instance running for Austin. Was this issue concerned with that as well, or only for creating a predictions feed that could be input to OBA?

I ask because I'm having a rough time getting an OBA instance running. Looks like CapMetro's GTFS data has a bunch of errors (~5000 according to the GTFS feed validator) and I'm wondering if/how you may have worked around that for this and other projects.

Thanks.

@luqmaan
Copy link
Owner Author

luqmaan commented Nov 30, 2015

Hey Nolan,

We're also trying to get a OBA instance running for Austin. We ended up finding Transitime because we need a Trip Updates feed.

Lets work on setting up OBA/Transitime together.

Are you free tomorrow, Tuesday Dec 1 at 6:30pm? We're gonna be working on this project at the Open Austin Civic Hack Night. http://www.meetup.com/Open-Government-Civic-Technology-Meetup-by-Open-Austin/events/226908119/

@ndarilek
Copy link

ndarilek commented Nov 30, 2015 via email

@luqmaan
Copy link
Owner Author

luqmaan commented Nov 30, 2015

if there's a mismatch between the fixed GTFS data and the GTFS real-time feeds

Very likely.

building a GraphQL API on top of OBA's

Really cool. We're building a React app to around the OBA API. For now we're just using Tampa's instance since we don't have a useful one for Austin. https://github.com/open-austin/instabus

@luqmaan
Copy link
Owner Author

luqmaan commented Nov 30, 2015

@ndarilek How far have you gotten with your GraphQL API?

Also, come join us on Slack. http://slack.open-austin.org. There's a #instabus channel and a #transitime channel/

@ndarilek
Copy link

ndarilek commented Nov 30, 2015 via email

@luqmaan
Copy link
Owner Author

luqmaan commented Dec 1, 2015

Its unfortunate that Slack app doesn't work with screen readers. I had no idea. Do screen readers work on the Slack webapp https://open-austin.slack.com/messages?

On our side, we've taken the steps to setup the IRC/XMPP gateway for Slack. https://slack.zendesk.com/hc/en-us/articles/201727913-Connecting-to-Slack-over-IRC-and-XMPP

@ndarilek
Copy link

ndarilek commented Dec 1, 2015 via email

@luqmaan
Copy link
Owner Author

luqmaan commented Dec 2, 2015

When I last looked, it seemed like the IRC gateway was enabled but the XMPP gateway wasn't. I'll check again.

Fixed now. https://open-austin.slack.com/account/gateways.

@luqmaan
Copy link
Owner Author

luqmaan commented Dec 4, 2015

@ndarilek CapMetro has updated their GTFS zip and its working great. Here's the results of the feed validator: http://luqmaan.com/capmetro-gtfs-health/

I also got OBA running locally using the steps here: https://github.com/luqmaan/capmetrobeta/blob/master/README.md

🎆

CapMetro has a working Trip Updates JSON dump (https://data.texas.gov/Transportation/Trip-Updates-JSON-File/mqtr-wwpy). They are still working on getting the Trip Updates PB feed. Once that is ready, I think OBA can serve realtime info.

@luqmaan luqmaan closed this as completed Oct 2, 2016
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

No branches or pull requests

3 participants