且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将gtfs实时数据流化为人类可读格式

更新时间:2022-12-18 09:29:08

正如其他提到的那样,gtfs实时文件是二进制文件,需要特殊的Protocol Buffer编译代码来解析.使用Base64解码将无济于事.

As others mentioned, the gtfs-realtime files are binary and require the special Protocol Buffer compiled code to parse. You're not going to get anywhere with Base64 decoding.

但是,如果您仅尝试将gtfs实时文件解析为人类可读的格式,我编写了一个独立工具,可将GTFS实时文件转换为JSON:

However, if you're ONLY trying to parse gtfs-realtime files into a human-readable format, I wrote a standalone tool that converts GTFS-realtime into JSON: https://github.com/harrytruong/gtfs_realtime_json

只需下载(无需安装),然后运行:gtfs_realtime_json <feed_url>

Just download (no install), and run: gtfs_realtime_json <feed_url>

这是示例JSON输出.