Network analysis

Network analysis is a type of analysis performed on transportation networks, such as roads, railways, and bus networks. Examples of network analysis operations include finding the best route across a city, finding the closest emergency vehicle or facility, identifying a service area around a location, or servicing a set of orders with a fleet of vehicles.

You can perform network analysis in GeoAnalytics Engine using the Create Routes, Create Service Areas, Find Closest Facilities or Generate OD Matrix tools.

Network analysis with GeoAnalytics Engine requires the geoanalytics-natives jar. See the Install and set up documentation for more information on how to install this jar in your environment.

Network datasets

The network analysis tools require a network dataset to model transportation networks. Network datasets are created from source records, which can include lines, points, and turns, and they store the connectivity of the source records.

Connectivity is important, given that records are normally unaware of each other. For example, if two line records intersect, neither line is aware of the other. Similarly, a point at the end of a line doesn't have any inherent information that lets it know about the line. However, network datasets keep track of the source records that are coincident. They also have a connectivity policy to further define which coincident records are truly connected.

Network datasets in GeoAnalytics Engine

You will need to create a network dataset to be able to perform network analysis in GeoAnalytics Engine. Make sure to create a network dataset that covers the extent of the input data used when performing analysis. To learn how to create a network dataset, see Create a network dataset.

GeoAnalytics Engine network analysis tools support two network datasource formats:

Loading network data from a file geodatabase is not supported. Using a network service, such as the ArcGIS Online network analysis service, is not supported.

The network dataset must be locally accessible to all nodes in your Spark cluster. For more information, see Locator and network dataset setup.

Start time can be critical in certain types of network analysis. It takes much longer to drive across the city during rush hour than it does during the middle of the night because of increased traffic. Network analysis can be performed by setting start time if historical traffic data is configured in the network dataset. To learn how to create historical traffic data, see Historical traffic.

Describe network datasets in GeoAnalytics Engine

You will need to understand the network dataset to be able to perform network analysis. Some information are essential for the analysis, such as travel modes and cost attributes supported in the network dataset. You can use the describe_network_dataset(path) utility function to describe the network dataset and get the dataset information. By default, the function returns a dictionary with following properties of the network dataset:

  • name—The name of the network dataset in the mobile map package or mobile geodatabase.
  • path—The path of the network dataset.
  • spatialReference—The well-known ID (WKID) of the spatial reference.
  • defaultTravelMode—The name of the network dataset's default travel mode. An empty string will be returned if the network dataset does not have a default travel mode.
  • travelModeNames—The names of the travel modes available in the network dataset.
  • costAttributeNames—The names of the cost attributes available in the network dataset.

The following code sample shows an example of describing a network dataset:

Python
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Describe the network dataset example.mmpk
import geoanalytics
import json

ND = geoanalytics.util.describe_network_dataset(r"/data/example.mmpk")
print(json.dumps(ND, sort_keys=True, indent=4))
Result
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
    "costAttributeNames": [
        "Kilometers",
        "Miles",
        "Minutes",
        "TimeAt1KPH",
        "TravelTime",
        "TruckMinutes",
        "TruckTravelTime",
        "WalkTime"
    ],
    "defaultTravelMode": "Driving Time",
    "name": "Routing_ND",
    "path": "C:\\data\\example.mmpk",
    "spatialReference": {
        "wkid": 4326
    },
    "travelModeNames": [
        "Driving Time",
        "Driving Distance",
        "Trucking Time",
        "Trucking Distance",
        "Walking Time",
        "Walking Distance",
        "Rural Driving Time",
        "Rural Driving Distance"
    ]
}

You can get more network dataset properties using describe_network_dataset(path, extended = True). In addition to the properties listed above, the following network dataset properties are returned when using extended = True:

  • travelModes—The properties of each travel mode, such as name, type, descriptions, and impedance attribute.
  • restrictions—The available restriction attributes of the network dataset.
  • restrictUsageParamNames—The usage types that determine whether the restriction attribute prohibits, avoids, or prefers the network elements associated with it.
  • maxLocatingDistanceMeters—The furthest distance in meters that network analysis searches when locating or relocating a point onto the network.

