Frage

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

War es hilfreich?

Lösung

  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.

Andere Tipps

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/

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top