Thales NaPTAN Validation Report Guide

Thales NaPTAN Validation Report Guide - ME00000724024 issue 7 - 9 June 2011

Contents

Introduction

This document describes the error and warning messages that may be produced when Thales validates submitted NaPTAN files. Each message has a unique identification number. For historical reasons not all error numbers are in use.

Some messages apply only to files submitted in CSV format; some only to those in XML format. Some apply to both formats.

There are two kinds of error:

  • XML validation errors

  • Non-XML errors

A file with XML validation errors cannot be imported into the database and checked for non-XML errors. Thus a file with an XML validation error may also have non-XML errors which will only be identified after you have corrected the known errors and resubmitted the file.

Rejected Stop Errors - STPnnn

STP001 - incorrect aa_id for import area

You have used an admin area id (AdministrativeAreaRef) that is not valid. For example the admin area id for ATCOcode 040 Buckinghamshire is 70.

Action: check and correct the admin area id.

STP002 - incorrect StopType/TimingStatus combination

Stops of type BCT must have a timing status that is PPT, TIP, PTP or OTH. Stops of type BCS or BCQ must have a timing status that is null, PPT, TIP, PTP or OTH.

Action: Check and correct the stop type and timing status combination.

STP003 - incorrect StopType/BusStopType combination

Stops of type BCT must have a bus stop type that is MKD, HAR, CUS or FLX.

Action: Check and correct the stop type and bus stop type combination.

STP004 - Hail and Ride Stop with no Hail and Ride Section

Where bus stop type is HAR it must have a HailAndRideSection defined for it.

Action: add the HailAndRideSection element.

STP008 - stop type is centrally managed

Stops with the prefix 910, 920, 930, 940 (respectively rail stations, airports, ferries, metros) cannot be included in NaPTAN files supplied by local authorities as they are centrally-managed by the DfT and Thales.

Action:

  • If the stop is a bus stop then assign it a NaPTAN ID with a prefix for your area; for example 340 for Oxfordshire.

  • If the stop is a rail station, etc. then you need to contact the DfT via David Clegg; email david.clegg@atosorigin.com. The DfT will review your request and then ask Thales to implement it. When the stops are included in the centrally managed data they will be assigned 9nn codes.

STP009 - invalid pending status

This error is not related to stops marked as pending by Thales; for information on this refer to Pending Stops and Stop Areas.

The stop has been submitted marked as pending. Submitted data cannot have the pending status.

Action: check the stop's status and correct it to either active or inactive as required.

STP011 - missing National Gazetteer ID

There is either no National Gazetteer ID or an incorrect National Gazetteer ID in the NptgLocalityRef element.

Action: add or correct the ID.

STP012 - invalid ATCOCode prefix

The first three digits of the AtcoCode must be the area code for the local authority; e.g. '340' for Oxfordshire.

Action: check the area code is valid and is for an area that you intend to include stops.

STP013 - BusStopType should be NULL for StopType

Only bus stops can have a bus stop type. Specifically, if the element StopType is not BCT, BCS or BCQ then the BusStopType element must be blank.

Action: Either change the StopType to BCT, BCS or BCQ (if appropriate) or if it is not a bus stop then remove the BusStopType (i.e. so that the element is blank).

STP014 - TimingStatus should be NULL for StopType

Only bus stops can have a timing status. Specifically, if the element StopType is not BCT, BCS or BCQ then the BusStopType element must be blank.

Action: Either change the StopType to BCT, BCS or BCQ (if appropriate) or if it is not a bus stop then remove the TimingStatus (i.e. so that the element is blank).

STP017 - Stop has been archived

The stop cannot be included in the submitted data as it previously existed and has been archived. Further information on archived stops and archiving is in the document "Transport Direct User Guide to Archiving NaPTAN Stops" available on the Public Transport Data Management web site www.dft.gov.uk/public-transportdatamanagement.

Action: check the NaPTAN stop and it's ID.

  • If the stop has genuinely been archived, using the correct process, remove it from future NaPTAN submissions.

  • If the stop has not been archived and is required then change it to a non-archived stop ID.

