Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/denysvitali/gtfs-server
A General Transit Feed Specification (GTFS) server written in Rust
https://github.com/denysvitali/gtfs-server
api gtfs rust server transport
Last synced: about 2 months ago
JSON representation
A General Transit Feed Specification (GTFS) server written in Rust
- Host: GitHub
- URL: https://github.com/denysvitali/gtfs-server
- Owner: denysvitali
- License: mit
- Created: 2018-03-06T22:44:57.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T02:02:08.000Z (about 2 years ago)
- Last Synced: 2024-10-11T00:51:26.694Z (2 months ago)
- Topics: api, gtfs, rust, server, transport
- Language: Rust
- Homepage: https://denysvitali.github.io/gtfs-server
- Size: 2.41 MB
- Stars: 31
- Watchers: 4
- Forks: 5
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-transit - gtfs-server - A web server, written in Rust that uses PostGIS as a backend to serve GTFS data via a HTTP endpoint (Uncategorized / Uncategorized)
- awesome-transit - gtfs-server - A web server, written in Rust that uses PostGIS as a backend to serve GTFS data via a HTTP endpoint (Uncategorized / Uncategorized)
README
# GTFS Server
A [General Transit Feed Specification (GTFS)](https://en.wikipedia.org/wiki/General_Transit_Feed_Specification) server to expose
some REST APIs.## Requirements
- Rust (Nightly, preferably)
- PostgreSQL with GIS ([PostGIS](http://www.postgis.org/))
- (Docker)### Data Visualization (not required)
- QGIS## Instructions
### Download & Extract a feed
```bash
mkdir resources/gtfs/sbb/
wget https://opentransportdata.swiss/en/dataset/timetable-2018-gtfs/permalink -O resources/gtfs/sbb/gtfs.zip
cd resources/gtfs/sbb/
unzip gtfs.zip
```### Deploy with Docker
#### PostGIS
```
docker network create --subnet=172.18.0.0/16 gtfs-server-net
docker run --name gtfs-server-db --net gtfs-server-net --ip 172.18.0.2 -e POSTGRES_PASSWORD=mysecretpassword -d mdillon/postgis
```### Run the server
```
cargo run
```### Check if the data was imported
http://127.0.0.1:8080/api/stops### Data import
`feed-id` is your feed unique identifier. It will be used across the DB to generate the stop IDs.
This will allow us to filter out the feeds that are no longer actives once the DB is populated.
#### Stops
http://127.0.0.1:8080/api/import/stops/feed-id#### Trips
http://127.0.0.1:8080/api/import/stops/feed-id## Endpoints & Objects
Check the [Documentation](https://denysvitali.github.io/gtfs-server/) for more info about the endpoints and the objects.## Screenshots
### /api/trips/``
![/api/trips/](screenshots/1.png)
### /api/stops/
![/api/stops/](screenshots/2.png)
### /api/stops/near/``/``/``
![/api/stops/near///](screenshots/3.png)