Disclaimer: It's a EXPERIMENTAL tool for explore GTFS data. It's not a complete production, more like sort of notes of me on learning GTFS.
GTFS = General Transit Feed Specification
- Single Page App
- Load minimum data for display information, not load all the city's data entirely
- Go back and forword the history of map view
- Friendly UI
- GTFS data parser, from GTFS to Django's dump data format
- PostGIS 2
- Django 1.6 (virtualenv is highly recommended.)
- GTFS data (Auckland's data is included)
It's very simple.
- Download Postgres.app, it also contains PostGIS, so sweet.
- Install
GDAL Complete
from http://www.kyngchaos.com/software/frameworks
And then,
$ virtualenv env
$ . env/bin/activate
$ pip install -r requirements.txt
$ # Done!
First, prepare the database.
$ # add PostGIS Apt source, you might need sudo if you are not root
$ echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list
$ wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
$ apt-get update
$ apt-get install postgresql-9.3 postgresql-9.3-postgis
$ su - postgres
$ createuser --createdb -P gtfs # input password here, twice
$ createdb -O gtfs gtfs
$ psql gtfs
gtfs=# CREATE EXTENSION postgis;
gtfs=# \q
And, install gdal and PostgreSQL-dev for compiling python's library psycopg2
$ apt-get install binutils libproj-dev gdal-bin
$ apt-get install libpq-dev
And the same here,
$ virtualenv env
$ . env/bin/activate
$ pip install -r requirements.txt
$ # Done!
First of all, you sould prepare the database named gtfs
by default of PostgreSQL with PostGIS extension. I would assume that you could do this and skip this step. If you do not know how to do this, check GeoDjango installation documents out first, I'm pretty sure they can help you.
You can find this GTFS data on http://www.gtfs-data-exchange.com/agency/auckland-transport/.
$ wget http://gtfs.s3.amazonaws.com/auckland-transport_20140416_0216.zip
$ unzip auckland-transport_20140416_0216.zip -d Feed_2014-03-12
$ python explorer/data/gtfs2django_data.py Feed_2014-03-12 > init_data.json
$ ./manage.py syncdb # create the table
$ ./manage.py loaddata init_data.json
$ ./manage.py update_index # create the search indexes
$ # Done!
TODO
Copyright (c) 2014 Chuangbo Li Licensed under the MIT license.