Note: Archiving is a one-way process. You cannot un-archive a stop - i.e. you cannot bring it back into use.

STP018 - Stop cannot be archived

  1. The stop has been specified as to-be-archived. This cannot be done until the stop has had it's modification attribute set to delete (DEL) for a minimum of three years. Stops can only be archived in less than three years with the agreement of the DfT and archiving is done by Thales.

    Action: Set the stop to DEL and wait for three years; or if you believe archiving is necessary without waiting then contact Thales.

  2. The stop has been specified as to-be-archived but there is an error in this stop's data. Stops with errors in their data cannot be archived. The data error will be described in a further message in the log file.

    Action: find and correct the error in the stop's data.

STP019 - Stop subelement has an 'archive' modification value

The stop has not been specified to be archived, but one or more of its sub-elements has been specified to be archived.

Action: if you intend to archive the stop and it's subelements, ensure that all have an archive modification. If you do not wish to archive the stop remove the archive status.

Rejected Stop Area Errors - STAnnn

STA001 - invalid ATCOCode prefix

The first three digits of the AtcoCode must be the area code for the local authority; e.g. '340' for Oxfordshire.

Action: check the area code is valid and is for an area that you intend to include stops.

STA002 - invalid pending status

This error is not related to stops marked as pending by Thales; for information on this refer to Pending Stops and Stop Areas.

The stop has been submitted marked as pending. Submitted data cannot have the pending status.

Action: check the stop's status and correct it to either active or inactive as required.

STA003 - StopArea cannot be archived

Stop areas cannot be archived.

Action: change the stop area's status to active or inactive.

STA004 - StopArea subelement has an 'archive' modification value

The stop area has not been specified to be archived, but one or more of its sub-elements has been specified to be archived.

Action: if you intend to archive the stop and it's subelements, ensure that all have an archive modification. If you do not wish to archive the stop remove the archive status.

Associated Stop & Stop Area Errors - MSCnnn

MSC001 - Stop AltNatGazID is not a valid and active locality

The specified National Gazetteer alternative locality is not an active locality listed in the NPTG database.

Action: check if you have specified the correct locality and if so that it is currently active. The NPTG database can be viewed on the Public Transport Data Management web site www.dft.gov.uk/public-transportdatamanagement. If necessary, you should reassign stops to a new locality or reactivate a locality.

MSC002 - Stop does not have a valid ATCOcode

The associated stop does not have a valid ATCOcode.

Action: correct the associated stop's ATCOcode.

MSC003 - Stop does not have a valid Common Name

The associated stop does not have a valid Common Name.

Action: correct the associated stop's Common Name.

MSC004 - Stop has duplicate alternative Common Names

Two or more of the specified alternate common names are identical.

Action: delete one of the identical common names.

MSC005 - Stop does not have a valid Hail & Ride Section

The stop does not have a valid Hail & Ride section.

Action: correct the associated stop's Hail & Ride section.

MSC006 - Stop Area Stops Missing or Invalid

  1. The stop or the stop area is missing.

    Action: add missing stops or stop areas.

  2. The stop or the stop area is present but has an error in it.

    Action: find and correct the error in the stop/stop area data. The error will be described in a further message in the log file.

MSC007 - Parent Group or Child Group Missing or Invalid

  1. The parent group or child group is missing.

    Action: add missing parent groups or child groups.

  2. The parent group or child group is present but has an error in it.

    Action: find and correct the error in the parent /child group data. The error will be described in a further message in the log file.

MSC008 - Area Hierarchy child ID has invalid prefix

In the association between two groups, the child ID has an invalid prefix.

Action: check and correct the prefix.

MSC009 -Stop availability records have same start date

Two stop availability records cannot have the same start date.

Action: either remove one stop availability record or give it a different start date, as appropriate.

SMS Number Errors - SMSnnn

General: Where does one get new SMS codes from?

Each local authority was given a list of SMS codes to use. It is just a list of codes - not linked to stops until you use them in a NaPTAN submission. The SMS code is used in the XML element; i.e. "NaptanCode" means SMS code.

