Tuesday, September 27, 2011

Data model diagrams for GTFS

Recently I've been doing some work with the General Transit Feed Specification (GTFS).  This is a simple data model initiated by Google, in order to allow transit organizations to publish their schedules for routing and visualization purposes.

As usual, Google has nice, succinct documentation for the GTFS format (which is a set of CSV files embodying an implicit data model).  But I was surprised to find that they don't provide any kind of data model diagram showing the relationships between the various entities (files) in the model.  I have a feeling that they think this would be "too technical" for users - or maybe they just don't believe in using a long-established body of theory?

So, to help my understanding of GTFS I put together a simple diagram of the data model.  I used Google Diagrams, which is why this looks a little primitive.   (Hmmm... maybe another reason they don't do diagrams is that they are religious about dog-fooding?)

After doing this I found the paper A Transmodel based XML schema for the Google Transit Feed Specification, which has a much more detailed UML model of GTFS:

The end goal of doing all this was to be able to transform a GTFS data feed into shapefile format.  For this I used a simple JEQL script.  But that's another blog post.


James said...

hi there - do you have higher resolution pdf's of these that you can share? i'm having trouble reading it but i think it would be very helpful to have as i'm just starting on a project using gtfs as a db. thanks!

Dr JTS said...

The diagram I did is pretty readable, I think. For the more detailed one, you'll have to contact the authors of the original paper.

Patrick Sunter said...

Hi Martin - I put a link to this post in a page about GTFS I just created on the Appropedia appropriate/sustainable tech wiki :- www.appropedia.org/GTFS .

Would it be OK if I also upload and display your diagram on that page, as long as its attributed to you with a link to your blog?

Thanks, Pat Sunter.

Dr JTS said...

Sure, Pat, that's no problem.

Gestão Empresarial FGV said...

Hi there,
Thanks for the excellent diagram, it helped me so much. I'm modelling a public transport network as a complex network using graph theory, so is not easy to transforma the data files into relevant information, but this model made my work easy.