- Home
-
Public Sector
Public Sector
Quick links to popular content
- Business
-
Leisure
Leisure
OS getamap – print your route
Have your map custom made
Visit our shop
Read our magazine
-
Education & Research
Education & Research
Schools
Further & Higher Education
Research
General interest
-
About us
About us
Quick links
- Support
ITN GML output format
Go to: GML overview | Format description | XML schema
OS MasterMap® Integrated Transport Network™ Layer (ITN) data is supplied in GML (Geography Mark-up Language) version 2.1.2. To make use of the following information, you need an understanding of XML (eXtensible Mark-up Language) and XML schemas.
GML overview
ITN related information
As a reference, you may wish to refer to the Open GIS Consortium (OGC™): Geography Markup Language.
The XML specifications that GML is based on are available from the World Wide Web Consortium (W3C®) website: http://www.w3.org.
Information about Unicode and UTF-8, the character encoding we have chosen, is available on the Unicode Consortium website: http://www.unicode.org/.
Use of examples
Any examples in this page that mention specific data content are to be taken as examples only. All data content is defined in the ITN specification separately.
Clarification of the terms used
Feature attribute – attribute, as defined in the Ordnance Survey glossary, is called a feature attribute in this web page.
XML attribute – attribute as used in an XML context is referred to as an XML attribute.
Property – most feature attributes are encoded as GML properties. Property means a GML property.
Query – each GML output provided by Ordnance Survey is in response to a request for data from a data user. The original request from the data user may have been split into multiple requests based on supply requirements, for example, chunks. In this section each part of the data request is called a query.
Extent – as part of a request for data, the user can specify a polygon that delimits the area of data required, which is called the query extent. If the query has been broken down into parts (chunks) for reasons of supply, then the query extent will be the geometry of the partial query.
Format description
XML declaration
The XML declaration to all query results is:
Document type
All information returned from a query is provided in an osgb:FeatureCollection. If no feature lies inside a query then an empty collection is returned with its required collection properties.
The following documents define the XML namespaces:
osgb http://www.ordnancesurvey.co.uk/xml/namespaces/osgb
gml http://www.opengis.net/gml
xsi http://www.w3.org/2001/XMLSchema–instance
xlink http://www.w3.org/1999/xlink
The location of the schema is defined as:
http://www.ordnancesurvey.co.uk/xml/namespaces/osgb
http://www.ordnancesurvey.co.uk/xml/schema/v7/OSDNFFeatures.xsd
The fid is set to the Ordnance Survey identifier given to the query. For example:

Query result properties
The gml:description element is the first property of the feature collection; this contains a copyright statement and the date of the query.
The gml:boundedBy element is the next property of the feature collection; this contains a gml:null element with the value of unknown.
The start time of the query is specified at GMT as a feature property. The name of the property is queryTime.
The following optional properties are provided for the osgb:FeatureCollection if they were provided as part of the query. The ordering of these properties is defined in the table below:
|
Name |
Type |
Format |
Description |
|
queryExtent |
Geometric property |
gml:Polygon or osgb:Rectangle |
The query extent provided as part of a spatial query. |
|
queryChangeSinceDate |
Date |
CCYY-MM-DD |
The date that was given as part of a change-only query. |
For geographically chunked data, if there are features in the collection, the last element in the feature collection is an osgb:boundedBy element. This is a gml:Box defining the minimum bounding rectangle of all items in the collection, including the query extent. If the collection is empty, no osgb:boundedBy element is provided.
For example:

Features
Each feature within the osgb:FeatureCollection is encapsulated in one of the following member elements according to its feature type:
|
Member element |
Feature type |
|
networkMember |
RoadLink, RoadNode, PathLink, PathNode, FerryLink, FerryNode, FerryTerminal |
|
roadMember |
Road |
|
pathMember |
Path |
|
roadInformationMember |
InformationPoint, RoadNodeInformation, RoadLinkInformation, RoadrouteInformation, RoadPartialLinkInformation |
|
pathInformationMember |
PathNodeInformation, PathLinkInformation, PathrouteInformation,PathPartialLinkInformation, PathPartialRouteInformation |
|
departedMember |
DepartedFeature (see the later section Change-Only Update (COU)). |
Each member element contains a single feature element that has the name of the feature type, for example, RoadLink, RoadNode, PathLink, PathNode and so on.
The TOID of the feature is provided in the XML attribute field of the osgb:Feature element. A TOID has a maximum of 16 digits and is prefixed with 'osgb'. This prefix is required to form a valid XML ID type.
A feature element does not contain a name, description or boundedBy element. For example:

Properties
Our application schema defines three main types of properties that are present inside a feature element. These are simple, complex and geometric properties.
The ordering of properties within a feature element is important because XML validation is reliant on elements being in a specified order. The order of properties is specified within the XML schema.
Each type of property may additionally have associated metadata encoded using an XML attribute. This metadata provides some qualification of the status or accuracy of the content provided in the attribute. To see what metadata is currently encoded in this way, read ITN attribute definitions and values.
Simple
A simple property is one that contains a single piece of non-geometric information. These properties correspond to the simple feature attributes defined (explained in ITN attribute definitions and values). The value of each feature attribute is enclosed in an element that takes its name from the feature attribute.
A feature association is a special type of simple property that defines a relationship between one feature and another. The feature association is defined by the XML attribute xlink:href. This refers to a feature as if it was locally available, even though this is not guaranteed to be the case; that is, it is set to the character ‘#’ followed by ‘osgb’ and then the TOID of the feature being referenced.
For example:

Geometry
A geometric property is one that describes a specific geometry. All geometric properties are encoded according to the GML specification. We have extended the GML v2.1.2 specification to include a rectangle that is defined by two points. The first point defines the minimum coordinate; the second point defines the maximum coordinate.
All geometric properties are encoded by placing the GML geometry elements inside an element that takes its name from the feature attribute.
The XML attribute srsName is set to osgb:BNG (BNG stands for British National Grid), which uses eastings and northings specified in metres.
Complex
A complex property is one that contains more than one piece of information. These properties correspond to complex attributes (described in ITN attribute definitions and values).
The definition of a complex property in this context is recursive, so complex properties may be nested. This recursion is not used currently within OS MasterMap.

Figure 1: Complex property class model
The complex property element takes its name from the complex feature attribute. Each part of a complex property is encoded as a simple, complex, geometry or topology property, as appropriate, inside the complex property element.
For example:
Change-Only Update (COU)
COU requires that information be provided for features that were present in a spatial query but no longer meet the query criteria. Such features may have changed theme so that they are no longer in any of the themes being requested, had their geometry modified between queries so that they no longer meet the spatial criteria, or have been deleted. These features are represented using the DepartedFeature feature type.
These are encoded the same way as other features.
For example:

COU is not a feature that will be provided within the first release of ITN Urban Paths Network but is intended to be introduced at a later stage in the product lifecycle.
XML schema
Schema overview and Internet location
XML schemas are used to validate the format and content of the GML. The GML 2.1.2 specification provides a set of schemas that define the GML feature constructs and geometric types. These are designed to be used as a basis for building application-specific schemas, which define the data content.
The Ordnance Survey application schemas, which are referenced by the data, are available from our website at http://www.ordnancesurvey.co.uk/xml/schema.
These schemas make use of XSDs (XML Schema Definitions) and DTDs (Document Type Definitions) produced by the W3C and available from the W3C website at
http://www.w3.org/XML/1998/namespace.html.
Note: Some recent parsers now fail to validate OS MasterMap using these schemas because changed working practices and XML schema specification clarifications have led to a decline in the use of GML 2.1.2.
Schema descriptions
The W3C-provided XSDs and DTDs are:
- xml.xsd – to allow the use of the xml:lang attribute for language qualification
- XMLSchema.dtd – required by xml.xsd
- datatypes.dtd – required by XMLSchema.dtd
The OGC-provided schemas are:
- feature.xsd – the feature and property constructs
- geometry.xsd – the geometric constructs such as polygon and point
- xlinks.xsd – a schema based on the W3C XLINK recommendation and provided by the OGC to make use of the XLINK constructs
The Ordnance Survey application schemas are:
- OSDNFFeatures.xsd – the definition of the Ordnance Survey features and their properties
- OSComplexTypes.xsd – the complex property types, including changeHistoryType
- OSSimpleTypes.xsd – the basic property types, including descriptiveGroupType and
- accuracyOfPositionType
- OSMeasures.xsd – the definition of measure qualified types used in OS MasterMap data
- OSQueryresult.xsd – the definition of a query result with its properties
- OSGeometryTopology.xsd – geometry and topology extensions to the GML 2.1.2 specification required by Ordnance Survey, including rectangles and polygon topology
The required XML namespaces are:
In this section:
ITN Technical specification – home
ITN Road Routing Information (RRI) theme
ITN Path Routing Information (PRI) theme
Feature types and attribution in the Road Network theme
Feature types and attribution in the Road Routing Information theme
Feature types and attribution in the Urban Paths Network theme
Feature types and attribution in the Path Routing Information theme
Descriptions of ITN Layer attributes
Attribution checklists for the Road Network and Urban Paths Network themes
ITN attribute definitions and values
This web page is part of the technical specification for OS MasterMap® Integrated Transport Network™ Layer. For the terms that apply to use of this specification, refer to Purpose of this specification.