SMS001 - Should be numeric

Your area is defined as using only numeric SMS codes. Example: '62923896' is an SMS code for North Ayrshire.

Action: check that you have used only digits.

SMS002 - Should be alpha

Your area is defined as using alphabetic SMS codes; i.e. contains only characters.  Example: 'bucgdtap' is an SMS code for Buckinghamshire.

Action: check that you have used only alphabetical characters, and not digits.

SMS003 - Length should be 8

This message is no longer in use and should not appear.

Action: contact Thales if you get this message.

SMS004 - Length should be 7

This message is no longer in use and should not appear.

Action: contact Thales if you get this message.

SMS005 - Invalid numeric prefix

Your area is defined as using SMS codes starting with a digit prefix (usually 3 digits but not always). The prefix is predefined for each Local Authority area.

Action: check that you are using the correct prefix for your area. Refer to the NaPTAN web site: NaPTAN > Documentation > SMS Prefixes for the numeric prefix.

SMS006 - Invalid alpha prefix

Your area is defined as using SMS codes starting with a three-letter prefix. The prefix is predefined for each Local Authority area

Action: check that you are using the correct prefix for your area. Refer to the NaPTAN web site: NaPTAN > Documentation > SMS Prefixes for the alphabetic prefix.

SMS007 - Invalid number used

Your area is defined as using SMS codes that do not start with the digit 0 or 1.

Action: correct the SMS code to not start with the digits 0 or 1.

SMS008 - Invalid alpha character used

Your area is defined as using alphabetic SMS codes. You have used another character in the body of the SMS code, such as a comma, semicolon or slash.

Action: correct the SMS code to use only alphabetic characters.

SMS009 - Found consecutive characters

This message is no longer in use and should not appear.

Action: contact Thales if you get this message.

SMS010 - duplicate NaptanCode (or numeric equivalent) in import

  1. Your submitted file contains two or more stops with the same SMS Code. SMS codes must be unique.

    Note than an SMS Code must also be unique when comparing it's numeric equivalent on a mobile phone keypad. For example the numeric equivalent of a, b & c is '2'. So an SMS Code of adgmpmt is equivalent to 2346768.

    Action: change one of them to a new and unused SMS code.

  2. An SMS code is being used by more than one stop, but it does not appear so. If you check and it appears that it isn't then the SMS code was probably used by a stop included in an earlier submission but not in this submission. The stop still exists as a pending stop. You need to submit it as a deleted stop to enable the SMS code to be used for another stop.

  3. Action: as appropriate either select a different unused SMS code, or submit the now-unused pending stop as a deleted stop.

SMS011 - NaptanCode (or numeric equivalent) already in database

An SMS code in your submitted file is the same as one already in the database. SMS Codes must be unique nationally.  The error message includes the AtcoCode and SMS Code (NaptanCode) of the rejected stop.

It could be that the SMS code you have specified is already in use for a national 940 tram/metro stop. This should apply only to areas 180, 240, 259, 320, 330, 370, 410, 410, 430, 490, 513, 540 and 609.

Note than an SMS Code must also be unique when comparing it's numeric equivalent on a mobile phone keypad. For example the numeric equivalent of a, b & c is '2'. So an SMS Code of adgmpmt is equivalent to 2346768.

Action: change it to a new and unused SMS code.

SMS012 - Length should be 5 to 9

The length of an SMS code should be between 5 and 9 characters including the prefix.

Action: check and correct the SMS code.

SMS013 - Value is invalid for stop type

This message is no longer in use and should not appear.

Action: contact Thales if you get this message.

Warnings - WRNnnn

WRN001 - Value too long, will be truncated (Warning only)

The text is too long and will be truncated to 48 characters.

Action: change the text to be 48 characters or less.

WRN002 - Obsolete Type Used. Type is:

The following StopArea records were successfully imported but were of type GOTH or GMLT (as specified in the message) which should no longer be used.

XML Validation Error - VAL001

