This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
gtfs [2018/12/13 13:54] mantis created |
gtfs [2021/09/06 14:27] mstraub |
||
---|---|---|---|
Line 6: | Line 6: | ||
GTFS Spezification: https://developers.google.com/transit/gtfs/reference/ | GTFS Spezification: https://developers.google.com/transit/gtfs/reference/ | ||
- | Routes are equivalent to "Lines" in public transportation systems. Routes are defined in the file routes.txt, and are made up of one or more Trips. | + | Check out https://github.com/CUTR-at-USF/awesome-transit for an up to date list of GTFS sources, tools and more. |
- | A Trip represents a journey taken by a vehicle through Stops. Trips are time-specific — they are defined as a sequence of StopTimes, so a single Trip represents one journey along a transit line or route. | + | |
- | A StopTime defines when a vehicle arrives at a location, how long it stays there, and when it departs. | + | * Routes are equivalent to "Lines" in public transportation systems. Routes are defined in the file routes.txt, and are made up of one or more Trips. |
+ | * A Trip represents a journey taken by a vehicle through Stops. Trips are time-specific — they are defined as a sequence of StopTimes, so a single Trip represents one journey along a transit line or route. | ||
+ | * A StopTime defines when a vehicle arrives at a location, how long it stays there, and when it departs. | ||
===== Data ===== | ===== Data ===== | ||
- | Worldwide: https://transitfeeds.com/feeds | + | Worldwide: |
+ | https://transitfeeds.com/feeds | ||
+ | https://transit.land/feed-registry/ | ||
+ | |||
+ | Switzerland: https://opendata.swiss/de/dataset/timetable-2019-gtfs | ||
+ | |||
+ | Vienna: https://www.data.gv.at/katalog/dataset/ab4a73b6-1c2d-42e1-b4d9-049e04889cf0 | ||
===== Tools ===== | ===== Tools ===== | ||
+ | |||
+ | ==== OneBusAway (Java/CLI) ==== | ||
+ | |||
+ | [[https://github.com/OneBusAway/onebusaway/wiki|OneBusAway]] is a library for transforming and merging GTFS data sets. Amongst others it features two handy CLIs: | ||
+ | |||
+ | [[http://developer.onebusaway.org/modules/onebusaway-gtfs-modules/current/onebusaway-gtfs-transformer-cli.html|http://developer.onebusaway.org/modules/onebusaway-gtfs-modules/current/onebusaway-gtfs-transformer-cli.html]]\\ | ||
+ | [[http://developer.onebusaway.org/modules/onebusaway-gtfs-modules/current/onebusaway-gtfs-merge-cli.html|http://developer.onebusaway.org/modules/onebusaway-gtfs-modules/current/onebusaway-gtfs-merge-cli.html]] | ||
+ | |||
+ | Note, that the download links in the documentation are no longer updated, find the latest versions here:\\ | ||
+ | [[http://nexus.onebusaway.org/nexus/content/groups/public/org/onebusaway/onebusaway-gtfs-transformer-cli|http://nexus.onebusaway.org/nexus/content/groups/public/org/onebusaway/onebusaway-gtfs-transformer-cli]]\\ | ||
+ | [[http://nexus.onebusaway.org/nexus/content/groups/public/org/onebusaway/onebusaway-gtfs-merge-cli|http://nexus.onebusaway.org/nexus/content/groups/public/org/onebusaway/onebusaway-gtfs-merge-cli]] | ||
+ | |||
+ | === Example: remove AST === | ||
+ | |||
+ | no_ast.txt: | ||
+ | |||
+ | <file> | ||
+ | {"op":"remove","match":{"file":"routes.txt","route_short_name":"AST AST"}} | ||
+ | {"op":"remove","match":{"file":"routes.txt","route_short_name":"AST AST Maxi"}} | ||
+ | </file> | ||
+ | |||
+ | <code> | ||
+ | java -jar onebusaway-gtfs-transformer-cli-1.3.X.jar --transform=remove_ast.txt gtfs.zip gtfs_without_ast.zip | ||
+ | </code> | ||
+ | |||
+ | === Example: only keep two lines from a whole dataset === | ||
+ | |||
+ | <code> | ||
+ | java -jar onebusaway-gtfs-transformer-cli-1.3.34.jar --transform='{"op":"retain", "match":{"file":"routes.txt", "route_short_name":"31"}}' --transform='{"op":"retain", "match":{"file":"routes.txt", "route_short_name":"33A"}}' gtfs_vienna.zip gtfs_vienna_only31+33A.zip | ||
+ | </code> | ||
Line 36: | Line 74: | ||
Comes with some command line tools | Comes with some command line tools | ||
- | * feedvalidator | + | * feedvalidator |
- | * kmlwriter | + | * kmlwriter |
- | ==== Others ==== | ||
+ | ==== Python ==== | ||
- | R package by ROpenSciLabs https://github.com/ropenscilabs/gtfsr | + | * [[https://github.com/kotrc/GTFS-route-shapes|python script to convert GTFS to geojson]] |
- | Javascript by Conveyal https://github.com/conveyal/gtfs-data-manager | + | * [[https://pygtfs.readthedocs.io/en/latest/index.html|pygtfs (seems outdated)]] |
- | FME https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_ReadersWriters/gtfs/gtfs.htm | + | |
+ | ==== Others ==== | ||
+ | |||
+ | * JavaScript based GUI (runs in browser) https://github.com/WRI-Cities/static-GTFS-manager | ||
+ | * R package by ROpenSciLabs https://github.com/ropenscilabs/gtfsr | ||
+ | * Javascript by Conveyal https://github.com/conveyal/gtfs-data-manager | ||
+ | * FME https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_ReadersWriters/gtfs/gtfs.htm | ||
====== Working with GTFS ====== | ====== Working with GTFS ====== | ||
Line 50: | Line 94: | ||
- | On receiving a GTFS archive | + | ===== On receiving a GTFS archive ===== |
Use transitfeeds feedvalidator.py on a zip file to obtain a detailed report on the data quality. | Use transitfeeds feedvalidator.py on a zip file to obtain a detailed report on the data quality. | ||
- | Loading in Java | + | |