Kaart: Route Relations/sandbox

From OpenStreetMap Wiki
Jump to navigation Jump to search

Introduction

Route relations can be found all around the world. They can be used for all kinds of transportation types from buses to bicycles. Knowing what route relations are and how they work will help you better understand how to edit them.

Prerequisites

Must have a solid understanding of relations, geometry, tagging, etc. as well as a good understanding of JOSM.

Skill Instruction

Before you start adding and modifying route relations you first need to learn how the relation works and how to use the tools to modify the relation.

Parts of the Relation

Every route relation has these parts:
Tag
  • Defining features that tell you what the function of the relation is.
  • Every relation must a type=* tag.
Members
  • The individual ways and areas that define the route.
  • Bus routes commonly have bus stops(nodes) as part of the relation.
Roles
  • Members may be give a role to define their function or to give more detail. Some examples of this include: platform, forward, and backward.

The Relation Menu

The relation menu is where you will make most of the changes to the route. This menu has various tools that help you easily modify things like the tags and members of the relation.

There are three parts to the relation menu:

  • Tags and Members
  • Parent Relations
  • Child Relations

Tags and Members

The tags and members section is where you'll make changes to the relation. This section is broken up into three parts: tags, members and selection.

Tags

This section is where you will add/modify/delete the tags of the route to further define what it is, what it's called, etc.

Tools: There are a few basic tools you can use to update the tags for the relation.

These include:
  • Add tag
    • You can also add a new tag by clicking on a blank space at the bottom of the tag table.
  • Delete the selection in the tag table
  • Paste tags

Members

This section is where you can modify the order of the various members, delete members and give the members a role(as needed). This is also where you can see the whole relation and determine if it needs to be fixed/modified.

Note: For bus routes, the stops and platforms (nodes) will be the first members of the relation and will have the role "stop/platform". Ways DO NOT get roles.

Tools: There are multiple tools to help you edit the members of a relation.

These include:
  • Move the currently selected member(s) up/down.
  • Edit the relation the currently selected relation members refers to.
    • This applies to parent relations that have multiple child relations in them.
  • Remove the currently selected member(s) from this relation.
  • Sort the relation members.
    • This will organize the members based on the order the members occur in OSM. If there are duplicate members this may cause breaks in the relation.
  • Sort the selected relation members and all below. If there are duplicate members this may cause breaks in the relation.
  • Reverse the order of the relation members.
    • You can also do this with a selection of members.
  • Download all incomplete members.
  • Download the selected incomplete members.

  • Apply role.
    • Applies a role to the currently selected members.

Selection

This section is where you can add new members to the relation. These are ways/nodes that you have selected to help complete the relation.

Tools: There are multiple tools available to help you add your selection to the relation.

These include:
  • Add all objects selected in the current dataset before the first member.
  • Add all objects selected in the current dataset before the first selected member.
  • Add all objects selected in the current dataset after the last selected member.
  • Add all objects selected in the current dataset after the last member.
  • Select relation members which refer to objects in the current selection.
  • Select objects for selected relation members.
  • Remove all members referring to one of the selected objects.

Member Colors

Members of the relation may have a different color to help you know more about that member.

These colors include:
White

This member does not have any duplicate members and is not currently selected in OSM or the relation menu.
Yellow

This is the feature that is currently selected in OSM. This won't show in the members list unless that feature is part of the relation, but it will always be visible in the Selection list.
Red

This indicates that a member has been duplicated somewhere in the relation.
Bold Highlight

This is what you currently have selected in the relation menu. It will be darker than the other colors.

Parent Relations

A parent relation, also known as a super-relation, is the main relation that ties all of the smaller relations together. For a route, this would be the relation that shows you all of the other routes in the area.

To view the parent relation(s):

  • Click on the Parent Relations tab.
  • Select the parent relation.
  • Click Edit.
    • This will open a new relation menu for the parent relation.

How to Create a Parent Relation

There are two main types of parent relations:

  • Super Route
  • Route Master
Super Route

A super route is a route that spans multiple countries. Each part of the route is broken up by country and added to the super route relation.

To create a super route:

  • Open the relation dialogue panel.
  • Create a new relation.
  • From the relation panel, add all child relations in the network to this relation.
    • Right click on each relation and select select relation(add). This will add the relation to your selection list in the relation menu.
    • Add the selected relation(s) to the parent relation.
    • Note: These do not need roles.
  • Add the tags: type=superroute(required), route=*(required), ref=*(required), name=*, network=*, etc.
  • Click Ok.
    • It will automatically be classified as a parent relation.
Route Master

A route master relation is a smaller parent relation that contains all the parts of a local route network including important information about the network.

