[Open-transport] Hafas Raw Data Format to GTFS conversion (Zürich)

Stefan Wehrmeyer stefan.wehrmeyer at okfn.org
Thu Jun 20 09:10:49 UTC 2013

Hi everyone,

thanks for your hints and tips. A very basic version is done that generates valid GTFS for the one small dataset that I have (only the coordinate conversion from Gauß-Krüger needs some more tweaking). It doesn't generate valid GTFS for the other huge dataset I have.
There's lots more features in the data format and some should be ported over. Please open issues!

The KVB of Cologne contracted a tool that does this conversion, but it probably won't be free and Open Source and it will cost a lot of money (I heard a mid 5 digit sum).

> Out of curiosity, is this hafas raw data of CFF available as official
> opendata or is some CD or software dump?

I believe you can request data from the Swiss SBB and they have to give it to you by law, if I'm not completely mistaken.
I will talk to my contact there and try to figure some stuff out.


On 18.06.2013, at 20:22 , Thomas <thomaskoch at gmail.com> wrote:

> Some tips for the stops.txt. 
> You also have platforms (GLEIS?), if you want consumers to get this information you have to create a stop in stops.txt for every platform.
> On Tue, Jun 18, 2013 at 8:21 PM, Thomas <thomaskoch at gmail.com> wrote:
> Actually i never put any effort in calendar.txt compression. It's major pain in the butt and can be already be done by GTFS transformer of OneBusAway.
> Anyway extended your code with calendar_dates.txt conversion from the bitfields and writing to csv, pull request is already on your way.
> https://github.com/skywave/hafas2gtfs/commit/6ad43954fbd05bdb2cee94b6d5b08cec31e4feed
> On Tue, Jun 18, 2013 at 7:59 PM, Stefan de Konink <stefan at konink.de> wrote:
> On Tue, 18 Jun 2013, Stefan Wehrmeyer wrote:
> Hafas defines the Bitfield (I already extracted that) to define services across the whole schedule. GTFS defines the validity of services only across a week. Bringing this together is tricky.
> You could also use calendar_dates.txt, but Thomas is a magician with compressing those back into week schedules ;)
> Stefan

More information about the open-transport mailing list