Public Transport Plugin for JOSM

Introduction - Examples how to Use - Used Notions - Reference Manual

Table of Contents

Introduction
    How to Install
Examples how to Use
    Map a Bus Line from Scratch
    Reuse a partly parallel line
    Reuse an Old Relation
Used Notions
Reference Manual
    Tab Overview
    Tab Tags
    Tab Itinerary
    Tab Stops
    Tab Meta

Introduction

The JOSM Plugin Public Transport is designed to simplify the mapping and editing of public transport routes according to best practice standards (see Oxmoa scheme). After some installation instructions, we start with a chapter about usage examples: In the first section, we describe how to create a bus route from scratch. If there exists already one or more lines running partly or completely parallel, you can take advantage of this (see second section). Also, you can easily convert routes from older data formats to the Oxmoa scheme (see fourth section). The following chapter explains the notions used along the plugin. The last chapter contains a reference manual of all items in the plugin.

This manual refers to the prototype version of 2010-02-19. It has successfully been tested with the latest JOSM (version 2940). It does not work with JOSM-tested (version 2561) due to changes to the data model. This is still a beta version, so don't forget to save your work before and during you use this plugin. Feel free to make suggestions for simplifications or extra functionality or report bugs to me (mailto:roland.olbricht(at)gmx.de).

How to Install

Open JOSM and select from menu Edit > Preferences, then there Plugins > Download list. Check public_transport in the list. Now restart JOSM.

Examples how to Use

Map a Bus Line from Scratch

The Oxmoa schema consists of a relation per direction and contains the itinerary (the way a bus actually takes from its starting stop to its terminus) and the stops served by the bus. Roughly, you need to enter one direction of the itinerary by hand. The stops and the back direction can mostly be derived from that by the software.

Download the area where your bus route takes place. Choose the menu item Public Transport > Route patterns. This opens a window where you can see all public transport routes existing in the downloaded data set. Create a new relation by clicking on the button New. Now change to the tab Tags and set appropriate values for a least route (the type of public transport), ref (the line number) and to (the destination displayed).

Change to the tab Itinerary. Now select on the map the first way that belongs to your route and press Add. Mark the second item and press Add again. You also can select several ways at once and click Add. If your ways are added in the wrong order or with wrong roles, mark them (click the first entry in the window, then shift-click the last entry in the window) and press Sort. If there appear one or more lines [gap], then your ways don't fit together. If sorting won't solve that then there are gaps in your itinerary and you need to add the missing links or split ways (mark the way, the node where to split at and then use menu Tools > Split Way) if your bus service only partly uses them. To help you with the tasks you can:

There are buttons Mark, Show and Find with similar functionality in the tab Stops.

You can delete one or more entries from the list by marking them and clicking Delete. You can also move one or more entry by marking them, clicking on Mark (this copies them to the clipboard, like the middle mouse button on X servers), then Delete, then mark the first item before which you want to insert the items and click Add.

Now you can add the bus stops in a convenient way: change to the tab Meta and press Suggest Stops. This will compile a list of stops that are near the itinerary. You can choose up to which distance from the itinerary stops should be considered and whether stops only the right hand side, only on the left hand side or on both sides are possible. Now change to the tab Stops. You can identify the stops by their entries as follows: click Mark and/or Show. Delete spurious entries by marking them and pressing Delete. Add missing stops by marking them on the map, marking the entry before which you want to insert the stop (unmark all entries if you want to append stops to the end), then press Add.

When you are complete with the forward direction, go back to the tab Overview. Then click Duplicate (this adds a copy of the relation) and click Reflect (this reflects the copy to become the backward direction). Review the itinerary in the tab Itinerary and correct oneways passed in the now wrong direction. Then change to the tab Meta and let you suggest bus stops. Review them. Congratulations, you are done with the entire bus line.

Reuse a partly parallel line

The plugin has an internal clipboard to simplify copying parts of the itinerary or the stops from one bus route to another. Data is put into the clipboard following the X server paradigm. Mark one or more entries from the itinerary list or stops list and click the respective button Mark (in Itinerary, in Stops). The objects themselves are kept by being marked on the map. The plugin additionally saves their order and role. You can paste data from clipboard by using the respective button Add (in Itinerary, in Stops).

To do this, first choose the source route at the tab Overview and then change to the tab Itinerary. Mark there the entries you want to copy and click Mark. Then choose at the tab Overview your destination relation and mark in the tab Itinerary the entry before which you want to paste the entries or unmark all entries if you want to append the data from clipboard.

Stops can be copied in the same way: first choose the source relation at the tab Overview and change to the tab Stops. Mark there the entries you want to copy and click Mark. Then choose at the tab Overview your destination relation and mark at the tab Stops the entry before which you want to paste the entries or unmark all entries if you want to append the data from clipboard.

Reuse an Old Relation