How to create the route master relation:

  • Open the relation dialogue panel.
  • Create a new relation.
  • From the relation panel, add all child relations in the network to this relation.
    • Right click on each relation and select select relation(add). This will add the relation to the your selection list in the relation menu.
    • Add the selected relation(s) to the parent relation.
    • Note: These do not need roles.
  • Add the tags: type=route_master(required), route_master=*(required), ref=*(required), name=*, network=*, etc.
  • Click Ok.
    • It will automatically be classified as a parent relation.

insert gif

Child Relations

A child relation is an individual relation that is part of a parent relation. For routess, this would be one route in the area that makes up the parent relation.

To view a child relation(s):

  • Click on the Child Relations tab of the parent relation menu.
  • Select the route you want to view and click Edit.
    • If the route you're looking for isn't available try clicking on Download All Children to download all of the child relations.

How to Create a Child Relation/Route

To create a new child relation/route you first need a source to confirm the new route. Reach out to your local government/city officials to get permission to add the new route and use their data.

How to add a new route:

  • Open the relations dialogue panel.
  • Click the + to create a new relation.
  • Select all of the members of your relation in order then add them to the relation.
  • Add type=route and any other tags that apply to that relation.
  • Click Ok.
  • Review your relation to make sure it's correct.
  • Upload.

insert gif

  • The process would be the same for bus stops and platforms.
    • Make sure these are at the top of the relation in the order they go.

Tips and Tricks for Route Relations

Working with route relations can seem overwhelming at times. Here are some tips and tricks to help make working on them a little easier.

  • Turn off all your paint styles and satellite imagery.
    • This will render the data as gray lines against a black screen so it is easier to see what you have selected.
  • Use filters to disable nodes and non-highway features when working on route relations. See the How to create filters training for more information on how to create/use filters.
    • This reduces the amount of visible data.
    • You can toggle the filters on/off as needed to make changes to the features.
    • Filters:
      • type:node child
      • type:way highway
        • Enable hide to hide all non highway features.
        • Inverted
        • This will also hide bus stop nodes. Turn this off if there are bus stop nodes.
      • -(highway:|highway=bus_stop|public_transport=platform|public_transport=stop_position) - optional filter.
        • Enable hide to hide all non highway features while leaving bus stop nodes visible.
  • Sometimes the same segment of road needs to be duplicated to ensure there are no breaks in the relation.
  • You may have to split segments of road to get the relation to flow properly.
  • DO NOT make any changes to the data layer in JOSM whilst the relation menu is open or you will conflicts.
    • If you need to modify geometry or tags of features outside of the relation remember to close the relation menu first.
  • Download all members of the relation(when possible) to help avoid getting conflicts.
  • Always double check the relation after it's fixed to see if it flows in order.
  • Don't split roundabouts to have the relation on just a small portion of it.
    • Roundabouts are recognized in the relation menu.
    • Note: Both ways are correct, but the preferred method is to keep the roundabout as one pice instead of breaking it up. Combine split roundabout segments when possible.
  • Feel free to delete unneeded relation members.
  • Some routes may be one big loop while others are two separate routes.
  • You can use presets(where available) to help with route tagging.
  • Use the OSM Relation Analyzer tool to review relations.
    • It can give you details about the relation, the general quality, and show you where known gaps are in the relation.
  • Use the PTSA - Public Transport Stop Analysis tool to spot inconsistencies/mistakes on public transport stops.
    • This tool allows you to:
      • Set parameters for different PT modes you want to review.
      • Select different stop features you want to see.
      • Colorizes features to let you know if there is an issue or not.
  • You can spot gaps by right clicking on the relation and selecting select relation. This will highlight all members of the relation and allow you to see any gaps that may be present.
  • There isn't an option to undo changes. You can either fix it by using the provided tools or close the relation window without accepting your changes. You will be asked: Yes, save the changes and close, No, discard the changes and close, Cancel, continue editing. Select No, discard the changes and close to start over at your last save.
  • Save your changes often, especially when working with larger route relations. This will help reduce the risk of losing your edits should you run into any issues like a conflict.
    • Customize your changeset settings to leave the changeset open. This will allow you to save your changes without uploading them to the server. This is recommended for larger routes that require a lot of changes.
      • To do this, click on Settings in the upload dialogue box and uncheck Close changeset after upload. Remember to re-enable this when you're ready to upload your changes.
  • Always upload after you've fixed the relation(s).

How to Analyze a Route Relation

Before you start making changes to an existing route relation it's good practice to analyze. the relation to see what changes need to be made.