In the extended version of the network data properties, the following properties are available for each travel mode:

  • name—The name of the travel mode.
  • type—The type of the travel mode.
  • description—The description of the travel mode.
  • impedanceAttributeName—The name of the impedance attribute of the travel mode.
  • distanceAttributeName—The name of the distance attribute of the travel mode.
  • timeAttributeName—The name of the time attribute of the travel mode.
  • restrictionAttributeNames—The list of network attribute names to be used as restrictions in the travel mode.
  • useHierarchy—Whether hierarchy of elements in the transportation network should be considered in the travel mode.
  • uturnAtJunctions—The U-turn policy that specifies how U-turns are handled in the travel mode.
  • simplificationTolerance—Specifies how much the travel mode generalizes the geometry of analysis results.
  • simplificationToleranceUnits—The unit of the simplification tolerance.
  • attributeParameterValues— The attribute values of cost and restriction attributes.

The following code sample shows an example of describing a network dataset with the extended option and returning the properties of one travel mode:

Python
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Describe the network dataset example.mmpk with the extended option
ND = geoanalytics.util.describe_network_dataset(r"/data/example.mmpk", extended = True)

# Get the properties for the travel mode 'driving time'
print(json.dumps(ND.get(travelModes)[0], sort_keys=True, indent=4))
Result
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
{
    "attributeParameterValues": [
        {
            "attributeName": "TravelTime",
            "parameterName": "Vehicle Maximum Speed (km/h)",
            "value": 0
        },
        {
            "attributeName": "TruckTravelTime",
            "parameterName": "Vehicle Maximum Speed (km/h)",
            "value": 0
        },
        {
            "attributeName": "WalkTime",
            "parameterName": "Walking Speed (km/h)",
            "value": 5
        },
        {
            "attributeName": "Any Hazmat Prohibited",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Avoid Carpool Roads",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Avoid Express Lanes",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Avoid Ferries",
            "parameterName": "Restriction Usage",
            "value": 2
        },
        {
            "attributeName": "Avoid Gates",
            "parameterName": "Restriction Usage",
            "value": 2
        },
        {
            "attributeName": "Avoid Limited Access Roads",
            "parameterName": "Restriction Usage",
            "value": 2
        },
        {
            "attributeName": "Avoid Private Roads",
            "parameterName": "Restriction Usage",
            "value": 2
        },
        {
            "attributeName": "Avoid Roads Unsuitable for Pedestrians",
            "parameterName": "Restriction Usage",
            "value": 5
        },
        {
            "attributeName": "Avoid Stairways",
            "parameterName": "Restriction Usage",
            "value": 5
        },
        {
            "attributeName": "Avoid Toll Roads",
            "parameterName": "Restriction Usage",
            "value": 2
        },
        {
            "attributeName": "Avoid Toll Roads for Trucks",
            "parameterName": "Restriction Usage",
            "value": 2
        },
        {
            "attributeName": "Avoid Truck Restricted Roads",
            "parameterName": "Restriction Usage",
            "value": 5
        },
        {
            "attributeName": "Avoid Unpaved Roads",
            "parameterName": "Restriction Usage",
            "value": 5
        },
        {
            "attributeName": "Axle Count Restriction",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Axle Count Restriction",
            "parameterName": "Number of Axles",
            "value": 0
        },
        {
            "attributeName": "Driving a Bus",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Driving a Taxi",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Driving a Truck",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Driving an Automobile",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Driving an Emergency Vehicle",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Height Restriction",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Height Restriction",
            "parameterName": "Vehicle Height (meters)",
            "value": 0
        },
        {
            "attributeName": "Kingpin to Rear Axle Length Restriction",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Kingpin to Rear Axle Length Restriction",
            "parameterName": "Vehicle Kingpin to Rear Axle Length (meters)",
            "value": 0
        },
        {
            "attributeName": "Length Restriction",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Length Restriction",
            "parameterName": "Vehicle Length (meters)",
            "value": 0
        },
        {
            "attributeName": "Preferred for Pedestrians",
            "parameterName": "Restriction Usage",
            "value": 0.8
        },
        {
            "attributeName": "Riding a Motorcycle",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Roads Under Construction Prohibited",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Semi or Tractor with One or More Trailers Prohibited",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Single Axle Vehicles Prohibited",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Tandem Axle Vehicles Prohibited",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Through Traffic Prohibited",
            "parameterName": "Restriction Usage",
            "value": 5
        },
        {
            "attributeName": "Truck with Trailers Restriction",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Truck with Trailers Restriction",
            "parameterName": "Number of Trailers on Truck",
            "value": 0
        },
        {
            "attributeName": "Use Preferred Hazmat Routes",
            "parameterName": "Restriction Usage",
            "value": 0.5
        },
        {
            "attributeName": "Use Preferred Truck Routes",
            "parameterName": "Restriction Usage",
            "value": 0.5
        },
        {
            "attributeName": "Walking",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Weight per Axle Restriction",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Weight per Axle Restriction",
            "parameterName": "Vehicle Weight per Axle (kilograms)",
            "value": 0
        },
        {
            "attributeName": "Weight Restriction",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Weight Restriction",
            "parameterName": "Vehicle Weight (kilograms)",
            "value": 0
        },
        {
            "attributeName": "Width Restriction",
            "parameterName": "Restriction Usage",
            "value": -1
        },
        {
            "attributeName": "Width Restriction",
            "parameterName": "Vehicle Width (meters)",
            "value": 0
        }
    ],
    "description": "Models the movement of cars and other similar small automobiles, such as pickup trucks, and finds solutions that optimize travel time. Travel obeys one-way roads, avoids illegal turns, and follows other rules that are specific to cars. When you specify a start time, dynamic travel speeds based on traffic are used where it is available.",
    "distanceAttributeName": "Kilometers",
    "impedanceAttributeName": "TravelTime",
    "name": "Driving Time",
    "restrictionAttributeNames": [
        "Avoid Carpool Roads",
        "Avoid Express Lanes",
        "Avoid Gates",
        "Avoid Private Roads",
        "Avoid Unpaved Roads",
        "Driving an Automobile",
        "Roads Under Construction Prohibited",
        "Through Traffic Prohibited"
    ],
    "simplificationTolerance": 10.0,
    "simplificationToleranceUnits": "esriMeters",
    "timeAttributeName": "TravelTime",
    "type": "AUTOMOBILE",
    "useHierarchy": true,
    "uturnAtJunctions": "esriNFSBAtDeadEndsAndIntersections"
}

