Zagreb/Import ZET GTFS

From OpenStreetMap Wiki
Jump to navigation Jump to search

Importing ZET GTFS data is an import of Zagrebački električni tramvaj public transport dataset which is of type GTFS covering Zagreb and surroundings. The import is currently (as of 2020-12-05) at the planning stage.

Goals

Import station IDs to OSM so we can see if our routes have correct station order.

Schedule

The import should go through in December 2020.

Import Data

Background

Data source site: https://www.zet.hr/odredbe/datoteke-u-gtfs-formatu/669
Data license: http://data.gov.hr/otvorena-dozvola
Type of license: Otvorena dozvola
Link to permission: http://imamopravoznati.org/request/dopustenje_za_unos_podataka_iz_g
OSM attribution (if required): https://wiki.openstreetmap.org/wiki/Contributors#City_of_Zagreb
ODbL Compliance verified: yes

Import Type

This is a mostly automated import that uses OSM_Conflator. It will be possible to run it in the future and check if it is still valid. The code used to run OSM Conflator is on Github[1].

Data Preparation

Tagging Plans

Tags that will be put in and conflated:

gtfs:stop_id=* < stop_id from the stops.txt in the GTFS file

official_name=* < stop_name from the stops.txt in the GTFS file

highway=bus_stop

bus=yes

tram=yes

public_transport=platform

source=Zagrebački električni tramvaj

Changeset Tags

comment=Import ZET GTFS

source=Zagrebački električni tramvaj

Data Merge Workflow

Team Approach

The data is pretty straightforward, so Janko Mihelić will do the whole import. A team effort will consist of subsequent entering of public transport routes, and tools which will check the right order of stations in a route. Wrong data in this import will pop up in that phase of GTFS import.

Dedicated user account

The user under which the import will be done is called Import Zet[2].

Workflow

There will be several steps to do the import. OpenStreetMap has one to several public transport stations for each station in the GTFS file. OSM_Conflator can't handle conflating one to many points, so there will have to be several passes. Each time OSM_Conflator will convert one of those stations, and add a gtfs:stop_id=* tag on it. Next time the script is run, it will search for stations without the gtfs:stop_id=* tag, and thus will conflate the second pass. This will continue until Overpass returns no more data.

  1. Adding gtfs:stop_id=* and official_name=* to all public_transport=platform that don't already have gtfs:stop_id=*, and whose name starts with the same letter as the stop in GTFS data. Do it as many times as you find new stations matched. Each time the .osm changeset file is edited such that all added nodes are deleted, so only those with action="modify" are left.
  2. Adding gtfs:stop_id=* and official_name=* to all railway=tram_stop that don't already have gtfs:stop_id=*, and whose name starts with the same letter as the stop in GTFS data. Do it as many times as you find new stations matched. Each time the .osm changeset file is edited such that all added nodes are deleted, so only those with action="modify" are left.

QA

There is a tool that already tests public transport routes of Zagrebački električni tramvaj [3]. Until now, it wasn't able to test if the stations were put in in the right order, but now with the IDs, it will be able to. In the same time, it will find if there is a bad ID put in with this import.

See also

The email to the Imports mailing list was sent on YYYY-MM-DD and can be found in the archives of the mailing list at [4].