Snap To Roads (Network Analyst Tools)
Summary
Aligns an ordered sequence of related point features, such as GPS observations or track points, to a road network, accounting for the properties of the network and travel mode.
Because the input points are assumed to be a travel path along roads, this accounts for the sequence of points and travel times between them along the network rather than snapping each point independently. The tool is typically used to align raw, imprecise GPS coordinates to the road network for data cleaning and route adherence workflows.
Usage
The travel mode influences snapping behavior. The snapping algorithms use the travel mode settings when determining the most likely roads that were traveled. For example, if the travel mode restricts travel on express lanes, the algorithms attempt to return roads that are not express lanes. However, in cases where the track clearly indicates the use of an express lane, the algorithms return the express lane regardless of the restriction setting. In other words, the travel mode settings are used as a guideline to influence the snapping behavior, but they may be overridden when the track data does not match those settings.
In addition to snapping the input points to the network, the tool can output lines representing the inferred road paths along the network.
In addition to geometry, the tool can enrich outputs with additional attributes, such as speed limits, length, or identifiers, derived from the underlying network source features. Configure the properties using the Road Properties Definition parameter and specify which properties to apply to each output using the Road Properties on Snapped Points and Road Properties on Lines parameters.
This tool is similar to the Snap Tracks tool. However, that tool does not account for the characteristics of the road network beyond directionality and connectivity when snapping points, and it does not return lines. It does not require a network dataset or the Network Analyst extension license, making it a good choice for analyses in which the detailed rules of the road are not important and output lines are not needed.
Use the GPX To Features tool to convert a
.gpxfile to a feature class usable as input to this tool.The schema of the output snapped points feature class is as follows:
confidence—The confidence level of the computed solution—how likely it is that the computed snapped location is accurate. Its value is between 0 and 1, where 0 means it didn't snap to a road at all and 1 is very confident that the snapping is correct.point_type—The type of the output point. The possible values are as following:Snapped—The output point is snapped to a road. The confidence field indicates the confidence level of the snapping result.OffRoad—The output point is not snapped to any road. This occurs if the input point is too far from a road, the tool cannot find a suitable match, or the surrounding points are identified as off-road, in which case the tool maintains track consistency by also marking the current point as off-road.Noise—The output point is identified as noise. This occurs when the point belongs to a cluster; in such cases, middle points are flagged as noise and removed to improve snapping accuracy. Additionally, a point is treated as noise if it is a duplicate of the previous point or part of a sequence of zero-speed points, where only the initial point is retained.Outlier—The output point is identified as an outlier. This occurs when the input point is too far from the rest of the track; the tool classifies it as an outlier to maintain track consistency.
line_id—If output lines are returned, this field represents the Object ID of the line feature in the output line feature class that the point snapped to.track_id—The value of the field mapped to thetrack_idfield in the Input Points Field Mappings parameter.location_timestamp—The value of the field mapped to thelocation_timestampfield in the Input Points Field Mappings parameter.horizontal_accuracy—The value of the field mapped to thehorizontal_accuracyfield in the Input Points Field Mappings parameter.speed—The value of the field mapped to thespeedfield in the Input Points Field Mappings parameter.course—The value of the field mapped to thecoursefield in the Input Points Field Mappings parameter.ORIG_FID—The Object ID of the input point
The output will also include fields specified in the Road Properties on Snapped Points parameter.
The schema of the output lines feature class is as follows:
line_type—The type of the output line. The possible values are as following:Road—The output line represents a road segment.OffRoad—The output line represents a segment that is not a road or is not known to the routing data. The off-road segments uses straight line to connect the last point before the off-road segment and the first point after the off-road segment, and all the intermediate points are not snapped.Noise—The output point is identified as noise. This occurs when the point belongs to a cluster; in such cases, middle points are flagged as noise and removed to improve snapping accuracy. Additionally, a point is treated as noise if it is a duplicate of the previous point or part of a sequence of zero-speed points, where only the initial point is retained.Gap—The output line represents a gap between two part of the tracks. This can happen when the tracks are not continuous, typically when the GPS signal is lost. The gap is represented by a straight line between the last point before the gap and the first point after the gap.
from_position—The starting position of the line along the network edge source feature that was traversed. Values range from 0 to 1.to_position—The ending position of the line along the network edge source feature that was traversed. Values range from 0 to 1.track_id—The value of the field mapped to thetrack_idfield in the Input Points Field Mappings parameter.
The output will also include fields specified in the Road Properties on Lines parameter.
Parameters
| Label | Explanation | Data type |
|---|---|---|
|
Input Points |
The GPS track points to snap to the network. |
Feature Layer |
|
Network Data Source |
The network dataset on which the network analysis will be performed. The parameter can be specified using the following:
The network must have at least one travel mode. The tool does not support a portal URL as the network data source. |
Network Data Source |
|
Output Snapped Points |
The output GPS track points snapped to the road network. A shapefile is not a valid value. |
Feature Class |
|
Output Lines (Optional) |
Lines representing the inferred path traveled through the road network. This parameter is optional. When not specified, no lines will be created. A shapefile is not a valid value. |
Feature Class |
|
Input Points Field Mappings (Optional) |
Maps fields in the input points layer that can be used to improve and refine the snapping results. All field mappings are optional. Any that are specified will be used to improve results, and others will be ignored. Fields with matching names are automatically mapped by default. Value table columns:
|
Value Table |
|
Travel Mode (Optional) |
The travel mode that will be used by the snapping algorithm to improve and refine snapping results. The travel mode represents a collection of network settings, such as travel restrictions and U-turn policies, that determine how a pedestrian, car, truck, or other medium of transportation moves through the network. Travel modes are defined on your network data source. A travel mode name, The default is the network data source's default travel mode. |
Network Travel Mode |
|
Road Properties Definition (Optional) |
Definitions for properties that can be calculated from the road network and added as field on the outputs. Define the properties using this parameter and apply them to the outputs using the Road Properties on Snapped Points and Road Properties on Lines parameters. Value table columns:
|
Value Table |
|
Road Properties on Snapped Points (Optional) |
The road properties to include as fields on the output snapped points feature class. The available list of properties is defined by the Road Property Name column values in the Road Properties Definition parameter. |
String |
|
Road Properties on Lines (Optional) |
The road properties to include as fields on the output lines feature class. The available list of properties is defined by the Road Property Name column values in the Road Properties Definition parameter. |
String |
|
Overrides (Optional) |
Note:This parameter is for internal use only. |
String |
Environments
This tool does not use any geoprocessing environments.
Licensing information
- Basic: Requires Network Analyst
- Standard: Requires Network Analyst
- Advanced: Requires Network Analyst