For more details, go to the GeoAnalytics Engine API reference for describe network dataset.

Network analysis concepts

Travel modes

Travel modes on a network dataset define how a pedestrian, car, truck, or other mode of transportation moves through the network. A travel mode can be general—for example, to model typical trucks—or more specific, such as to model ladder trucks or rescue trucks.

A travel mode is essentially a template consisting of a long list of travel settings that define the physical characteristics of a vehicle or pedestrian. Those characteristics are considered when performing a network analysis to define how the vehicle or pedestrian travels and where it can go. Selecting a predefined travel mode allows you to efficiently and consistently set a number of properties that are appropriate for the mode of travel you intend to model. The benefits are time savings and reduced complexity—you don't need to remember and configure, with each analysis, the parameter values that most accurately characterize the vehicles you're modeling.

Travel modes are defined on the network datasource or using JSON format for a custom travel mode. By default, the network analysis tools use the default travel mode predefined in the network datasource for the analysis.

All network analysis tools have the setTravelMode() setter. This setter accepts any of the travel modes defined on the network dataset, or a JSON string that defines a custom travel mode.

Cost attributes

Certain attributes are used to measure and model impedances, such as travel time (transit time on a street) or demand (the volume of garbage picked up on a street). These attributes are apportionable along an edge; that is, they are divided proportionately along the length of an edge. For example, if travel time is modeled as a cost attribute, traversing half an edge will take half the time of traversing the whole edge: if the travel time to traverse the edge is 3 minutes, it takes 1.5 minutes to traverse half the edge. If you are looking for a 1.5-minute route along this edge, the route feature is created from the first half of the edge feature.

