how get information from gtfs to json?

65 views
Skip to first unread message

Jhonatan Santofimio

unread,
Jun 7, 2022, 7:01:26 PMJun 7
to GTFS-realtime
how get information from gtfs to json?

Bodo Minea

unread,
Jun 7, 2022, 7:14:10 PMJun 7
to gtfs-r...@googlegroups.com
What information do you want to extract (only stops, only schedules, stops per line, schedule per line, etc.) and how do you need it delivered - as a one time conversion or as a service? Also, are you familiar with a particular programming language?

This is a complex matter that will depend on your desired implementation strategy, agency size and available computational resources.

Also, you have asked about „GTFS to JSON” but this is the GTFS-Realtime group. These are two linked but distinct standards. What it is exactly you want to convert - „static” GTFS timetable/route description data that's given as a ZIP file/folder of multiple txt files or a real-time trip updates/service alerts/vehicle positions feed that you're grabbing as a protocol buffer from a link?

We'd be glad to assist you here on the group but much more context is needed to offer helpful advice.

Have a nice evening!

Best regards,
Bogdan.

În mie., 8 iun. 2022 la 02:01, Jhonatan Santofimio <jhonat...@hotmail.com> a scris:
how get information from gtfs to json?

--
You received this message because you are subscribed to the Google Groups "GTFS-realtime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gtfs-realtim...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gtfs-realtime/8060cd7c-cb44-40e8-afa0-bdb0038d36b9n%40googlegroups.com.

Jhonatan Santofimio

unread,
Jun 18, 2022, 5:40:34 PMJun 18
to GTFS-realtime
thank you for you email

 They sent me some accesses of a username and password link, when I enter through the browser it asks me for these accesses, the income and it does not go beyond a black page, and it sends me a .zip or .rar file with a bit of encrypted letters in response . that's what has me confused.

Jhonatan Santofimio

unread,
Jun 18, 2022, 5:44:42 PMJun 18
to GTFS-realtime
this its my end point but i dont know with the access send me back one file encript the others apis just put the api key in the link and work in postman  http://app.citi-mb.mx/GTFS-RT/actualizacionViaje

thank you

El martes, 7 de junio de 2022 a la(s) 19:14:10 UTC-4, bodo...@gmail.com escribió:

Bodo Minea

unread,
Jun 19, 2022, 8:04:17 AMJun 19
to gtfs-r...@googlegroups.com
Hi, that link is a GTFS-RealTime trip-updates feed. It is in protocol buffer format. Google explains how it works here - https://developers.google.com/transit/gtfs-realtime/reference, how it is structured here - https://developers.google.com/transit/gtfs-realtime/gtfs-realtime-proto and code samples are here - https://developers.google.com/transit/gtfs-realtime/examples/code-samples

So that link offers you a binary file that you have to decode - it contains information about schedule adherence (on time/delayed/advanced/cancelled) of specific trips, but it is only useful if you have also imported the static GTFS before.

There are libraries for both of these tasks. For example, if you use NodeJS you can parse the static GTFS schedules with https://github.com/TransitApp/gtfsNodeLib and parse the real-time feed with https://www.npmjs.com/package/gtfs-realtime-bindings. You will have to write your own trip-matching logic. Depending on your use case, you may be better-off with a ready-made solution like OpenTripPlanner if the end goal is to offer transit planning within an app.

For further assistance you'll need to give out more information. You can contact me in private and tell me what programming language you use, give me the GTFS zip file and credentials for that link above and I'll try to spin up a working code example for you.





--
Reply all
Reply to author
Forward
0 new messages