User:Don-vip/Public Transport Tagchecker

From OpenStreetMap Wiki
Jump to navigation Jump to search

I use this template to define custom tagchecks in JOSM/Validator.

You are free to adapt it, save it to a local file on your machine, and reference it in Validator options (data sources, "Add" button).

For example, on Windows, my file location is "file://D:/Users/Vincent/Documents/OpenStreetMap/JOSM/my_tagchecker.cfg".

If you find custom tagchecks useful in Public Transport domain, let me know :)

# JOSM TagChecker validator file

# Format:
# Each line specifies a certain error to be reported
# <data type> : messagetype : <key><expression><value>
#
# Data type can be:
#  node        - a node point
#  way         - a way
#  relation    - a relation
#  *           - all data types
#
# Message type can be:
# E            - an error
# W            - a warning
# I            - an low priority informational warning
#
# Key and value are expressions describing certain keys and values of these keys.
# Regulator expressions are supported. In this case the expressions starts and
# ends with // signs. If an 'i' is appended, the regular expression is
# case insensitive.
#
# The * sign indicates any string.
# The texts BOOLEAN_TRUE and BOOLEAN_FALSE in the value part indicate a special
# handling for boolean values (yes, true, 0, false, no, ...).
#
# Expression can be:
#  !=          - the key/value combination does not match
#  ==          - the key/value combination does match
#
# To have more complicated expressions, multiple elements can be grouped together
# with an logical and (&&).
#
# The comment at the end of a rule is displayed in validator description
#
# Empty lines and space signs are ignored

* : W : color == * && colour != *                                                # "color" used without "colour"

* : E : type == network && network != *                                          # Network without network
* : E : type == network && operator != *                                         # Network without operator
* : E : type == network && name != *                                             # Network without name
* : W : type == network && url != * && website != *                              # Network without url or website
* : W : type == network && phone != *                                            # Network without phone

* : W : public_transport != * && railway  == /halt|tram_stop|platform|station/   # Public transport object in old scheme
* : W : public_transport != * && highway  == /bus_stop|platform/                 # Public transport object in old scheme
* : W : public_transport != * && amenity  == bus_station                         # Public transport object in old scheme
* : W : public_transport != * && building == train_station                       # Public transport object in old scheme

* : I : public_transport == platform && train == *                               # Public transport platform with a vehicle type
* : I : public_transport == platform && subway == *                              # Public transport platform with a vehicle type
* : I : public_transport == platform && monorail == *                            # Public transport platform with a vehicle type
* : I : public_transport == platform && tram == *                                # Public transport platform with a vehicle type
* : I : public_transport == platform && bus == *                                 # Public transport platform with a vehicle type
* : I : public_transport == platform && trolleybus == *                          # Public transport platform with a vehicle type
* : I : public_transport == platform && aerialway == *                           # Public transport platform with a vehicle type
* : I : public_transport == platform && ferry == *                               # Public transport platform with a vehicle type

* : W : public_transport == stop_position && train != BOOLEAN_TRUE && subway != BOOLEAN_TRUE && monorail != BOOLEAN_TRUE && tram != BOOLEAN_TRUE && bus != BOOLEAN_TRUE && trolleybus != BOOLEAN_TRUE && aerialway != BOOLEAN_TRUE && ferry != BOOLEAN_TRUE  # Public transport stop without vehicle type

* : E : type == route && route != *                                                                      # Route without vehicle type
* : W : route == * && route != /road|train|subway|monorail|tram|bus|trolleybus|aerialway|ferry/               # Invalid value for route

* : E : type == route_master && route_master != *                                                        # Route master without vehicle type
* : W : route_master == * && route_master != /train|subway|monorail|tram|bus|trolleybus|aerialway|ferry/ # Invalid value for route_master
* : W : type == route_master && /ref*/ != *                                                              # Route master without ref
* : W : type == route_master && name != *                                                                # Route master without name
* : W : type == route_master && operator != *                                                            # Route master without operator
* : W : type == route_master && network != *                                                             # Route master without network
* : W : type == route_master && colour != * && color != *                                                # Route master without colour
* : W : type == route_master && url != *                                                                 # Route master without url
* : W : type == route_master && wheelchair != *                                                          # Route master without wheelchair
#* : W : type == route_master && start_date != *                                                          # Route master without start_date
#* : W : type == route_master && end_date != *                                                            # Route master without end_date
#* : W : type == route_master && air_conditioning != *                                                    # Route master without air_conditioning

* : W : public_transport == * && public_transport != /platform|stop_position|station|stop_area/          # Invalid value for public_transport

* : E : highway == bus_stop && public_transport == stop_position && bus != BOOLEAN_TRUE                  # bus=yes is missing
* : E : amenity == bus_station && public_transport == stop_position && bus != BOOLEAN_TRUE               # bus=yes is missing
* : E : railway == tram_stop && public_transport == stop_position && tram != BOOLEAN_TRUE                # tram=yes is missing
* : E : railway == halt && public_transport == stop_position && train != BOOLEAN_TRUE                    # train=yes is missing

* : E : public_transport == * && highway == bus_stop    && public_transport != /platform|stop_position/         # Incoherence between highway=bus_stop and public_transport
* : E : public_transport == * && amenity == bus_station && public_transport != /station|platform|stop_position/ # Incoherence between amenity=bus_station and public_transport
* : E : public_transport == * && highway == platform    && public_transport != platform                         # Incoherence between highway=platform and public_transport
* : E : public_transport == * && railway == /halt|tram_stop/ && public_transport != stop_position               # Incoherence between railway=halt/tram_stop and public_transport
* : E : public_transport == * && railway == station && public_transport != station                              # Incoherence between railway=station and public_transport