4

I am a newbie onto GTFS and found some information on my research that said one has to provide the GTFS feed in txt formats to obtain the routes/transit information, etc.

Now my question is,

1) If we create our own txt formats, and upload onto the GTFS feed provider, would it result in showing up on the google maps as well?

2) I would like to have my own GTFS server code which will take data from my DB and process it and provide the best transit routes. Is it possible? Assume I have the ability to run Python as well as PHP scripts.

Any help would be best appreciated!

Thanks in advance

Abhilash L R
  • 805
  • 1
  • 9
  • 24

2 Answers2

6
  1. No, since you would need to enter into an agreement with Google for them to use your data, and they're unlikely to take you seriously unless you're affiliated with an actual transit agency. But if you're curious you can read about the steps involved.

  2. Yes, it's possible, and there are open-source routing engines available for you to use, like OpenTripPlanner and Graphserver. This is pretty heavy-duty stuff, however. If what you have is a basic Web-hosting account and you just want to do "something interesting" with transit data, setting up an online trip planner is probably not the place to start.


I think the most straightforward solution would be for you to run OpenTripPlanner on a server of your own. This would provide your users with a familiar-looking website they can use to generate trip plans from your data while leaving you complete control over the data itself.

Note that running OpenTripPlanner would require a fairly powerful server plus map data from OpenStreetMap (which I'm assuming is available for your area) in addition to your own transit data. On the project's website you'll find setup instructions for Ubuntu to give you an idea of what's involved.

I'm assuming you're already able to generate a GTFS bundle; that is, to produce a ZIP file containing comma-separated data files as specified in the GTFS Reference. With an OpenTripPlanner server set up, your workflow would be as simple as

  1. Making changes to your transit data.

  2. Generating a new GTFS bundle.

  3. Uploading the bundle to a specific folder on your OpenTripPlanner server.

  4. Restarting OpenTripPlanner.

  5. Optionally, notifying your users of the changes.

Every step except the first could be automated with a script.

  • So how does tripplanners work? Do we have to provide the text based files to their algorithm and then get back the rendered feeds or will they require the algorithm to be deployed in our server.. I actually don't get the idea behind this concept on the whole. – Abhilash L R Mar 22 '14 at 08:57
  • Can you elaborate on what it is you're trying to accomplish, Abhilash? It sounds like you want to create your own GTFS feed, then set up a website of your own that will generate trip plans for users from the data, much like Google Maps. Is that right? –  Mar 22 '14 at 12:29
  • Yes. Because I would have users engaged in transit creation on the runtime approved by Moderators. If not, atleast a GTFS feed API that takes my site's transit info every time it is updated and produces a transit response. – Abhilash L R Mar 23 '14 at 13:57
  • Thanks a lot for that detailed explaination! Is it not possible to just extract the data like lat/long and then populate on any map of my choice [say google] ? Now I have another confusion, what would be the output of the OpenTripplanner's GTFS output? would it be like a JSON containing lat/lng, polylines, etc etc or would just contain the transit details? – Abhilash L R Mar 24 '14 at 09:08
  • 1
    Sounds like you have some research to do, Abhilash. If it turns out OpenTripPlanner doesn't give you the information you need out-of-the-box you can always develop a custom user interface on top of it. Have a look at the [OpenTripPlanner Developers Guide](https://github.com/opentripplanner/OpenTripPlanner/wiki/DevelopersGuide) and Google's [Static Maps API Developer Guide](https://developers.google.com/maps/documentation/staticmaps/index). –  Mar 24 '14 at 12:18
0

In response to your first question, Google needs to be informed of the transit feed. Here's the latest link from Google to get you started [https://support.google.com/transitpartners/answer/1106422]. They also require confirmation from an authorised representative of the transit agency that this is an authorised GTFS feed. I should note that txt formats is not strictly correct. The file you need to create is a GTFS file (General Transit Feed Specification). In essence this is a zipped file of mandatory and optional txt files, in CSV format. For you to create the GTFS file, you'll need to create the multiple files based on a detailed understanding of GTFS or use a GTFS Editor/GTFS API like what can be found at AddTransit.

2) You can install routing software on your own servers. However, if Google is using your GTFS data, then another alternative is to create a simple form on your website for customers to enter their from & to locations. You can then use Google's Transit options on Maps to return the proposed route. Here's a simple example that you could extend to meet your needs: https://addtransit.com/blog/2016/01/add-google-maps-public-transport-directions/

Neil
  • 1
  • 1
  • Thanks Neil for taking your time to answer this question. I have a current implementation as you stated on point 2. – Abhilash L R May 07 '16 at 16:37