To do this:

  • Turn off all of your paint styles and imagery layers.
  • Use filters to disable nodes and non-highway features.
  • Select the way with the relation and open the relation menu.
  • Scroll through the members section to see what you're working with.
    • Look for: loops, breaks, bus stops, duplicate members, etc. These will help you identify what kind of relation it is and how to fix it.
  • Zoom in/out as needed to see the relation.
  • Select a member in the relation window and use the ↑↓ arrow keys to scroll through the relation.
    • Look for: gaps, duplicate members, etc. This will help you see how the members currently work in the relation and identify what needs to be added/modified to fix it.
    • Note: Consider what the most efficient way to fix the relation would be. In some cases it may be better/faster to remove then re-add members rather than try to rearrange them in the members list.

insert gif

How to Modify/Fix a Route Relation

This process is simple but takes time and patience. We'll cover how to fix a small part of the route relation and how to fix the entire route relation.

Part of the Relation

This is how you fix a small part of the route relation:

  • Turn off all of your paint styles and imagery layers.
  • Use filters to disable nodes and non-highway features.
  • Make any geometry changes as needed.
    • This most likely will break any present relations. It is good practice to review these relations before making any geometry edits.
    • You may need to turn off your filters for this.
  • Open the relation menu and review the relation.
    • Look for: breaks, ways that may need to be split, etc.
  • Make additional geometry changes as needed. e.g. ways that need to be split/combined.
    • You will have to close the relation menu before making any edits. Editing geometry with the relation menu open may result in a conflict that is very difficult to resolve.
  • Re-open the relation menu and add any missing members to the relation.
  • Review your changes to ensure the break has been fixed.
  • Save your changes.

insert gif

Entire Relation

This is how you fix the entire route relation:

  • Turn off all of your paint styles and imagery layers.
  • Use filters to disable nodes and non-highway features.
  • Select the way with the relation.
  • Find the relation you're looking for under member in the tags/memberships panel.
  • Select the relation, right click on it and select download incomplete members.
    • This will download all of the members of the relation.
  • Edit the relation.
  • Zoom in/out to see the relation.
  • Analyze the relation and see where the issues are and determine what needs to be done to fix it.
    • At the same time, review the members list to see where issues are like breaks, duplicate members that are in the wrong spot or are incorrect, etc.
    • Double check the bus stops/platforms (if present). These should be at the top of the members list and will outline the route.
  • Once you've identified the problems you can start adding, moving or removing members to fix the relation.
    • Click on sort this relation to organize all of the members.
      • This will save you some time.
      • Make sure the bus stop nodes/platforms are at the top of the members list(if present).
      • Note: Don't do this by default. Make sure you analyze the relation first to see if this will help or not.
    • Start at the beginning of the relation (top of the members list) and work your way down.
    • Remember to close the relation menu anytime you need to edit geometry.
      • Editing geometry with the relation menu open may result in a conflict that is very difficult to resolve.
    • Double check the relation as you go to make sure it's flowing correctly. Do this again at the end once you've fixed all of the issues.
  • Save your changes.

insert gif

Note: If part of the selection you are trying to add is somewhere in the relation you will be asked if you would like to duplicate it. If this occurs you may need to select a different member and then reselect the member you want before adding anything. Otherwise the segments you wanted to add may be put in the wrong place where the duplicate member is located in the relation.

insert gif

Relation/Tag Conflict Menu

While modifying the relation you may see the need to combine a few ways to help simplify the relation. If these ways have different relations/tags on them then a conflict menu will appear to help you resolve this issue.

How to use the conflict menu:

  • Select the ways you want to combine and use C to combine them.
    • If the conflict menu appears look at the conflicting tags and relation members then close the menu.
  • For tag conflicts:
    • Review the tags on each way to see what the conflict is and determine the best way to resolve it. In some cases it is better to leave the ways as is.
  • For relations:
    • Analyze each relation to see how it interacts with the other relation(s) and determine whether or not those ways can seafly be combined without creating issues. In some cases it is better to leave the ways as is.
  • If the ways can be safely combined:
    • Resolve any tag conflicts.
      • You can either pick one of the listed values, none or all.
    • Carefully choose which relation members you want to keep/remove.
      • Choosing to keep all of the members may create duplicates in the relation(s). These can always be fixed in the relation menu if needed.
      • Since this is a conflict resolution you won't be asked if you want to create a duplicate member.

insert images

  • Click Ok when done.
  • Re-analyze each relation to make sure there aren't any duplicates, breaks, etc. as a result of your conflict resolution.
    • Fix any issues you find.
  • Once you've confirmed each relation has been fixed save your changes.

insert gif

'Note: Since route relations can be quite long it is very easy to create a conflict with yourself. This can happen when your current edits conflict with previous, unsaved edits.

Public Transport Tagging

