For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get the Data and Create the Network Dataset

For Network Analyst to recognise the source network data, it must be in a File Geodatabase (gdb) Feature Dataset. OS MRN data is available from the OS Data Hub in Geopackage format (gpkg) or Protocol-Binary Buffer Format (pbf), so needs to be transformed into Geodatabase (gdb) format. Transformation software packages such as FME can be used to accomplish this, but it is also possible to do this directly in ArcGIS Pro.

To create a network dataset from OS MRN data in Network Analyst, you need to transform the supplied data through a number of steps before setting up the network properties. In initial testing, a lengthy process was developed to do this, requiring a large number of manual steps to get the OS MRN data into the correct format. These manual steps have now been incorporated into an ArcPro notebook (OSMRN_Esri) that goes through all the stages to create the network dataset from OS MRN data in geopackage format. This can be downloaded from the OS MRN Downloads page.

ArcPro Notebook information

The OS MRN_Esri notebook required to transform OS MRN data into the correct format for Esri Network Analyst can be downloaded from the OS MRN Downloads page.

To convert the geopackage into feature classes: run SECTION 1 of the OSMRN_Esri notebook. SECTION 2 of the notebook will be covered in the ‘Turn Restrictions’ heading. The parameter settings in this script will need to be adapted to define the folder names and data source locations to the user’s own required configuration.

As the OS MRN data is natively in a geographic Coordinate Reference System (CRS) (latitude, longitude), it is possible that any length attribute for the transportlink shows the length in decimal degrees and not metres and, therefore, it cannot be used in the calculation of various Travel Attributes such as Costs. This script therefore also adds a length field, measured in metres, to the underlying OS MRN dataset.

If this part of the script is not used, it will be necessary to find an alternative approach, such as manually adding a length in metres value to the underlying OS MRN transportlink data. This can be done using the Calculate Geometry Attributes tool (not part of Network Analyst), but this will also require the Network Dataset to be recreated to include the new attribution.

The rest of this document will assume that a length attribute (with value in metres) has been added to the OS MRN data either manually or by using the script.

Turn restrictions

The OS MRN dataset contains a specific Turn Restrictions Feature Type which provides line geometry that indicates turn restrictions for the given Transport Link. This is supplied as a table defining the types of restrictions and the transportlinks and transportnodes involved in those restrictions.

The turn restrictions in OS MRN are made up of two categories:

  • Prohibited turns – turn geometries that cannot be traversed. These have the restriction attribute values of ‘no_left_turn’, ‘no_right_turn’, ‘no_u_turn’, or ‘no_straight_on’.

  • Mandatory turns – turn geometries that must be traversed. These have the restriction attribute values of ‘only_left_turn’, ‘only_right_turn’, ‘only_u_turn’, or ‘only_straight_on’.

See the Turn Restriction overview page for more details on the Turn Restriction Feature type.

In an ArcGIS Network Dataset, all turn restrictions need to be set up as geometries that cannot be traversed. This means that the mandatory turns in the OS MRN need to be converted into a series of prohibited turns as described in the Prohibited Turns section below. Network Analyst also requires the turn restriction data to be in a specific format called a Turn Feature Class, which is not aligned with how OS MRN turn restrictions are provided, and therefore means processing of the data is required. Information on what constitutes a Turn Feature Class and the required format can be found in the Esri ArcGIS Pro documentation: Turns—ArcGIS Pro | Documentation.