If you have a bus route in an old format, you can spread it with the help of the plugin into separate relations for both (or more) directions. Go to the tab Overview, mark the respective relation and click Duplicate, then Reflect. Now you have a relation for each direction. The remaining task is to cleanup the new relations.

First, mark again the first relation. Go to the tab Itinerary and cleanup the itinerary to contain only the forward direction as described above. Now you can use Suggest Stops from tab Meta to obtain a good guess for the bus stops. Use the tools in the tab Stops to cleanup this list.

Now go back to the tab Overview and select the newly created route. Proceed with the same steps as for the forward direction. Congratulations, now you have corrected the bus line.

Used Notions

Note: I'm not a native English speaker. Thus, if you have suggestions for better wording, please send them to me (mailto:roland.olbricht(at)gmx.de).

clipboard - Beside the operating system, the plugin has an internal clipboard that allows to maintain the order and roles of relation members, in particular bus stops and ways belonging to the itinerary. The clipboard is used similar to the X window system cliopboard: there you copy text into the clipboard by marking it with the mouse and paste it by clicking the middle mouse button. We can't assume that every computer has a middle mouse button. Thus, in the plugin you copy data into the internal clipboard by marking the entries and clicking Mark (in Itinerary, in Stops). You paste data by keeping it marked on the map and clicking Add (in Itinerary, in Stops).

entry - An entry in the list of objects that are members of a relation. Here, the relations are public transport routes and members are stops or stations or the ways that constitute the itinerary. The notion entry is used to discriminate between the relation members (entries) and the objects referred to by the relation members (objects on the map).

itinerary - The way a bus service actually takes. Note that buses or other vehicles can't make jumps, thus there cannot be gaps in an itinerary. For that reason, a line [gap] is displayed in the itinerary list whenever the first node of a way differs from the last node of the preceeding way.

(bus) line - The notion refers usually to all bus or train services that are offered in a certain network with the same line identifier. The line identifier for a relation is declared by the tag ref.

mark - see select.

network - the set of all services that a organised as a whole by some kind of transport authority. Often, the network is the responsible party for ticket fares. It is used to disambiguate different routes with the same line identifier in different regions. In particular, we assume that in every network a line identifier is unique, i.e. that all relations with the same line identifier constitute a logical unit. The network is declared by the tag network.

node - The respective OSM primitive. The only objects represented by nodes here are stops and stations. Nodes are visible in the JOSM main window and a list of nodes as members of the route relation constitutes the served stops of a public transport route.

Oxmoa scheme - see http://wiki.openstreetmap.org/wiki/User:Oxomoa/Public_transport_schema. This plugin implements a subset of the Oxmoa scheme. We implement in particular here the splitting of bus lines into bus routes. This allows to display the correct order of an itinerary and stops even if a section is passed twice or several times. The extra relations per line number on top of the bus route relations aren't implemented yet because there is no known use case for them. Also, the concept stop_position has not been implemented as it causes ambiguities: if it is placed on a non-oneway, the direction of the stop_position is unclear.

In particular, the data model underlying this plugin is as follows: Every bus stop is represented at its road sign by a node with tag highway=bus_stop which is off the road itself, usually a few meters, depending on the width of the street. Every bus route (i.e. every service with distinct starting point, ending point or itinerary) is represented by a relation on its own with tags type=route, route=bus|tram|light_rail|subway|rail and ref set to the line number or line identifier and network set to the network the line belongs to. The name tag may be used if the line has a name but it won't appear somewhere. The relation contains as members the ways which constitute the itinerary the bus actually takes and the bus stops in the order they are served. The member role of the ways is set to either forward or backward, depending on whether the bus passes the street in or against the direction it is drawn in the map.

public transport route - The pattern of passed roads and served stops by a particular public transport service. A (bus) line usually consists of two or more (bus) routes but there are exceptions: bus services only operating in one direction or bus services with the same line number but different branches.

relation - The respective OSM primitive. The only objects represented by relations here are the public transport routes. They are not visible on the JOSM main map but can be edited with this plugin.

select - Unfortunately, there are different things that can be selected. You can and need to mark objects (ways and nodes) on the map in the JOSM main window. Or you can mark entries in the list in one of the tabs Overview, Itinerary or Stops. The former is usually referred to as select on the map, the latter as select an entry. For the entries it is sometimes useful to know that you can mark several entries at once by clicking on the first entry, then shift-clicking on the last entry. You can unmark all entries as follows: click an entry (this marks it and unmarks all other entries) then Ctrl-click it again (this unmarks this entry).

stop - The location where a bus or train calls. It is represented here by the position of the road sign that indicates the bus stop in the real world. In particular, bus stops are always off the road. This is necessary because buses have doors only on one side. Thus, there are no two-directional bus stops. This is in contrast to railway stations: as trains have usually doors on both sides, a train station can and is often used in both directions.

way - The respective OSM primitive. It is visible in the JOSM main window and a list of ways constitutes the itinerary of a bus route.

Reference Manual

Tab Overview

List Existing route patterns

