GTFS-Static Language Agnostic Programmatic Definition

46 views
Skip to first unread message

Carl Hiltbrunner

unread,
Dec 10, 2018, 1:05:05 PM12/10/18
to Transit Developers
Sorry if I double post, I thought I hit post on my last submission, but I haven't seen it on the group.

I was curious if anyone knew about a language agnostic programmatic definition for the GTFS-Static Specification. I know there are a couple projects like the Google TransitFeed that define each text file's field as a Python object for serializing the feed, however this seems a bit clunky, requiring code updates if there is a specification change, and is only usable in Python. Rather than needing to implement each file as a object in a given language, is there some language agnostic programmatic definition that can be used with some ORM to generate classes automatically in whatever language you are using? Let me know if there's something out there that does this already, if it's something that you think would be useful, or if I'm thinking about this the wrong way.

Nikhil VJ

unread,
Dec 13, 2018, 8:06:43 AM12/13/18
to Transit Developers
Hi Carl,

This is only very slightly in the zone you're talking about, but sharing as you might find it useful; it could be something to work up from 

I've made this CSV that my program uses to make decisions on whether rows containing a value are to be deleted if that value is deleted, and about which tables are involved if a particular id value is to be renamed. I decided to implement this to make room for users to bring in more fields (GTFS can be customized with extra columns and files if the agency needs) without having to change the code.


I've found this concept quite beneficial as it greatly reduced the code clutter : I do not have to hard-code for each field and table now : one generic function handles, for example, both a stop_id and a fare_id with the same code. So for me this is an implementation of a "programming definition".


Can you point to an existing example of "a language agnostic programmatic definition" in some other field?

Regards
Nikhil VJ
Pune, India

Devon Barrett

unread,
Dec 13, 2018, 1:54:30 PM12/13/18
to transit-d...@googlegroups.com
Hi Carl,

We're using a set of protocol buffer definitions originally based off of https://github.com/StichtingOpenGeo/gtfs-protobuf

Might be what you're looking for.

Best,
Devon

--
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.
Reply all
Reply to author
Forward
0 new messages