Your file has one or more XML validation errors (and so the file cannot be imported into the NaPTAN database). The error is described in the message.

Commercial or Supported Software

If you are generating your NaPTAN XML file with a commercial or supported product then contact your product's supplier for advice.

Provide them with your XML file and the VAL001 message text in the Thales validation report.

It should not be possible to create an invalid XML file; they should be able to correct their system in order to prevent generating invalid XML files with this validation failure in the future. They may also be able to add an XML validation operation at the end of the generation of the XML file in order to confirm that the file is valid.

Unsupported Software

If you are unable to obtain support for the software you use to generate your XML file then you will have to locate and correct the error.

  • Use a file viewer to locate the error; advice on these is given below.

  • Refer to the NPTG & NaPTAN Schema Guide document on the NaPTAN web site for information about the NaPTAN schema.

  • It should not be possible to create an invalid XML file and you may wish to consider amending the software to prevent this happening.

Basic File Viewing & Error Location

You may find it useful to view your file using a text editor.

  • Locate the error using the ATCO Code given in the error message.

  • In addition, the XML validation error message includes a reference to the approximate point in the file that is in error. This is in the form (line, column); for example (330, 14) is line 330, column 14 and (2, 58212) is line 2 column 58212.

Many products that generate XML do not include line-feeds in the generated files, giving rise to locations with small line numbers and large column numbers, such as (2, 58212).

Easier File Viewing and Validation - XML Validation Tools

It is much easier to view or validate your files using an XML validation tool; some of these are described in the list below. Inclusion in the list does not mean that the tool has been formally tested, validated or endorsed in any way.

Tool Features

Altova XML Spy

See www.altova.com

Good feature set

Slow on a low spec PC

Cost approximately £400

Liquid XML Studio

See www.liquid-technologies.com

Good feature set

Slow on a low spec PC

Free (Community Edition - no longer available)

Starter Edition approximately £65

XMLPad

See www.wmhelp.com

Relatively fast

No documentation but easy to use

Validation accuracy has been questioned

Free

XML Fox XML Editor

See www.xmlfox.com

Some limitations

Free

Altova AltovaXML

See www.altova.com/altovaxml.html

Basic DOS command line file validation

Free (Community Edition)

Common XML Errors

Below are descriptions of some common XML validation errors.

invalid Compass Direction

Some stop types can have a direction - this can be one of the following eight values: N, S, E, W, NE, NW, SE, SW. Stops can optionally use the Degrees element instead of CompassPoint - this should be a the range 0 to 360, although this option is rarely used.

Action: Check and correct the stop's so that it is one of the eight permitted values.

invalid direction for BCT Stop

BCT stops have a direction - this can only be one of the following eight values: N, S, E, W, NE, NW, SE, SW. Stops can optionally use the Degrees element instead of CompassPoint - this should be a the range 0 to 360.

Action: Check and correct the stop's so that it is one of the eight permitted values.

invalid DefaultWaitTime

The MarkedPoint element describes the properties of a marked on-street bus, coach or tram stop. (Stop type 'BCT-MKD'). It optionally includes a DefaultWaitTime element: the Default time to wait at the bus stop. Times may be either zero '0' or in the form PT999M99S, for example, 'PT12M22S' to denote twelve minutes and twenty-two seconds. The seconds may be omitted, thus PT99M, for example, PT5M.

Action: check the DefaultWaitTime element and make sure that the time is defined in the correct form.

invalid BusStopType

The BusStopType element contains an invalid value according to its data type. This element can only be one of the following four values: MKD, CUS, HAR, FLX.

Action: check the BusStopType element and correct so that it is one of the four permitted values.

invalid TimingStatus

The TimingStatus element contains an invalid value according to its data type. This element can only be one of the following four values: PTP, TIP, PPT, OTH.

Action: check the TimingStatus element and correct so that it is one of the four permitted values.

invalid Status

The StopPoint element contains an invalid Status attribute. The Status attribute can only be one of the following three values: ACTIVE, INACTIVE, PENDING.

Action: check the Status attribute and correct so that it is one of the three permitted values.

