stevekirks / gtfs-protobuf-to-trips-rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GTFS Protobuf to Trips (in Rust)

This project contains code to take a short timespan of GTFS Realtime data from a protobuf feed and tranform it for visualisation on a loop in deck.gl trips.

I wrote it in Rust as a learning experience.

Usage

Clone this repo, set data specific settings in the AppSettings class in main.rs. Then:

cargo run

Protobuf rust file generation

gtfs_realtime.rs was generated from

extern crate protoc;
extern crate protoc_rust;

use protoc_rust::Codegen;

fn main() {
    Codegen::new()
        .protoc_path("C:/dev/temp/protobuf/protoc.exe")
        .out_dir("src/protos")
        .include("C:/dev/temp/protobuf/")
        .inputs(&["C:/dev/temp/protobuf/gtfs-realtime.proto"])
        .run()
        .expect("protoc");
}

and Cargo.toml

...
[dependencies]
protoc = "2.24"
protoc-rust = "2.24"

About


Languages

Language:Rust 100.0%