2

I'm first time trying to use GTFS(General Transit Feed Specification) with Google Maps as per the Google developers page i have understood the concept of .txt files which are used as feed and for making a demo i downloaded a transit zip files from Google developers page. but I'm not getting how to use those transit files to show information on map. I tried to search tutorial for the same but could not find anything useful. Do i need to parse all those files to show in map or there is something different implementation.

I'm confused.

Please bear me with my lack of knowledge regarding GTFS.

Vinod Louis
  • 4,812
  • 1
  • 25
  • 46
  • GTFS = Google Transit Feed Specification if anyone else was wondering.. https://developers.google.com/transit/gtfs/ – Duncan_m Aug 07 '13 at 06:02
  • yes i have gone through the documentation but i did not find any useful resource of how to access the transit zip files in Maps – Vinod Louis Aug 07 '13 at 06:04

2 Answers2

3

If you want to display stops and routes on a map, you can use gtfs-to-geojson to convert GTFS to GeoJSON that can be loaded onto a Google Map or Mapbox.

Install gtfs-to-geojson:

npm install gtfs-to-geojson -g

Setup a config.json file, then run:

gtfs-to-geojson --configPath /path/to/your/config.json

The tool will output a folder of GeoJSON files.

Brendan Nee
  • 5,087
  • 2
  • 33
  • 32
2

As far as I know, GTFS is not yet "plug and play" ready - there's no simple way to just load up a GTFS dataset and work with it or query it on Google Maps, using either Google's web interface or their Javascript libraries.

Getting this working requires:

  1. Setting up a (SQL) database and importing the GTFS dataset into that database.
  2. Setting up a query system to get the information you want out of the SQL database (e.g., a web front-end that queries the database backend).

Feel free to look at some examples from around the web:

David Pritchard
  • 300
  • 3
  • 5