Network analysis often involves the minimization of a cost (also known as impedance) during the calculation of a path. Common examples include finding the fastest route (minimizing travel time) or the shortest route (minimizing distance). Travel time and distance are also cost attributes of the network dataset.

The Create Service Areas, Find Closest Facilities, and Generate OD Matrix tools support accumulating cost attributes along the network using the .accumulateAttributes() method.

How the Create Routes tool works

The Create Routes tool uses a network dataset to understand the connectivity of a transportation network to find the best route between a series of input points. A route is calculated for each record in the input DataFrame. The output DataFrame contains a linestring column with the routes that visit the input points.

Use cases

  • A distribution center for grocery stores assigns routes to each of the food delivery trucks to minimize transportation costs.
  • A health department creates an optimized route daily for each of the health inspectors to maximize the number of inspections performed each day.

For more information about how to use Create Routes, see the tool documentation.

How the Create Service Areas tool works

The Create Service Areas tool uses a network dataset to generate reachable service areas around facility locations. These service areas are accessible within a given cutoff cost from the facility location. For example, the 10-minute walk-time service area around a subway station indicates a region where residents can walk to the station within ten minutes. The tool accepts point geometries as the input DataFrame, representing the facilities around which the service areas will be created. The output DataFrame can contain polygons that represent reachable areas within the impedance cutoffs or lines that represent the reachable roads before the cutoffs are exceeded.

Use cases

  • A retail company is planning to expand its chain of stores to better serve its customers. The company wants to identify potential locations for new stores that would maximize their customer base and minimize the competition with existing stores. They also want to understand the coverage area and accessibility of each potential store location to ensure they are strategically positioned. The tool calculates the service areas around each potential store location based on the road network and travel time or distance constraints.
  • A network company wants to generate 2 and 4-hour service areas to check if their customers that have signed up for a service agreement can actually be reached within the given time constraint. Their contract promises a 2 or 4-hour turn-around time in case a network switch/router goes down.

For more information about how to use Create Service Areas, see the tool documentation.

How the Find Closest Facilities tool works

The Find Closest Facilities tool uses a network dataset to find a specified number of closest facilities to an incident based on a specified travel mode. The tool requires two point DataFrames as inputs representing the incidents and the facilities. The tool returns the travel costs and best routes between the incidents and the chosen facilities.

Use cases

  • A national healthcare department wants to find the three closest urgent care facilities for every one of their customers so they can disseminate this information with them in their next newsletter.

For more information about how to use Find Closest Facilities, see the tool documentation.

How the Generate OD Matrix tool works

The Generate OD Matrix tool uses a network dataset to create an origin-destination cost matrix from multiple origins to multiple destinations. It returns a table that contains the travel cost, including travel time and travel distance from each origin to each destination within the specified impedance cutoff. The tool requires two point-geometry DataFrames as an input, representing the origins and destinations.

Use cases

  • A city's transportation department wants to analyze the commuting patterns of its residents to understand the flow of people between residential areas and major employment centers. The goal is to identify traffic bottlenecks, optimize public transportation routes, and plan infrastructure improvements to reduce congestion and travel times. The tool calculates the travel time or distance matrix between each origin-destination pair, considering the road network and any transportation restrictions.
  • GIS analysts in local government offices need to be able to calculate how many and which grocery stores are within a 15-minute drive from each census tract. Depending on the result, they will be able to determine if people living below poverty have access to grocery stores. Transportation engineers will take this information into account when evaluating and improving the transportation infrastructure.

For more information about how to use this tool, see the Generate OD Matrix tool documentation.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.