All Projects → artonge → go-gtfs

artonge / go-gtfs

Licence: GPL-3.0 license
Load GTFS files in golang

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go-gtfs

Rrrr
RRRR rapid real-time routing
Stars: ✭ 134 (+318.75%)
Mutual labels:  gtfs
transxchange2gtfs
tool to convert transxchange data into a GTFS feed
Stars: ✭ 26 (-18.75%)
Mutual labels:  gtfs
theweekendest
Real-time New York City subway service map
Stars: ✭ 51 (+59.38%)
Mutual labels:  gtfs
R5
Routing engine for multimodal (transit/bike/walk/car) networks with a particular focus on public transit.
Stars: ✭ 153 (+378.13%)
Mutual labels:  gtfs
concentrate
Concentrate: combine realtime transit files
Stars: ✭ 23 (-28.12%)
Mutual labels:  gtfs
mapzen-gtfs
Python library for reading and writing GTFS feeds
Stars: ✭ 27 (-15.62%)
Mutual labels:  gtfs
Peartree
peartree: A library for converting transit data into a directed graph for sketch network analysis.
Stars: ✭ 116 (+262.5%)
Mutual labels:  gtfs
fastgtfs
A pure Rust library that provides GTFS parsing, navigation, time table creation, and real-time network simulation.
Stars: ✭ 21 (-34.37%)
Mutual labels:  gtfs
dtd2mysql
MySQL / MariaDB import for DTD feeds (fares, timetable and routeing)
Stars: ✭ 25 (-21.87%)
Mutual labels:  gtfs
european-transport-operators
NOT UP-TO-DATE ANYMORE, UNMAINTAINED. CHECK european-transport-feeds INSTEAD. List of european long-distance transport operators, available API endpoints, GTFS feeds and client modules.
Stars: ✭ 47 (+46.88%)
Mutual labels:  gtfs
Onebusaway Application Modules
The core OneBusAway application suite.
Stars: ✭ 174 (+443.75%)
Mutual labels:  gtfs
linked-connections-server
Express based server that exposes Linked Connections.
Stars: ✭ 12 (-62.5%)
Mutual labels:  gtfs
GTFS-Issues
Dokumentation und Verfolgung aktueller Probleme deutschsprachiger GTFS-Datensätze
Stars: ✭ 24 (-25%)
Mutual labels:  gtfs
Urbanaccess
A tool for GTFS transit and OSM pedestrian network accessibility analysis
Stars: ✭ 137 (+328.13%)
Mutual labels:  gtfs
goodservice
Website that detects headway discrepancy on New York City Subway system using live countdown clocks
Stars: ✭ 26 (-18.75%)
Mutual labels:  gtfs
Gtfs To Html
Build human readable transit timetables as HTML or PDF from GTFS.
Stars: ✭ 119 (+271.88%)
Mutual labels:  gtfs
gtfs-osm-sync
Synchronizes public transportation data in GTFS format with OpenStreetMap.org
Stars: ✭ 85 (+165.63%)
Mutual labels:  gtfs
GTFS
Public transport data in GTFS format with schemas, a data package and tests
Stars: ✭ 20 (-37.5%)
Mutual labels:  gtfs
mapnificent cities
City data repository for mapnificent.net
Stars: ✭ 49 (+53.13%)
Mutual labels:  gtfs
gtfstools
General Transit Feed Specification (GTFS) Editing and Analysing Tools
Stars: ✭ 31 (-3.12%)
Mutual labels:  gtfs

go-gtfs

Load GTFS files in Go.

godoc for artonge/go-gtfs

Go goreportcard for artonge/go-gtfs

PRs Welcome

The project is in maintenance mode.

It is kept compatible with changes in the Go ecosystem but no new features will be developed. PR could be accepted.

Install

go get github.com/artonge/go-gtfs

Examples

Load one directory containing GTFS files:

path/to/gtfs_files
├── agency.txt
├── calendar_dates.txt
├── calendar.txt
├── routes.txt
├── stops.txt
├── stop_times.txt
├── transfers.txt
└── trips.txt
g, err := gtfs.Load("path/to/gtfs_files", nil)

Load a directory containing sub directories containing GTFS files:

path/to/gtfs_directories
├── gtfs1
│   ├── agency.txt
│   ├── calendar_dates.txt
│   ├── routes.txt
│   ├── stops.txt
│   ├── stop_times.txt
│   ├── transfers.txt
│   └── trips.txt
└── gtfs2
    ├── agency.txt
    ├── calendar_dates.txt
    ├── calendar.txt
    ├── routes.txt
    ├── stops.txt
    ├── stop_times.txt
    ├── transfers.txt
    └── trips.txt
gs, err := gtfs.LoadSplitted("path/to/gtfs_directories", nil)

You can then access the data through the GTFS structure. That structure contains arrays of approriate structures for each files.

type GTFS struct {
	Path       string // The path to the containing directory
	Agency     Agency
	Routes     []Route
	Stops      []Stop
	StopsTimes []Stop
	Trips      []Trip
	Calendars  []Calendar
	Transfers  []Transfer
}

type Route struct {
	ID        string `csv:"route_id"`
	AgencyID  string `csv:"agency_id"`
	ShortName string `csv:"route_short_name"`
	LongName  string `csv:"route_long_name"`
	Type      int    `csv:"route_type"`
	Desc      string `csv:"route_url"`
	URL       string `csv:"route_desc"`
	Color     string `csv:"route_color"`
	TextColor string `csv:"route_text_color"`
}

...

Contributions

Pull requests are welcome ! :)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].