Use bearing to more accurately locate points on a network

When you perform a network analysis,Network Analyst must determine the location on the network dataset where each analysis input lies. Network locations are calculated based on several factors, including the geographic locations of the inputs, the settings of the network analysis for which the inputs will be used, and user-specified location settings in the tool or function being used to locate the inputs.

Learn more about locating network analysis inputs

The direction in which a vehicle is moving is an additional factor that can help to accurately determine its location on a network. The graphics below illustrate this principle.

GPS location without bearing represented as a circle
Without bearing information, it is hard to tell which street the vehicle is on. It could be on either the north–south or east–west street.
GPS location with bearing represented as a triangle
It becomes clear that the vehicle is heading north on the north–south street when the bearing information is included.

The ArcGIS Network Analyst extension allows you to use this principle to accurately locate points on a network dataset.

GPS devices often calculate bearing in addition to current geographic location. You can use this information when locating points on the network during a network analysis. Doing so results in more accurately placed network analysis objects. This also helps prevent driver confusion because the routes and directions that you generate from these moving points are likely to start from the correct location.

It is common, for instance, to send a truck's current location and bearing via a mobile phone equipped with a GPS receiver to ArcGIS Server where the information is loaded as the first stop in a route analysis. Other stops the truck hasn't visited yet are loaded as well, the route is solved, and the results and directions are sent back to the driver's phone. Using the bearing information during this process helps prevent the truck from starting its route on the wrong street when the truck happens to be near an intersection or an overpass. It also helps the ArcGIS Network Analyst extension verify the direction in which the vehicle is traveling so that the start of the resulting route matches the direction the vehicle is currently traveling.

Bearing and BearingTol fields

The ArcGIS Network Analyst extension can use bearing information from the Bearing and BearingTol fields in network analysis inputs. These fields are described below.

  • Bearing—The direction the vehicle or person is moving. The bearing must be specified in degrees and is measured clockwise from true north. Typically, values are between 0 and 360; however, Network Analyst also interprets negative values by subtracting them from 360 degrees.
  • BearingTol—Short for bearing tolerance, this field is where you specify the maximum acceptable difference between the heading of a vehicle and a tangent line from the point on a street where Network Analyst attempts to locate the vehicle. In other words, the bearing tolerance is used to determine whether the direction in which a vehicle is moving generally aligns with the underlying road. If they align within the given tolerance, the vehicle is located on that edge; if not, the next nearest eligible edge is evaluated.

    The BearingTol units are degrees, and the default value is 30. You can choose any tolerance that is greater than 0 and less than 180.

Network Analyst and the Bearing and BearingTol fields

The following steps provide an overview of how Network Analyst evaluates the bearing fields:

  1. Network Analyst snaps the point to the nearest edge.
  2. The bearing tolerance is calculated from the point on the nearest edge to set the minimum and maximum bearing values. This is done for both directions of travel.
  3. The bearing of the point you are adding is compared with the minimum and maximum allowable bearing values for each of the two travel directions.
    • If the bearing falls within the tolerance, the point is added there as a network location. The direction of travel on the road is also determined—it matches the direction of the bearing tolerance that the bearing falls within.
    • If the bearing falls outside the tolerance, the point isn't located, and the bearing tolerance of the next nearest eligible edge is evaluated. (Some edges may be ineligible for other reasons, for instance, if you chose not to locate on restricted elements or to exclude all highways. In this case, all edges that are prohibited or highways are skipped.) This process repeats until the point is located on a suitable edge or the point is left unlocated after exceeding the specified snap tolerance.

Use the Bearing and BearingTol fields in your analysis

When performing analysis using network analysis layers and loading points for input classes—such as Stops, Facilities, or Origins—the Add Locations tool automatically uses Bearing and BearingTol fields in your input table. You do not need to use field mapping or do any special configuration. The fields are used if they are present in the input data.

When performing analysis in Python using the Network Analyst module, arcpy.nax, the Bearing and BearingTol fields are explicitly included in the list of supported fields for each analysis input class. To use the fields, map fields from your input into the fields in the input class using the field_mappings parameter of the load method, as you do for any other input fields you want to map.

Learn more about field mapping in the Network Analyst module

Keep in mind the following when working with the Bearing and BearingTol fields:

  • The Bearing and BearingTol fields in your input data must have a data type of short, long, or double.
  • If the mapped input field values for a point are null, the point is located the standard way, that is, without regard to bearing and bearing tolerance.


The series of graphics below and accompanying captions illustrate how Network Analyst processes the Bearing and BearingTol fields.

Vehicle traveling north
1. A vehicle with a GPS receiver on a mobile phone travels north through a four-way intersection and sends its current location and bearing to ArcGIS Server running the Network Analyst extension.
GPS coordinate and bearing
2. The black lines represent network edges. The triangle and the dashed line represent the location and bearing of the vehicle as recorded by the GPS receiver. Note that the captured location is rather inaccurate, possibly due to inaccuracies of the GPS receiver, inaccuracies of the digitized streets, or both. The GPS receiver also indicates the bearing is about 345 degrees, which is slightly incorrect too; it should be 0 degrees since the vehicle is traveling north.
Bearing outside the bearing tolerance
3. The point is snapped to the nearest edge, and compared with the bearing tolerance, which is represented by the blue gradients in this example. The BearingTol value is 30, so the tolerance spans 15 degrees to either side of the edge in both the east and west directions. The red arrows are added to emphasize that the bearing is more than 15 degrees from the edge in both directions. Since the bearing falls outside the tolerance, the point isn't located on this edge.
Bearing inside the bearing tolerance
4. The point is snapped to the next-nearest edge and loaded as a network location there since the bearing falls inside the bearing tolerance. Also, the Network Analyst extension knows the object is going north since the bearing falls within the north-facing bearing tolerance.