Network Analyst requires each turn restriction feature to have all the associated edges (network links) in the turn restriction geometry to be identified and given the following attributes and values (# represents a number increasing from one for each edge involved in the geometry of the turn):

  • Edge#End: Indicates whether the turn passes through the end of the first edge (Y means the turn passes through the end of the #th edge, while N means the turn passes through the beginning of the #th edge).

  • Edge#FCID: The feature class ID of the transportlink. This will be identified automatically in the script. It can also be found in Layer Properties > Source.

  • Edge#FID: The OBJECTID of the line feature that represents the #th edge of the turn. This will be the OBJECTID of the transportlink in the Network Dataset, NOT the feature wayid of that edge in the underlying OS MRN _turnrestriction_data.

  • Edge#Pos: The position along the line feature that represents the #th edge of the turn. This denotes how far along the edge the evaluation of the turn starts to take effect. We default this to 0.5 (halfway along the feature).

Prohibited Turns

For a simple prohibited turn involving just two links, the from and to attributes in OS MRN turnrestiction, contain the wayid of the transportlinks involved in the turn. To create a turn feature class, these wayid values must be mapped to their corresponding OBJECTID and structured as Edge1FID and Edge2FID.

For more complex prohibited turns, involving more than two links, the OBJECTID values of the transportlinks in the from, to, and via attribute fields will need to be mapped to the turn feature class.

Mandatory Turns

As turn restrictions only accept the geometry of turns that cannot be made, we must identify all the other possible turns that could be made at the location of a mandatory turn and infer these as turn restrictions. For example, in the case of an OS MRN turnrestriction for a mandatory left turn (‘only_left_turn’) at a standard 4-way crossroads, we must identify the other possible turns and create inferred turn restrictions for these, i.e., ‘no_right_turn’ and ‘no_straight_on’. This leaves the network with the only option of a left turn, which corresponds to the ‘only_left_turn’ feature in OS MRN turnrestrictions.

This clearly involves more complex operations to identify the transportnode associated with the mandatory turn and all the other transportlinks connected to that transportnode. Then turn geometries need to be created for those transportlinks involved in the inferred turns by mapping the wayid values, to the corresponding OBJECTID, as per the above.

To format the data for Network Analyst run SECTION 2 of the OSMRN_Esri ArcPro notebook. SECTION 3 will be covered under ‘Build the Network’. This will convert the turnrestrictions data in OS MRN into the Turn Feature Class format required by Network Analyst.

Running Section 2 in its entirety will create a Network Dataset with turn restrictions incorporated. The Network Dataset and an associated Junctions feature class will appear in the File Geodatabase Feature Dataset in the Catalog pane and should also appear automatically in the Map window.

A screenshot of Esri ArcGIS Pro showing the Network Dataset and associated Junctions in the Catalogue pane and mMap window.
The Network Dataset appears in the Catalog and the Map window once created.

Once the Network Dataset has been created, remove it from the Map window. This is required as it is not possible to edit any of the Network Dataset properties whilst it is displayed in the Map window.

Note that whilst the Network Dataset has now been created, its properties must be configured. Following this, the network will be built, so it can be used for network analysis, routing, etc.

Right-click on the Network Dataset in the Catalog pane and click on Properties. The Network Dataset Properties dialog box is where all the additional settings are configured, such as defining travel modes (for example, driving, walking, cycling), setting costs (for example, how long it takes to traverse a transportlink for the different travel modes), travel restrictions (such as height and weight), and so on. There are five sections to the Network Dataset Properties dialog box, accessed by the menu options on the left of the dialog box. The ‘General’ section gives various metadata about the Network Dataset and its current properties. At this stage, the network hasn’t yet been built, which is why the number of edges, junctions, and turns are all zero.

Creating the Network Dataset

Saving changes to the Network Dataset Properties

If any of the Network Dataset Properties are set up incorrectly, for example, if there’s an error in a field script, it will not be possible to save changes to the Network Dataset Properties. Changes can be saved by clicking ‘OK’ at the bottom of the Network Dataset Properties dialog box shown below. No specific error message is given to indicate why the network cannot be saved in this case.

It is recommended that the network is saved after each stage of set up or when making changes to the Network Dataset Properties. This way, if it is not possible to save, it will indicate that the error is in the step most recently applied and will avoid needing to search through multiple steps to find an error.

A screenshot of the Network Dataset Properties dialogue window showing data for the Network Dataset extension.
General section of the Network Dataset Properties dialog box.

Click ‘OK’ in the Network Dataset Properties window to save the changes.

The rest of the this guide will be set up in line with the order taken in the Esri tutorial.

Source Settings

Within the Source Settings section of the Network Dataset Properties dialog box, there are options for specifying and amending Vertical Connectivity and Group Connectivity.

Vertical Connectivity settings enable the Network Analyst tool to determine which data attributes to use to define the relative vertical separation of different transportlink features, (‘grade separation’). This prevents the Network Analyst tool from building a network that incorrectly allows direct travel between links that are at different vertical levels, for example, from a road over a bridge onto a path running under the bridge. There are no specific elevation attribute fields in the OS MRN data because OS MRN handles grade separation by having multiple nodes with very slightly offset locations at points where transportlink features at different elevations cross each other. More information on this attribution can be found in the OS MRN documentation at the following link: OS MRN Grade separation.

Due to the nature of the OS MRN data, as described above, no Vertical Connectivity settings are required.

A screenshot of the Network Dataset properties dialog showing the Vertical Connectivity tab in the Source Settings window. Setting shows Policy set to 'none'.
The Vertical Connectivity settings window.

For Group Connectivity, keep the default setting of 'Endpoint' as shown below. OS MRN is structured such that there are nodes (endpoints) at all points on the network where links connect, for example, where road links meet at nodes. Further guidance on this can be found in the Esri documentation at: Connectivity—ArcGIS Pro | Documentation.

A screenshot of the Network Dataset properties dialog showing the group Connectivity tab in the Source Settings window. Setting shows the default setting of 'Endpoint' is set.
The Group Connectivity settings window.

Last updated

Was this helpful?