NaPTAN/Tag mappings

From OpenStreetMap Wiki
Jump to navigation Jump to search

This page will contain a list of tag mappings for use in the import of the NaPTAN and NPTG datasets. (NaPTAN and NPTG are UK official datasets for bus stops and places.)

Chapter 3 of the NaPTAN manual and the XML Schema are useful reads.

There's also some tree diagrams produced from the schema: Image:NaPTAN StopPoint.png Image:NaPTAN StopArea.png

General Notes

Much of the NPTG data isn't possible to import into OSM with a tagging only scheme, relations would probably be the only way to get the complex structure that the NPTG offers. Alternatively, we could just ignore it.

@lang indicates that the xml:lang attribute of the noted element may give a 2-3 digit ISO language code, which could be used for name:xx and similar tags.

The notation used is a mixture of trying to show the XML tree, and then realising it's not fully required here. Ignore any trailing slashes on field names, they represent that the value of the field is that of the element (as is always the case).

Source Format

National Public Transport Gazeteer (NPTG)

This dataset details some 50,000 places in the UK, orders them into a hierarchy, classifies them and associates them with an adminstrative area (county/unitary coucil etc) and also with a traveline region. Note that Traveline regions are not aligned to regional authorities.

Region

NPTG Attribure Sample data Description OSM Tagging
RegionCode Unique identifier of the region. naptan:RegionCode
Name Name of the region. (@lang) naptan:region_name
Country England, NorthernIreland, Scotland, Wales or UK Country of region. N/A BB
AdministrativeAreas (1 or more AdministrativeArea objects) Areas making up the region. (optional) N/A BB

AdministrativeArea

Administrative area managing data for part of the region.

NPTG Attribure Sample data Description OSM Tagging
AdministrativeAreaCode Unique identifier of the area. (3 digit number) naptan:AdministrativeAreaCode
AtcoAreaCode ATCO code for area. (3 digit number) naptan:AtcoAreaCode
Name Name of the area. (@lang) naptan:area_name
ShortName Short name of area, to use as qualifier. (optional, @lang) so for example one can distinguish between two places with the same name in different counties, e.g. "Church End (Bucks)" vs "Church End (Hants)" N/A BB
AtcoAreaCode (1 or more NptgDistrict objects, each containing NptgDistrictCode and Name elements) Districts within the UK. Corresponds to a unitary authority. Disjoint area of the UK. (optional) naptan:AtcoAreaCode
MaximumLengthForShortNames Length limit for StopPoint Short CommonName instances for area. (optional, defaults to 24) N/A BB(none)
National (boolean) Whether area administers stops nationally, or only for its own area (the default). For areas that issue stop types nationally (the '9nn' admin areas) this should be set to true (optional) naptan:National
NaptanPrefixes (1+ AlphaPrefix objects, containing 3 alphabetic characters) NaptanCode prefixes associated with area. Prefixes are used for allocating NaptanCode instances for stops so that the location can be determined from SMS requests. Each administrative area has its own reserved prefixes. (optional) N/A BB
CleardownRange (Contains two positive integers in CleardownStart and CleardownEnd elements) NaPTAN StopPoint CleardownCode ranges associated with area. Prefixes are used for allocating. StopPoint CleardownCode. Each area is allocated a unique range. Cleardown codes are only allocated to stops that need them so as to conserve numbers. (optional) N/A BB Not required
ContactEmail Administrative contact email for data queries. Should be a general address rather than an individual. (optional) Do not import
ContactTelephone (Contains 3 elements, details unimportant) Administrative contact phone for data queries. Do not import

Locality

