Best database for GTFS?

1,780 views
Skip to first unread message

samuel....@gmail.com

unread,
Jan 16, 2015, 7:21:33 PM1/16/15
to transit-d...@googlegroups.com
I'm working on a site to find places that you can get to without a car (by bus, bike, walking, etc) in Python. Currently, I'm using SQLAlchemy with SQLite, because I thought an ORM would be best for this sort of data. While being able to write something like "stop_time.trip.route.route_short_name" and get that without having to do a bunch of queries is nice, the ORM is too slow to be practical, and if I'm just writing a bunch of queries there's no need for SQLAlchemy, so I'm looking for another database and/or library to use. What do you use for storing GTFS data?

andrew byrd

unread,
Jan 16, 2015, 9:07:03 PM1/16/15
to transit-d...@googlegroups.com
Hello,

The approach we've been working with the most lately is a disk-backed
storage engine that exposes the Java Map interface. This is not Python
but we're building up a GTFS loader library based on the MapDB library
if you want to check it out:

https://github.com/opentripplanner/OpenTripPlanner/tree/master/src/main/java/com/conveyal/gtfs

-Andrew
> --
> You received this message because you are subscribed to the Google Groups
> "Transit Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to transit-develop...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

John Whitlock

unread,
Jan 16, 2015, 9:37:22 PM1/16/15
to transit-d...@googlegroups.com
My project, django-multi-gtfs, uses GeoDjango and PostgreSQL with PostGIS, to facilitate spatial queries:



On Fri, Jan 16, 2015 at 6:21 PM, <samuel....@gmail.com> wrote:
I'm working on a site to find places that you can get to without a car (by bus, bike, walking, etc) in Python. Currently, I'm using SQLAlchemy with SQLite, because I thought an ORM would be best for this sort of data. While being able to write something like "stop_time.trip.route.route_short_name" and get that without having to do a bunch of queries is nice, the ORM is too slow to be practical, and if I'm just writing a bunch of queries there's no need for SQLAlchemy, so I'm looking for another database and/or library to use. What do you use for storing GTFS data?

--

Brendan Nee

unread,
Jan 17, 2015, 2:21:48 PM1/17/15
to transit-d...@googlegroups.com
node-gtfs converts a GTFS file into a mongodb database.  It also includes an example app that creates an API and front-end for querying some things like agencies, routes and stops.


</brendan>

Frank P

unread,
Jan 18, 2015, 2:53:00 PM1/18/15
to transit-d...@googlegroups.com
Hey Sam,  I use PostGIS and SQLAlchemy + GeoAlchemy via gtfsdb (https://code.google.com/p/gtfsdb/), and get acceptable performance out of these tools for things like stop schedules and nearest stops (crow fly).  See: http://trimet.org/ride/stop_select_form.html

That said, it sounds like you want to do routing, so you're best to use OpenTripPlanner for that...
Reply all
Reply to author
Forward
0 new messages