The visualization of the public transport network in Denmark, Finland, Norway, and Sweden relies fully on open data and open source tools. Here are the implementation details of the visualization.
Data
The underlying data consists of national GTFS feeds from Denmark, Finland, Norway and Sweden.
- Data from Denmark is fetched from "GTFS_New.zip" (registration required) by Rejseplanen A/S and is licensed under Creative Commons BY-ND 3.0.
- Data from Finland is fetched from "GTFS.zip" by TRAFICOM and is licensed under Creative Commons BY 4.0.
- Data from Norway is fetched from "rb_norway-aggregated-gtfs.zip" by Entur AS and is licensed under Norwegian Licence for Open Government Data (NLOD) 2.0.
- Data from Sweden is fetched from "gtfs-sverige-2" (registration required) by Samtrafiken AB and is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication.
Visualization
The network is generated by using R and the script is a derivative of work by Gonçalo Trincao Cunha.
Design and layout inspiration from Micha Elmueller.
The script used for this network visualization is available below:
Generating missing shapes.txt
The visualization is dependent on using shapes.txt
, as specified by GTFS. In the feed for Sweden, shapes.txt
is not present. In shapes.txt
of the Norwegian feed, many shapes are not present. For the purpose of this visualization, missing shapes have thus been auto-generated, using the stops along the route to define shapes. As a consequence, these auto-generated shapes are only rough estimates.
For such data manipulation, BlinkTagInc/gtfs-to-mysql have been used to import the GTFS feeds into a MariaDB database. The shapes table have been populated by following script, and then exported to shapes.txt