GithubHelp home page GithubHelp logo

jtszalay / django-multi-gtfs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tulsawebdevs/django-multi-gtfs

0.0 1.0 0.0 450 KB

Django app to import and export General Transit Feed Specification (GTFS)

Home Page: http://tulsawebdevs.org/

License: Apache License 2.0

Python 99.97% Shell 0.03%

django-multi-gtfs's Introduction

multigtfs: GTFS as a Django app

multigtfs is an Apache 2.0-licensed Django app that supports importing and exporting of GTFS feeds. All features of the June 20, 2012 reference are supported. It allows multiple feeds to be stored in the database at once.

It requires a spatial databases compatible with GeoDjango. PostgreSQL 9.x and PostGIS 2.x are recommended for development and production, since these support all the GeoDjango features. There are issues with GeoDjango in Django 1.4 (see #20036), so Django 1.5 or above is recommended.

Usage

Installation

  1. pip install multigtfs
  2. In your settings, add multigtfs to your INSTALLED APPS and ensure you have a spatial database configured.
  3. ./manage.py syncdb to install the tables, or ./manage.py migrate if you are using South

Management Commands

There are two management commands to get GTFS feeds in and out of the database:

./manage.py importgtfs [--name name_of_feed] path/to/gtfsfeed.zip
./manage.py exportgtfs [--name basename_of_file] <feed_id>

In Code

multigtfs is composed of Django models that implement GTFS, plus helper methods for importing and exporting to the GTFS format. Where GTFS relates objects through IDs (such as Stop IDs for stops), multigtfs uses ForeignKeys.

multigtfs includes a Feed object, which is not part of GTFS. This is used to include several feeds in the same file without collisions. These can be feeds from different agencies, or different versions of a feed from the same agency. The object has a helper method, in_feed, that is sometimes useful in filtering objects by feed. At other times, it is easier to start at the feed and follow relations.

There isn't separate documentation yet. Load the app in your Django project, play with the admin, and read the source code to learn more.

Project History

multigtfs was first developed for the Tulsa Web Devs' project to get Tulsa's buses into Google Maps. tulsa-transit-google is the Tulsa-specific portion, and multigtfs contains the parts useful for any GTFS effort. Tulsa's bus schedule appeared on Google Maps in July 2013, after a two-year effort. The Tulsa Web Devs founded Code for Tulsa to collaborate on future civic tech projects.

The conversion to GeoDjango in February 2014 was generously sponsored by MRCagney.

Future

Upcoming features include:

  • A sample project
  • Validating the feed against Google's requirements
  • More documentation
  • More flexible GTFS imports and exports (longer values, extra columns)

See the issues list for more details.

django-multi-gtfs's People

Contributors

jtszalay avatar jwhitlock avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.