Public transport/Quality Assurance

From OpenStreetMap Wiki
Jump to navigation Jump to search


JOSM

JOSM validators already contains some checks about the relations consistencies.

​Jungle Bus validation ruleset provide a few more. (sourcecode)

PT Assistant also have dedicated ptv2 validation rules.

PTNA - Public Transport Network Analysis

Nice new tool which provides a daily analysis of public transport lines mapped in OSM.

Osmose

Osmose has several analysers on public transport data

OSMInspector

OSM Inspector as dedicated views for Public Transport Stops and Routes

Other tools

Many transport visualization tools can be use for QA, such as OSMTransportViewer.

See AwesomeTransportTools for more.

Overpass Queries

While transitioning from the old Public transport tagging schema to the newer Public_Transport some inconsistencies can appear.

highway=bus_stop without a public_transport=* tag

The first stage of transitioning from highway=bus_stop to Public_Transport is to apply either public_transport=stop_position or public_transport=platform to each highway=bus_stop.

try it yourself in overpass-turbo
// Collect all bus stops without an public_transport tag.
node({{bbox}})[highway=bus_stop][public_transport!~'platform|stop_position'];

// Return the result including meta data (needed for JOSM exports).
out meta;

stop_position or platform not within a stop_area relation

After tagging stop_positions and platforms, each objects related to a stop should be grouped in a public_transport=stop_area relation.

try it yourself in overpass-turbo
// stop_position or platform not within a stop_area relation

// Collect all stops and platforms and store the result in variable .a
node({{bbox}})[public_transport~'stop_position|platform']->.a;

// Select parent relations with the tag public_transport=stop_area for all members of the input set .a
rel(bn.a)[public_transport=stop_area];

// Select all nodes from the previous relations and store the result in variable .b
node(r)->.b;

// Substract the nodes which are in a stop_area relation from the list of all nodes.
(.a; - .b;);

// Return the result including meta data (needed for JOSM exports).
out meta;

stop_position without platform

In most cases a stop_position should have a platform not far from it.

try it yourself in overpass-turbo
// Stop positions without platform.

// Collect all stops and store the result in variable .a
node({{bbox}})[public_transport=stop_position]->.a;

// Collect all platforms.
(
  node({{bbox}})[public_transport=platform];
  way({{bbox}})[public_transport=platform];
  rel({{bbox}})[public_transport=platform];
);

// Then look around for stops from each platform and store the found stops in variable .b
node(around:50.0)[public_transport=stop_position]->.b;

// Substract the stops which are found near a platform from the list of all stops (this give us the stops without platform).
(.a; - .b;);

// Return the result including meta data (needed for JOSM exports).
out meta;

platform without stop_position

try it yourself in overpass-turbo
// Platforms without stops.

// Collect all platforms and store the result in variable .a
(
  node({{bbox}})[public_transport=platform];
  way({{bbox}})[public_transport=platform];
  rel({{bbox}})[public_transport=platform];
)->.a;

// Collect all stops.
node({{bbox}})[public_transport=stop_position];

// Then look around for platforms from each stop and store the found platforms in variable .b
(
  node(around:50.0)[public_transport=platform];
  way(around:50.0)[public_transport=platform];
  rel(around:50.0)[public_transport=platform];
)->.b;

// Substract the platforms which are found near a stop from the list of all platforms (this give us the platforms without stops).
(.a; - .b;);

// Return the result including meta data (needed for JOSM exports).
out meta;

Public transport objects without network=*

If there is a stop_area, you don't have to add the network to stops and platforms.

try it yourself in overpass-turbo
// Public transport objects without network tag.
(
  // stops and platforms
   node({{bbox}})[public_transport][network!~'.'];
  // platforms
   way({{bbox}})[public_transport][network!~'.'];
  // stop_areas and some platforms
   rel({{bbox}})[public_transport][network!~'.'];
  // route relations
   rel({{bbox}})['public_transport:version'][network!~'.'];
);

// Return the result including meta data (needed for JOSM exports).
out meta;