invalid ModificationDateTime

The StopPoint element contains an empty ModificationDateTime attribute. The ModificationDateTime attribute requires a value.

Action: check the ModificationDateTime attribute and correct the error(s).

invalid Name

The StopAreaCode element contains an invalid value in the Name sub-element according to its data type. This element cannot be any of the following values: , [ ] { } ? $ £ % ^ = @ # ; : The Name sub-element has a maximum length of 48 characters.

Action: check the Name sub-element and correct the error(s).

invalid Northing

The element Northing within the EndPoint section of the HailAndRide section contains an invalid value 4296430. The Northing element must contain an integer between 0 and 1999999.

Action: check the Northing element and correct the error(s).

invalid LocalityCentre

The LocalityCentre element contains an invalid value according to its data type. This element can only be set to one of the following four values: TRUE, FALSE, 1, 0 (where 1=TRUE and 0=FALSE).

Action: check the LocalityCentre element and correct so that it is one of the four permitted values.

invalid NPTGLocalityRef

The NPTGLocalityRef element contains an invalid value according to its data type or the element is empty. This element must contain a value starting with E00xxxxx (existing Locality) or N00xxxxx (new Locality).

Action: check the NPTGLocality Ref element and correct the error(s).

Hail and Ride Stop has an invalid Hail and Ride Section

The HailAndRideSection Element associated with a HailAndRide element has a mistake in it.

Action: check the HailAndRideSection Element and correct the error(s).

Flexible Stop with insufficient or missing points to define a Flexible Zone

The FlexibleZone Element defines a polygon bounding the flexible zone. It has to have at least three points.

Action: ensure you have included sufficient points to define the boundary of the zone.

incomplete XML file

Unable to determine the version of the NaptanXXX.xml file, check if XML is well-formed. The XML file submitted is an incomplete file and cannot be imported.

Action: re-submit new XML file.

Pending Stops and Stop Areas

The NaPTAN Update error report email sent by Thales after your submission has been processed may identify stops or stop areas as having been marked as 'pending' by Thales; for example:

The Stop count was previously:
Active: 12273 Deleted: 1968 Pending: 2
The Stop count is now:
Active: 12263 Deleted: 1984 Pending: 2

A pending stops report - PendingStops.txt &/or PendingStopAreas.txt - accompanies all emails where stops have been marked as pending; for example:

Pending Stops Report
Area ID:  123
Created: 11/06/2009 16:10:01
Total Stops Pending:  2
-------------------------------------------------------------------------
ATCOCode     ,      Common Name,    Reason
-------------------------------------------------------------------------
1230487      ,      Badger Golf Club,    Pending due to Missing Record
1230492      ,      Chocolate Crescent,  Pending due to Error in File / Record

Thales mark stops as pending if their status is uncertain. This can be for either of two reasons; identified as in the example above:

  1. Pending due to Missing Record - Your submission is missing stops that were submitted previously.

    The NaPTAN specification states that stops should never be deleted from the NaPTAN database but instead flagged as deleted, in order to maintain integrity with data that may have been produced when the stops were "live". If an existing stop is not present in a new NaPTAN submission, the stop is marked as "Pending" by Thales until a decision is made by the supplying Authority whether the stop should be marked as "Delete". The deleted stop is also still viewable via the NaPTAN Viewer so that every stop in the database is visible to users.

    Action: For each 'Missing Record' stop/stop area, check if the stop was in a previous submission and if so reinstate it. If your intention is to delete the stop then mark it as "Delete" in the StopPoint or StopAreaRef element. Resubmit the data.

  2. Pending due to Error in File/Record - Your submission has stops with mandatory data that is missing or invalid.

    The accompanying NaPTAN Validation Report will have an error message for the stop in that identifies the problem.

    Action: For each 'Error in File' stop/stop area, search through the NaPTAN Validation Report for that stop code: this will describe the error; locate the problem identified, correct it and resubmit the data.


Thales

Thales NaPTAN Validation Report Guide - ME00000724024 issue  7 - 9 June 2011