NPTG Attribure Sample data Description OSM Tagging
NptgLocalityCode (Matches pattern [EN][0S][0-9]{6}) Unique identifier of the locality. naptan:NptgLocalityCode
Descriptor/LocalityName Name of the locality. (@lang) naptan:LocalityName
Descriptor/ShortName Short name for locality to be used when qualifying children. (optional, @lang) N/A BB
Descriptor/Qualify (Contains QualifierName, and optionally NptgLocalityRef or NptgDistrictRef, the object's ShortName from which the QualifierName is taken) Qualifier to use when presenting name to distinguish it from other similarly named elements. naptan:Descriptor/Qualify
AlternativeDescriptors/ (1+ Descriptor objects, as above) Collection of aliases (optional) N/A BB
ParentNptgLocalityRef Parent locality. Reference to another locality that contains the child locality completely. Must not be cyclic. (optional) N/A BB
AdministrativeAreaRef Administrative area that manages the locality. naptan:AdministrativeAreaRef
NptgDistrictRef District to which locality belongs. (optional) N/A BB
AdjacentLocalities (contains 1+ NptgLocalityRef objects) Localities which are adjacent to the locality. or which partially overlay. NB this should not be used for containment. Instead the ParentRef should be used for localities which completely contain the locality, and on child localities for localities completely contained in the locality. (optional) N/A BB
SourceLocalityType Classification of the Locality in the original source material used to compile the gazetteer. naptan:SourceLocalityType
U Urban Area in OS data.
US Urban sub-area in OS data.
Pa Parish �" not Wales.
Co Community �" Wales only.
Lo Other Locality in OS data.
DWD Scottish District Ward �" Scotland only.
LOC Scottish Locality �" Scotland only.
PAR Scottish Parish �" Scotland only.
RED Scottish Registered Electoral District �" Scotland only.
ISL Island
Add Added
LocalityClassification city, suburb, town, village, hamlet, urbanCentre, placeOfInterest, other, unrecorded Classification of the Locality as a settlement. Enumerated value. (optional) N/A BB
Location (Location object) N/A BB(none)

PlusbusZone

A PlusbusZone region covering a part of the UK. The plusbus zones in nptg do not depend on any of the other data. An import should therefore be very easy. I also do not think that any zones are defined in the OSM database yet. So, we do not need o worry about existing data.

NPTG Attribure Sample data Description OSM Tagging
SourceLocalityType Unique identifier of the Plusbus Zone. naptan:SourceLocalityType
Name Name of the zone (@lang) naptan:name_plusbus
Country England, NorthernIreland, Scotland, Wales or UK Country of zone. Enumerated value. N/A BB
Mapping (3+ Location objects making a polygon defining zone) Boundary of the Plusbus zone (optional) The mapping marks the geographic area covered by a plusbus zone. Each mapping should be converted into a polygon in the OSM db which is then tagged with the PlusbusZoneCode and the Name.

NaPTAN

StopPoint

A StopPoint represents a point of access to public transport, for any mode of travel – bus, rail, air, taxi, etc – including bus stops, stations, and ferry ports. The NaPTAN/Local schemes page is tracking any local variations of how data is stored in the schema.

General values
NaPTAN Attribute Sample data Description OSM Tagging
AtcoCode/ NaPTAN's internal object ID - A twelve character NaPTAN identifier intended for use in computer systems. naptan:AtcoCode=*
NaptanCode/ A short (seven or eight digit) identifier suitable for displaying on stops and referring to the stop in public facing systems. This has been designed to be suitable for use in SMS and other delivery channels requiring direct reference to a stop identifier by the general public. It uses a character set optimised for a mobile device keypad. (optional) naptan:NaptanCode=* and ref=*[1]
PlateCode/ Plate number for stop. An arbitrary asset number that may be placed on stop to identify it. (optional) N/A BB on the basis of discussions that show this field is rarely populated
PrivateCode/ A private code that uniquely identifies the stop. May be used for interoperating with other (legacy) systems. (optional) N/A BB
CleardownCode/ A 20 bit number used for wireless cleardown of stop displays by some AVL systems. Number format defined by RTIG. (optional) Not required
Descriptor/CommonName/ Common name for the stop in a specified language. (@lang) naptan:CommonName=* name=*[1]
Descriptor/ShortCommonName/ Alternative short name for stop. Length limit is set by administrative area. Standard abbreviations should be used to condense name elements. If omitted, defaults to CommonName, truncated if necessary. (optional, @lang) naptan:ShortCommonName=* short_name=*[1]
Descriptor/Landmark/ Description of the nearest landmark to the stop, for example 'Town Hall'. Or nearest street crossing that can be used to distinguish stop from other stops in the street, i.e. Landmark may be a crossing. (@lang) naptan:Landmark=*
Descriptor/Street/ Street of stop. @lang naptan:Street=*
Descriptor/Crossing/ Where there is a street that intersects the Street, as well as a Landmark, the name of the crossing street may be included separately here. (optional, @lang) naptan:Crossing=*
Descriptor/Indicator/ Indicative description of the relative position of the stop, for example, "100 yards from Town Hall". Bay Stand or Stance number should be placed here. (optional, @lang) naptan:Indicator=* (parsed value in local_ref=*[1])
AlternativeDescriptors/ Alternative name for stop. Can be used to provide both aliases and bilingual support. (optional, contains Descriptor's) naptan:AltTYPE=* (where TYPE is one of the imported Descriptor sub-values immediately above) Note this does not follow the convention, AlternativeDescriptors is abbreviated for conciseness, alt_name=*
Place/NptgLocalityRef/ NPTG locality within which stop lies. Not imported (or imported as relation members)
Place/AlternativeNptgLocalities/ Additional NPTG localities within which stop lies. (optional, contains NptgLocalityRef's) N/A BB
Place/MainNptgLocalities/ NPTG Localities for which the stop is a mainstop point, that is one of the main or most central PTANs. (optional, contains NptgLocalityRef's) N/A BB
Place/Suburb/ Suburb within which stop lies. (optional, @lang) (not required)
Place/Town/ Town within which stop lies. (optional, @lang) (not required)
Place/LocalityCentre/ Whether the locality is a centre or not. (optional, boolean) N/A BB
StopAreas/ The StopAreas to which the stop belongs. (contains StopAreaRef's) (Relation members)
AdministrativeAreaRef/ NPTG administrative area that manages stop data. (3 digit ID) naptan:AdministrativeAreaRef (no longer as a relation, too many members)
PlusbusZones/ PlusbusZones that stop belongs to. (contains PlusBusZoneRef's, optional) naptan:PlusbusZoneRef (no longer as a relation, too many members)
Notes/ Notes about a stop. (optional, @lang) naptan:Notes=*
StopAvailability/ Availability of stop for use. Note that the Status attribute on StopPoint should correspond with the StopValidity in effect at the ModificationDateTime. If no explicit stop validity is present, stop is assumed to have validity as indicated by Status attribute indefinitely. (contains many sets of StopValidity) N/A BB
StopAvailability/StopValidity/DateRange/(StartDate[,EndDate])/ Validity period for which Active/ Suspended or Transferred status applies. Each StartDate closes any previous open ended date range of a previous validity element. N/A BB
StopAvailability/StopValidity/(Active,Suspended,Transferred/) Stop is active/suspended during the period defined by date range (empty elements) or suspended and transferred to the indicated stop (AtcoCode). N/A BB

The following elements are grouped per transportation type. Be aware that Buses and Coaches can be both OnRoad and OffRoad. Also note that the schema allows data in StopType to be duplicated by the empty nodes below, for example a StopType of AIR will also have OnAir/Air/Entrance present.

Type Overview

suggested tag naptan:StopType

StopPoint Type StopArea
Group Mode Description Entrance Access Area Bay / Pole Sub Type Primary Area
OffStreet Air Airport AIR GAT GAIR
Ferry Ferry / Port FTD FER FBT GFTD
Rail Rail Station RSE RLY RPL GRLS
Metro & Tram Metro Station TMU MET PLT GTMU
Bus & Coach Bus or Coach Station BCE BST BCQ MKD GBCS
BCS
OnStreet Bus Bus Coach on street BCT MKD GBPS, GCLS, GCCH
CUS
HAR
FLX
Taxi Taxi Rank TXR
Shared Taxi Rank STR
Airports
NaPTAN Attribute Sample data Description OSM Tagging
StopClassification/StopType/ AIR or airportEntrance Airport Entrance entrance=*
StopClassification/OffStreet/Air/Entrance/ (empty node) [AIR] Airport entrance
StopClassification/StopType/ GAT or airAccessArea Air Airside Area (All of these are in NaPTAN920.xml)
StopClassification/OffStreet/Air/AccessArea/ (empty node) [GAT] Airport interchange area
StopClassification/OffStreet/Air/AnnotatedAirRef/ Collation with other industry reference systems. (See below, optional)
StopClassification/OffStreet/Air/AnnotatedAirRef/IataRef/ International Air Transport Association code for the airport. iata=*
StopClassification/OffStreet/Air/AnnotatedAirRef/Name/ Name of airport. (@lang) name=*
Ferries
NaPTAN Attribute Sample data Description OSM Tagging
StopClassification/StopType/ FTD or ferryTerminalDockEntrance Ferry Terminal / Dock Entrance. entrance=*
StopClassification/OffStreet/Ferry/Entrance/ (empty node) [FTD] Ferry terminal or dock entrance
StopClassification/StopType/ FER or ferryDockAccessArea Ferry / Dock Berth Area (All of these are in NaPTAN930.xml)
StopClassification/OffStreet/Ferry/AccessArea/ (empty node) [FER] Ferry or port interchange area
StopClassification/StopType/ FBT or FerryBerth man_made=pier or man_made=quay
StopClassification/OffStreet/Ferry/Berth/ (empty node) [FBT] Ferry berth
StopClassification/OffStreet/Ferry/AnnotatedFerryRef/ Collation with other industry reference systems. (See below, optional)
StopClassification/OffStreet/Ferry/AnnotatedFerryRef/FerryRef/ National Ferry code for ferry port.
StopClassification/OffStreet/Ferry/AnnotatedFerryRef/Name/ Name of port. (optional, @lang) name=*
StopClassification/OffStreet/Ferry/AnnotatedFerryRef/Location/ Location type Location if different from that specified for point. -
Railway Stations
NaPTAN Attribute Sample data Description OSM Tagging
StopClassification/StopType/ RSE or railStationEntrance Rail Station Entrance entrance=* - on building entrance or gate nodes
StopClassification/OffStreet/Rail/Entrance/ (empty node) [RSE] Railway station entrance
StopClassification/StopType/ RLY or railAccessArea Rail Platform Access Area (All of these are in NaPTAN910.xml)
StopClassification/OffStreet/Rail/AccessArea/ (empty node) [RLY] Railway interchange area away from entrance
StopClassification/StopType/ RPL or railPlatform railway=platform public_transport=platform
StopClassification/OffStreet/Rail/Platform/ (empty node) [RPL] Specific platform
StopClassification/OffStreet/Rail/AnnotatedRailRef/ Collation with other industry reference systems. (See below, optional, 0+ possible)
StopClassification/OffStreet/Rail/AnnotatedRailRef/TiplocRef/ CHST, KNGX, KNGXBAL TIming Point LOcation Code. Character code 4 - 7 alphanumeric characters. Non-rail locations may also have TIPLOCs. ref:tiploc=*
StopClassification/OffStreet/Rail/AnnotatedRailRef/CrsRef/ KGX Three letter Computer Reservation System code identifying a station. (optional) ref:crs=*
StopClassification/OffStreet/Rail/AnnotatedRailRef/StationName/ Name of station. (@lang) name=*
StopClassification/OffStreet/Rail/AnnotatedRailRef/Location/ Location type Location if different from that specified for point. (optional) -
Tram/Metro/Underground Stations

We'll need to work out some way to differentiate the underground from these...

NaPTAN Attribute Sample data Description OSM Tagging
StopClassification/StopType/ TMU or tramMetroUndergroundStationEntrance Tram / Metro / Underground Entrance. railway=subway_entrance
StopClassification/OffStreet/Metro/Entrance/ (empty node) [TMU] Metro, tram or underground entrance
StopClassification/StopType/ MET or tramMetroUndergroundAccessArea
StopClassification/OffStreet/Metro/AccessArea/ (empty node) [MET] Metro, tram or underground interchange area
StopClassification/StopType/ PLTor tramMetroUndergroundPlatform Metro and Underground Platform Access Area. railway=platform
public_transport=platform
StopClassification/OffStreet/Metro/Platform/ (empty node) [PLT] Metro, tram or underground platform
StopClassification/OffStreet/Metro/AnnotatedMetroRef/ Collation with other industry reference systems. (See below, optional)
StopClassification/OffStreet/Metro/AnnotatedMetroRef/MetroRef/ Metro code for underground station.
StopClassification/OffStreet/Metro/AnnotatedMetroRef/Name/ Name of station. (optional, @lang) name=* or name:*=*
StopClassification/OffStreet/Metro/AnnotatedMetroRef/Location/ Location type Location if different from that specified for point. (optional) N/A
Bus/Coach
Group Mode StopType (Node) Stop Subtype (Node) Description OSM Tagging Node contents
OffStreet BusAndCoach BCE (Entrance) Bus or Coach station entrance. entrance=* AnnotatedCoachReference (optional, 0+)
BST (AccessArea) Bus or Coach station non-specific access area. amenity=bus_station public_transport=station. There used to be a note that mentioned for data origin consistency additional tag of naptan:bus_station=*, but taginfo shows no usage.
BCQ (VariableBay) MKD Unassigned stop within a Bus or Coach station. A specific bay will be assigned by the service. Used for variable stop allocations. Location should be the same as any BST. highway=bus_stop public_transport=platform defer adding this until import verification clarification. TimingStatus (optional)
BCS (Bay) Bay, stand or stance within a bus or coach station.
OnStreet Bus BCT MKD (MarkedPoint) Marked stop - for example a pole or a shelter. Point footprint. TimingStatus DefaultWaitTime (optional), Bearing
CUS (UnmarkedPoint) Unmarked stop (or only marked on the road). Point footprint. naptan:BusStopType=CUS - to be tagged with highway=bus_stop public_transport=platform when confirmed in person. Bearing
HAR (HailAndRideSection) Hail and ride section of route, with a linear footprint. see talktransit for questions/discussions StartPoint, EndPoint (both are Location types), Bearing (optional)
FLX (FlexibleZone) Flexible zone, with an area footprint. see talktransit for questions/discussions Location (3+)
Node Contents
NaPTAN Attribute Values/Sample data Description OSM Tagging
TimingStatus Status of the registration of the bus stop as a timing point. Enumerated value. Default is PTP. (optional)N/A
PPT or principlePoint N/A
TIP or timeInfoPoint N/A
PTP or principleTimingPoint N/A
OTH or otherPoint N/A
AnnotatedCoachRef Collation with other industry reference systems. (See below, optional, 0+)
AnnotatedCoachRef/CoachRef National coach for coach location (Including National Express Group codes). naptan:CoachRef
AnnotatedCoachRef/ Name of coach location. (@lang) naptan:coachref_name
AnnotatedCoachRef/LongName Long name of coach location. (optional, @lang) N/A BB
AnnotatedCoachRef/Location Location type Location if different from that specified for point. (optional) N/A
DefaultWaitTime Default time to wait at the bus stop as a Duration. N/A BB
Bearing Direction along street in which vehicle is pointing when stopped at stopping point. naptan:Bearing=*
Bearing/CompassPoint N, S, E, W, NE, SE, NW, SW Eight point compass bearing
Bearing/Degrees Bearing in degrees.
Taxi
NaPTAN Attribute Sample data Description OSM Tagging
StopClassification/StopType/ TXR or taxiRank Taxi Rank (head of). amenity=taxi to achieve consistency on data origin can we tag naptan:taxi additionally
StopClassification/OnRoad/Taxi/TaxiRank/ (empty node) [STR] The head of a shared taxi rank
StopClassification/StopType/ STR or sharedTaxiRank Shared Taxi Rank (head of).
StopClassification/OnRoad/Taxi/SharedTaxiRank/ (empty node) [TXR] The head of a taxi rank

StopArea

A StopArea represents a grouping of related stop points. Stop areas may themselves be grouped hierarchically into larger stop areas using an ‘is part of’ relationship.

Tags were originally mapped onto a site relation with a site=stop_area as per the Unified StopArea proposal. However, it is now recommended to use public_transport=stop_area as per the updated Public Transport v2 proposal. If you see any using the old type=site + site=stop_area, please update to type=public_transport + public_transport=stop_area.

NaPTAN Attribute Sample data Description OSM Tagging
StopAreaCode/ Code that uniquely identifies the stop area within the UK. (Matches pattern [0-9]{3}[G0][A-Za-z0-9]{1,8}) naptan:StopAreaCode=*
PrivateCode/ A private code that uniquely identifies the area. May be used for interoperating with other (legacy) systems. (optional) N/A
Name/ Name of the area. (@lang) name=* for data origin consistency prefer naptan:stoparea_name
ParentStopAreaRef/ (An AtcoCode for a StopPoint) Code that identifies any parent stop area of the area. Many levels of parent hierarchy are allowed. (optional) (Will belong to that relation)
AdministrativeAreaRef/ (3 digit NPTG code) NPTG administrative area that manages stop area. naptan:AdministrativeAreaRef
StopAreaType/ * Field representing the type of stop area, can be any of the following. naptan:StopAreaType=*
GPBS On-street Bus/ Coach / Tram stop pair (one in each direction). Tagging should be done on the nodes themselves
GCLS On-street Bus / Coach / Tram stops cluster (more than two stops in the same general location).
GAIR Airport Building
GBCS Bus / Coach Station
GFTD Ferry Terminal or Dock Building
GTMU Tram / Metro / Underground Station.
GRLS Rail Station.
GMLT or multimodaInterchange (Deprecated)
GOTH or otherStructure (Deprecated)
GCCH or coachCoverage Coach Service Coverage
Location/ (Location object) Spatial coordinates of the area. N/A

Proposed import process for individual OSM features

stub - more content to the added to this section

Places

In some cases we will create new place in the OSM database, and other cases we will be adding additional information to an existing OSM place. We may also defer importing any data and request manual consideration.

In NPTG the place name is divided into two sections, Name and Qualifier, in addition there is an optional Short_Name. The qulaifier is used to distinguish Cambridge(Cambridgeshire) from Cambridge(Gloucestershire)/ Places in NPTG are also organised into a hierarchy so Westminster is 'in' London.

We will first determine if a place of the same name exists in OSM in a similar location.

If it does we will add additional 'naptan' fields to the existing place. We may create 'FIXME' notes if there are differences that could benefit from manual attention.

If no place exists into OSM we will create a new place, add the 'naptan' fields and also fill in the main place fields.

We will then use the parent field to create relations between places using an is_in relation.

Bus Stops/Stations

Airports/airport entrances

Ferry terminals

Railway Stations/Entrances

Stop Areas

Footnotes

  1. 1.0 1.1 1.2 1.3 Only when 'actively' converting the data