Protobuf和Translink
我发现了我想使用的GTFS数据,但是IDK如何设置Protobuf(最好是在Python中)读取数据。任何帮助将不胜感激。谢谢。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我发现了我想使用的GTFS数据,但是IDK如何设置Protobuf(最好是在Python中)读取数据。任何帮助将不胜感激。谢谢。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
首先,您需要从 github :
second,compile
gtfs-realtime.proto
使用以下命令:protoc -i =。 -python_out =。 ./gtfs-realtime.proto
这将在当前目录中查找
gtfs-realtime.proto
,并生成.py> .py
文件>您可以在您的中导入的文件项目。有关更多信息,请查看 this教程。那是针对Protobuf的部分。
我没有GTF的经验,但是我想这个样本可能会帮助您。
First, you need to download the protocol compiler from here. According to Protobuf guide on GitHub:
Second, compile
gtfs-realtime.proto
using following command:protoc -I=. --python_out=. ./gtfs-realtime.proto
This will look for
gtfs-realtime.proto
in the current directory and generates a.py
file which you can import in your project. For more information, check out this tutorial.That's for the Protobuf part.
I don't have experience with GTFS, but I guess this sample may help you.