Skip to content

A pure Rust library that provides GTFS parsing, navigation, time table creation, and real-time network simulation.

License

Notifications You must be signed in to change notification settings

nicomazz/fastgtfs

Repository files navigation

tests Contributors Forks Stargazers Issues MIT License


FastGtfs

fastgtfs-cover

A pure Rust library that provides GTFS parsing, navigation, time table creation and real time network simulation. Already in production with the beta of this android app.


View Web assembly demo · View App Demo · Report Bug · Request Feature

Table of Contents

About The Project

This library is the core of the Venice Navigation&timetables app. The app aims to provide services using GTFS data completely offline. In this way, tourists without an internet plan do not have to worry about public transport. This library was all originally written in C++. To learn RUST, I decided to write it all again (so, yes, this is my first rust project). It has been cross-compiled for Android, and provides several features to the app:

  • Navigation from point A to B, with a slightly modified version of Microsoft's RAPTOR algorithm. This version takes care of real walking path distances and average person preferences when choosing a solution.

  • Creation of timetables for routes with heterogeneous trips. To do that, I do a topological sort on the different trip paths.

  • Simulation of the entire network. Given a trip and a time, it is possible to get the bus's exact position by using interpolation. In the android app, it is possible to see a simulation of the entire Venice bus and water-bus network.

  • Merge of several datasets into a unique data structure.

  • Optimized queries over merged GTFS datasets. See gtfs_data.rs for this.

  • Serialization and deserialization of the raw data structure using Google's flatbuffers. In this way, there is a huge compression. The Android app uses this feature. Every time the app is started, it reads the binary data (in the flatbuffer format) directly into the final data structure, avoiding the slow txt parsing. The parsing requires more time and generates the serialized binary data.

  • Walk time calculator. It uses "HERE" APIs to precompute the real walking times between each stop and the 40 nearest ones. This is done with the walk_distance_calculator crate. It uses parsed stop positions. This is then used in the navigation algorithm.

There are a few basic tests, where they are really needed. From the Android app, it seems it works well!

Usage

For the usage, refer to the tests folder.

License

Distributed under the GNU General Public License v3.0 License. See LICENSE for more information.

Contact

Nicolo' Mazzucato - @nicomazz

Releases

No releases published

Packages

No packages published

Languages