Skip to content

faq 132284417

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

About create Transitschedule.xml file

by cui yi on 2017-12-12 15:01:39


Dear professor :

Now, I face a problem to create the TransitSchedule.xml file. The OSM file has been download, but in the Josm (have the piugin MATSim) MATSim menu “export Matsim transit schedule” can not work. May I have your some suggestions? And I also want to know, is this the right way to to create this file, or any other menthods?

Thank you!


Comments: 2


Re: About create Transitschedule.xml file

by Gregor Leich on 2017-12-14 10:22:19

(Moved to answer field)

As far as I know, the JOSM-Plugin focuses on network generation and manipulation. As the readme says:

"This is a plug-in for JOSM, the OpenStreetMap editor, which lets you preview, edit and save a MATSim network directly from the map."

Osm data does not contain any information on departure or arrival times, so there simply is not enough data to extract a usable TransitSchedule.xml. There is a package "gtfs" with a class "LineBrowser" in the JOSM-Plugin, but that rather seems like a viewer and not like a full GTFS to MATSim TransitSchedule.xml converter.

However, the JOSM-Plugin allows to import network routes of TransitRoutes (that means a sequence of stops and links on which e.g. a bus line operates) contained in the osm data and it can export a dummy TransitSchedule.xml which can be used to check whether these network routes are valid ( = can be run in the mobsim of MATSim etc.). So you can use it to extract routes of bus lines, but it won't give you a complete TransitSchedule.xml. I guess it failed for you, because there are no bus lines in the osm data ( = nobody tagged bus lines in that region) or the bus lines are inconsistent.

For a complete TransitSchedule.xml you have to find a data source and convert it into the MATSim TransitSchedule.xml format (see https://matsim.atlassian.net/wiki/spaces/MATPUB/pages/83099693/Transit+Tutorial).

If you can find a GTFS file for the area you want to examine (see http://www.gtfs-data-exchange.com/agencies/bylocation) you can convert the GTFS data using https://github.com/matsim-org/GTFS2MATSim (it has an example at src/main/java/org/matsim/contrib/gtfs/RunGTFS2MATSimExample.java). The GTFS2MATSim Converter exports a TransitSchedule.xml, an example TransitVehicles.xml file (GTFS has no information on actual vehicle types used, so there are only a few default vehicles) and a network file for public transport only, which you have to merge with your road network.

Unfortunately GTFS data has no clue about real world roads on which buses and trams operate, there are only transit stops and transit lines in between. So the GTFS2MATSim Converter exports only a PseudoNetwork separated from any real world road network.

If you want bus lines to operate on the normal road network used by cars and extracted from osm, you have to edit the TransitSchedule.xml manually and adjust the links on which TransitStops are located and network routes (links in the MATSim network on which buses etc. drive in the mobsim) of TransitRoutes (a MATSim container for actual Departures / trains / bus services including their timetable). One possible way to do that is to extract the routes using the JOSM-Plugin, but unfortunately data quality is often low, so you will still have to correct the bus routes in JOSM . So there is still a lot of work to do manually, but at least there is something to start with. There is some documentation in German on converting bus lines with the JOSM Plugin (see https://svn.vsp.tu-berlin.de/repos/public-svn/publications/vspwp/2015/15-10/).


Re: About create Transitschedule.xml file

by Nico Kuehnel on 2017-12-14 12:50:55

Hi,

to allow for transit schedule export you have to activate transit support in the plugin preferences (transit light will create bee line distance links between stops). For the problems and limitations, see Gregors answer.

Clone this wiki locally