How are you importing your GTFS feeds?

680 views
Skip to first unread message

Flex Capacitor

unread,
Feb 17, 2012, 5:01:43 AM2/17/12
to Transit Developers
Background:
I created a SQLite database based on the GTFS reference description
(Jan 2011).

After that it took a long time to import the GTFS data feed. In
another earlier post someone said it took 40hrs to import. I don't
remember how long it took for me but I remember it was significant.

How are you importing the data? Are there any existing scripts? Is it
a one time thing or do you regularly update it?

More background:
I'm working on a mobile application. What concerns me is the file size
which can be 100MB or more.

Andrew Byrd

unread,
Feb 26, 2012, 5:15:01 AM2/26/12
to transit-d...@googlegroups.com
On 02/17/2012 11:01 AM, Flex Capacitor wrote:
> After that it took a long time to import the GTFS data feed. In
> another earlier post someone said it took 40hrs to import. I don't
> remember how long it took for me but I remember it was significant.

Importing a GTFS feed into an SQlite database should only take a couple
of minutes at most. Doing each insert in its own separate transaction
could certainly cause an enormous slowdown -- you want to do all the
inserts in a single transaction then commit the transaction at the end.
(see http://www.sqlite.org/faq.html#q19)

It sounds like you are looking for Graphserver's GTFSDB:
https://github.com/graphserver/graphserver/blob/master/pygs/graphserver/ext/gtfs/gtfsdb.py

-Andrew

Brian Ferris

unread,
Feb 27, 2012, 3:53:01 AM2/27/12
to transit-d...@googlegroups.com
I'd also add:


which is a Python GTFS library that imports to SQLite internally and:
 

which is a Java GTFS library for reading and writing GTFS, which has database support for any DB supported by Hibernate, including SQLite.

In terms of mobile apps, instead of loading schedule data onto the phone itself, you might consider writing a server side app that has all your schedule data and is queried by your mobile app when it needs data.  That way you don't need to load the entire schedule database onto the phone and you can update your schedule data without need to update the app.

Thanks,
Brian 




--
You received this message because you are subscribed to the Google Groups "Transit Developers" group.
To post to this group, send email to transit-developers@googlegroups.com.
To unsubscribe from this group, send email to transit-developers+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/transit-developers?hl=en.


Reply all
Reply to author
Forward
0 new messages