The large list in the center contains all relations that are recognised as
public transport routes. They are listed with the value of their tag ref, the value of their tag to and the ID of their relation. A relation is considered as public transport service if it has the tags type=route and route is set to one of the values bus, tram, light_rail, subway or rail.

Button Refresh

This button refreshes the list Existing route patterns.

Button New

This button generates a new
route pattern.

Button Delete

This button deletes the currently marked
route pattern.

Button Duplicate

This button makes a copy of the currently marked
route pattern.

Button Reflect

This button changes the direction of the
route pattern: the values of the tags to and from are exchanged and the itinerary and the list of the stops are reflected.

Tab Tags

List Required tags

The list contains the five tags that every
public transport route must have:

List Common tags

The list contains further tags which are quite common for
public transport routes:

List Additional tags

Additional tags can be added here. These tags might be of use for specific software or describe special local features but aren't part of the
standard data format. If you leave a key empty or delete the key, the respective key will be removed from the relation.

Button Add a new Tag

This adds an empty line to the
additional tags list.

Tab Itinerary

List of member ways

This list contains all the current members of the relation you are editing that are ways. The intended format of a route relation (see Oxmoa scheme at USED NOTIONS above) expects a continuous list of ways that represents the itinerary the bus takes in reality. Whenever two ways don't fit head on tail, a marker "[gap]" is put between them in an extra line to make breaks clearly visible. This is not a member of the relation but just a marker. You can change the role of a way in the right column. To achieve maximum backward compatibility, you should choose "forward" or "backward". To properly display relations that don't follow the Oxmoa scheme, all other roles including the empty are also displayed and you can choose despite "forward" and "backward" also an empty role.

Button Find

Button Show

This button changes the view on the map such that all nodes belonging to a marked entries become visible. If no entry is marked, then the view will show all nodes belonging to an entry.

Button Mark

This button marks all entries that are marked in the list as objects on the map and unmarks all other ways. It also copies a list of the marked entries to the plugin's internal clipboard, such that roles and the order can be reconstructed. If no entry is marked, then all items belonging to an entry are marked and copied to the clipboard.

Button Add

This button adds all ways that are currently marked on the map as entries in the list. The entries are added in arbitrary order before the first marked entry. If no entry is marked, then the new entries will be appended. You can order the just added elements by marking them and clicking "Sort".

Button Delete

This button deletes all currently marked entries.

Button Sort

If one or more entries are marked, all marked entries are sorted. I.e. their order and role is changed such that they form a continuous itinerary. If this is not possible, the plugin tries to construct long series of continuous sections. If no entries are marked, the entire list is sorted.

Button Reflect

If one or more entries are marked, their order is reflected and their roles get flipped. I.e. every entry it put after its successor and its role is changed from "backward" to "forward", from "forward" to "backward" or left unchanged if it is empty. If no entry is marked, then the entire list will be reflected.

Tab Stops

List of member nodes

This list contains all the current members of the relation you are editing that are nodes. The intended format of a route relation (see Oxmoa scheme at USED NOTIONS above) expects a list of nodes that represents the stops in the order the bus takes them in reality. The roles can be changed to "forward" or "backward" but due to Oxmoa scheme, they should remain empty.

Button Find

Button Show

This button changes the view on the map such that all nodes belonging to a marked entries become visible. If no entry is marked, then the view will show all nodes belonging to an entry.

Button Mark

This button marks all entries that are marked in the list as objects on the map and unmarks all other nodes. It also copies a list of the marked entries to the plugin's internal clipboard, such that roles and the order can be reconstructed. If no entry is marked, then all items belonging to an entry are marked and copied to the clipboard.

Button Add

This button adds all ways that are currently marked on the map as entries in the list. The entries are added in arbitrary order before the first marked entry. You can order the just added elements by marking them and clicking "Sort".

Button Delete

This button deletes all currently marked entries.

Button Sort

If one or more entries are marked, all marked entries are sorted. The sorting order depends on the itinerary and the settings for the distance limit, the right hand side and the left hand side in the meta "tab": the sorting algorithm attaches each stop to the nearest segment of the itinerary and then orders them in the order they are passed on the itinerary. Then all stops that can't be attached are added to the end of the list. If no entzry is marked, all entries are sorted.

Button Reflect

If one or more entries are marked, their order is reflected. I.e. every entry it put after its successor.

Tab Meta

Check box Stops are possible

This check box controls the behaviour of the button "Suggest stops" and the button "Sort" in the tab "Stops". If you mark only one of the boxes "Right hand side" or "Left hand side", only stops on the respective side are taken into account. If you mark both boxes, stops on both sides are taken into account.

Text field Maximum distance from route

This text field also controls the behaviour of the button "Suggest stops" and the button "Sort" in the tab "Stops". Only stops that have a distance less or equal the limit set here are taken into account.

Button Suggest Stops

This button replaces the current list of stops by a list of all stops that are on the itinerary with regard to the setting of the check boxes and the text field described above.