This applies to all modes of public transport: bus=*, tram=*, train=*, etc. There are currently two ways to tag public transport routes:

  • Version 1: Old tagging scheme
  • Version 2: New tagging scheme

It's important to know how to edit both versions as they are both in use, but the preferred method for route relations is Version 2.

Version 1

The main difference between version 1 and version 2 are how the bus stop nodes/platforms are added/tagged.

How to add bus stops/platforms:

  • Bus stops
  • Platforms
    • These can be added as a way or an area.
    • Add them next to the way with the route relation where the stop is located.
    • Add the tags: highway=platform(required), bus=yes, name=*, network=*, operator=*, etc.
  • Add these to the top of the members list in the route relation in the order they occur. These outline the route.

How to create the route relation:

  • Create a new route.
  • Add all of the stops/platforms at the top of the members list in the order they occur.
    • Add the roles stop and platform accordingly.
  • Add all of the way members under the stops and platforms in the order they occur.
    • Ways can have the following roles: alternate, forward, and backward.
  • Add the tags: type=route(required), route=*(required), public_transport:version=1(recommended), name=*, network=*, etc.

Note: You may encounter a validation warning asking you to add the public_transport:version=* tag. Adding this tag will not only identify the correct version of the route, it will also point out any issues with tagging on the route or its features via the validator.

insert image

How to create the route master relation: This is a parent relation that contains all important information about the network.

  • Open the relation dialogue panel.
  • Create a new relation.
  • From the relation panel, add all child relations in the network to this relation.
    • Right click on each relation and select select relation(add). This will add the relation to your selection list in the relation menu.
    • Add the selected relation(s) to the parent relation.
    • Note: These do not need roles.
  • Add the tags: type=route_master(required), route_master=*(required), ref=*(required), name=*, network=*, etc.
  • Click Ok.
    • It will automatically be classified as a parent relation.

insert gif

Note: All of the gifs with bus stops demonstrate version 1.

Version 2

With version 2, the tagging was modified to add more detail and make them more functional.

How to add bus stops/platforms:

  • Bus stops
  • Platform
    • These can be added as a way, an area or a node.
      • They can be added as a node if there is only a pole instead of a physical platform in the real world.
    • Add them next to the way with the route relation where the stop is located.
    • Add the tags: public_transport=platform(required), highway=bus_stop, name=*, network=*, operator=*, etc.
  • Stop Area: Used to identify all features of an interchange(individual stop). This can include stops, platforms, stations, amenities, etc.
    • Create a new relation that includes all stops and platforms.
      • Add the roles stop and platform accordingly.
    • Add the following tags to the relation: type=public_transport, public_transport=stop_area, name=*, network=*(bus networks name).
    • Note: These can be simple with just the platforms and stop_position(s) or more complex with all of the features mentioned above.

insert gif

  • Station: A public transport station that is only used for passenger transportation.
    • Mapped as an area or building. Check here for specifics on how best to map it for your situation.
    • Add the tags: public_transport=station(required), name=*, operator=*, network=*, etc.
      • Typically used with common station tags like amenity=bus_station and transportation type tags like bus=yes to further define the station.
    • Can be a member of the same stop area/multiple stop areas if multiple networks use it.

How to create the route relation:

  • Create a new relation.
    • Create a relation for each direction/variant of the route. An example of a variant is the route changes slightly on certain days.
  • Add stop/platform positions to the top of the members list.
    • Must be in order of: starting stop position/platform → stop position/platform → end stop position/platform.
    • Roles: stop_position=stop, platform=platform.
      • Stops for only entering/exiting will be: stop=stop_exit/entry_only, platform=platform_exit/entry_only.
    • The ways should be added after the stops/platforms in the order they occur.
      • These do not have roles.
  • Add the tags: type=route(required), route=*(required), public_transport:version=2(recommended), name=*, network=*, etc.

Note: You may encounter a validation warning asking you to add the public_transport:version=* tag. Adding this tag will not only identify the correct version of the route, it will also point out any issues with tagging on the route or its features via the validator.

insert image

Here is an example of a Version 2 bus route relation.

insert gif

How to create the route master relation: This is a parent relation that contains all important information about the network.

  • Open the relation dialogue panel.
  • Create a new relation.
  • From the relation panel, add all child relations in the network to this relation.
    • Right click on each relation and select select relation(add). This will add the relation to your selection list in the relation menu.
    • Add the selected relation(s) to the parent relation.
    • Note: These do not need roles.
  • Add the tags: type=route_master(required), route_master=*(required), ref=*(required), name=*, network=*, etc.
  • Click Ok.
    • It will automatically be classified as a parent relation.

insert gif

Practical Application

Suggested Bookmarks