You are on page 1of 57

ArcGIS Network Analyst data prep tutorial

Many people come across free street data they wish to use with the ArcGIS Network
Analyst extension. However, a lot of this data is missin essential fields, or it is not clean
enouh, meanin NA !Network Analyst" will not #e a#le to find ood routes, service
areas etc. In fact, most free data will ive only poor to fair results with NA. Hiher
$uality datasets are usually clean, #ut they may not have the desired fields such as drive
time or one%way streets. Most purchased data, such as &eleAtlas' or NA(&)*' street
data, is clean and has the desired fields for use with NA, so these datasets need not
undero the procedures descri#ed in this document.
+sin the data that comes with this download, this document will step throuh an
example workflow for cleanin up some ,dirty- data, and addin missin fields such as
drive time, one%way streets and many others. &here are seven tutorials altoether.
Most of the exercises use a file eodata#ase, #ut shapefiles and other eodata#ase formats
are not so different in most cases. .rief comments will #e noted wherever a shapefile user
would have to do somethin different.
An Arc(iew license is sufficient for all of these tutorials. &his means that occasionally, a
less%efficient workflow that makes use of only Arc(iew functionality would #e
demonstrated, as opposed to the more%efficient workflow that can only #e performed with
a hiher license. In such cases, these more efficient workflow!s" that make use of hiher
licenses will #e noted.
&hese tutorials are independent of each other, so you only have to do those you are
interested in. Havin said that, &utorials / and 0 o toether very well. Also, the
instructions are less detailed as the tutorial proresses. 1or example, a common step in
many of these tutorials is to la#el 2#3ectI4s in the map. In &utorial 0, you are walked
throuh the procedure, #ut in later tutorials, there is only a simple instruction to la#el the
2#3ectI4s. If you are a #it weak in either ArcGIS or NA, it is recommended that you do
all of the tutorials in order.
+.S. data conventions and measurement units will #e primarily used.
Assumptions:
1amiliarity with the #asics of ArcGIS and NA.
If you are not familiar with NA, do the Arc&utor NA &utorial that comes
with the software. In ArcMap or Arc5atalo, o to Help 6 ArcGIS 4esktop
Help, then type ,Network Analyst tutorial exercises- into the Index ta#.
ArcGIS 7.0 or hiher.
Some of the tutorials will not work with earlier releases of the software.
&he NA extension is turned on !in #oth ArcMap and Arc5atalo".
&he NA tool#ar and the NA 8indow are already displayed in ArcMap.
&hose settin up a data#ase from scratch should see the white paper 9:reparin Street
4ata for +se with the Network 4ataset;, which has lots of helpful schema considerations.
It is located at http<==support.esri.com=index.cfm>
fa?knowlede#ase.whitepapers.view:aper@:I4?AB@MetaI4?/CDA
Appendix / of this tutorial contains a list of recommended field names.
&his tutorial will take approximately two hours for an experienced GIS analyst. A newer
user should set a full day aside.
0
Contents
&utorial /. 5leanin up ,#ad- diitiEin...............................................................................F
&utorial 0. :lanariEation and elevation fields....................................................................//
&utorial G. Addin a drive%time field................................................................................./7
Su#%tutorial. Addin a lenth field to a shapefile that uses eoraphic coordinates...0B
&utorial F. Makin NA respect one%way streets................................................................GC
&utorial H. +sin lo#al turns............................................................................................GD
&utorial D. 4iitiEin turn features....................................................................................FC
&utorial B. A parameter%#ased restriction...........................................................................HC
Appendix /. Good field names to use...............................................................................HD
G
Tutorial 1. Cleaning up bad digiti!ing.
&his tutorial demonstrates how to clean up data with eometry pro#lems. Most free data
has lots of this. 8hat is meant #y ,#ad- is that even thouh the data may #e perfectly fine
for drawin maps and for many other purposes, NA will ive poor results when usin it.
Skip this tutorial if you are certain your dataset is topoloically sound. If you are not
completely sure, read on to see why it is important to understand #ad eometry, and learn
how to fix them.
/. Start ArcMap with an empty map document.
0. Add a pre%#uilt network dataset to the map.
5lick the Add 4ata #utton and naviate to the
9&utorial.d#; eodata#ase !it should #e in the
same folder that this .doc file is in".
4ou#le%click the 9&utorial.d#; eodata#ase.
4ou#le%click the 9#adGeometry; feature dataset.
4ou#le%click the 9#adGeometryIN4; network dataset.
Note that this network dataset was created using the default settings.
5lick No when prompted to add all the feature classes.
G. 2n the Network Analyst tool#ar, click Network Analyst, and click New Joute.
These tutorials make use of New Route. However, other solvers, such as Service
Area would also be affected by bad geometry.
F. +se the 5reate Network Kocation &ool to add two stops as shown #elow<
Make sure #oth stops snap to the network !they
must not have a $uestion mark inside of the Stop
icon" and make sure the left stop is added first.
H. 5lick Solve.
Lou will et the unexpected result shown #elow.
8hy did it take such a lon route>
F
D. Moom way in on the route-s first left turn !to the riht of stop /, where it turns north".
Notice that there is a ap in the streets, as shown #elow.
&his ap is less than C.CC/ foot, #ut to NA this means the streets
are not connected.
Note that you may have to zoom in multile times on this intersection to see the ga.
&his tutorial will later descri#e how to fix the a#ove pro#lem. 1or now let-s look at
another common eometry pro#lem.
B. 5lick 1ull )xtent to Eoom #ack out.
A. +se the Select=Move Network Kocations &ool to move stop 0 to the new
location shown #elow<
7. 5lick Solve.
Stop 0 will turn red and an error messae will pop up, as shown in the diaram #elow<
Note that there are no aps in this case. So why are we una#le to et from stop / to stop
0>
/C. 5lose the pop%up window.
8hen trackin down many eometry pro#lems, addin the actual feature classes instead
of 3ust addin the network dataset will help clarify the pro#lem.
//. 5lick the Add 4ata #utton and add the 9streets; and the
9#adGeometryIN4INunctions; feature classes.
Note that the network dataset was built from these feature classes.
H
The small circles in the ma are the !unction features.
8ith the 3unction feature class added, we can now
easily see what is causin this pro#lem< there is no
3unction #etween the street that stop 0 is on, and
its cross street. A 3unction must #e present to turn
from one street to the other. &his means these
streets are not connected, even thouh there is no
ap as in the previous pro#lem.
&he two pro#lems shown in this tutorial !the ap #etween the streets and the missin
3unction" are amon the most common errors caused #y poor diitiEin. &he free data we
commonly come across is usually full of these diitiEin errors, alon with many other
kinds of errors that are not discussed here. &hese kinds of pro#lems can #e avoided #y
usin the proper tools in ArcMap when diitiEin the streets.
/0. In Arc&ool#ox, open and run the Interate tool.
)xpand the 4ata Manaement &ools tool#ox.
)xpand the 1eature 5lass toolset.
4ou#le%click the Interate tool.
5lick on the dropdown arrow to the riht of Input 1eatures and choose 9streets;.
4o not select the 9#adGeometry N4INunctions; feature class since it is manaed
#y ArcGIS.
Note that if your network dataset is to be built from more than one feature
class, you would normally choose all of them.
Keave the OL &olerance parameter #lank.
A blank arameter means that "SR# will calculate a default value to use.
5lick 2P.
Important:
&he OL &olerance is a critical parameter on the Interate tool. Normally, the OL
&olerance should #e set #ased on careful examination of the data. +se the Measure
tool to see how lare this num#er needs to #e to close the aps in your street data.
Always perform Interate aainst a copy of the data since a too lare OL &olerance
value will ruin the data %% the street eometry will #e modified in very strane ways
with an inappropriate OL &olerance settin. If a lare OL &olerance settin is needed,
such as anythin reater than a few feet, you should use the Interate tool only to fix
the smaller pro#lems, and then fix the larer pro#lems #y hand usin standard
ArcMap editin tools. If the OL &olerance settin is too small, the data will not #e
modified too reatly, #ut very few pro#lems will #e fixed. 8hen the OL &olerance is
3ust riht, most of the diitiEin pro#lems will #e fixed without harmin your data. It
usually takes trial%and%error testin to find the ideal OL &olerance.
/G. Jun the .uild )ntire Network 4ataset command.
D
Jemem#er that the network dataset must #e re#uilt anytime an edit is made to the
network data !Interate is considered an edit". If the network dataset is not re#uilt, then
the next time you perform a Solve, the results will #e consistent with the unedited data.
/F. Move stop 0 #ack to the position shown
to the left, and click Solve.
&he results are now as expected, as runnin
the Interate tool closed the tiny ap.
Moomin way in on the intersection you
Eoomed to in Step D, notice that all four
streets are now connected to one another at
the intersection to the riht of stop /.
&he take%home lesson is even microscopic aps must #e fixed #efore NA will work well.
&here are many other ways to fix these aps, #ut they tend to #e much more time%
consumin than usin the Interate tool. Always run Interate aainst any free data,
unless you know that it is clean.
/H. Move stop 0 #ack to the position shown in Step A, and click Solve.
Notice that the Solve will still fail as it did #efore. &his is #ecause we need to chane the
way the network dataset is set up, which is done in Arc5atalo. .efore doin this,
thouh, let-s look at what the Interate tool did to this pro#lem area.
/D. 5lick the 5lose #utton on the pop%up window.
/B. 4raw the line-s vertices in the map.
Start an edit session.
4ou#le%click the line that
stop 0 is on.
Note that in the diagram to the
right, the !unction symbols are
enlarged so that they would not
be confused for vertices $ it is
not necessary to enlarge these
features.
Note the s$uare reen colored vertex in the middle of the line. &his vertex was not in the
data #efore %% the Interate tool added it. If you examine the cross street, you will see it
also has a new vertex in the exact same location. 8henever there are two coincident
vertices #elonin to different features !as there are now #ecause of usin the Interate
tool" NA can consider these two streets to #e connected.
/A. )xit ArcMap.
B
5lick 1ile, then click )xit. .e sure to save the .mxd file. Save the file as
9&utorial/.mxd;.
Lou will not #e a#le to complete the followin steps if ArcMap is runnin.
/7. Start Arc5atalo and naviate to the network dataset 9#adGeometryIN4;.
See the selected item in the screenshot from Ste %.
0C. Jiht%click on the network dataset and click :roperties.
0/. 5lick on the 5onnectivity ta#, chane the 5onnectivity :olicy of 9streets; from )nd
:oint to Any (ertex, and click 2P.
&he )nd :oint option !which was the oriinal settin network dataset was #uilt with"
means lines could only connect at endpoints. &he Any (ertex option allows the two line
features we examined in Step /D to connect mid%span at the coincident vertices.
Note that the #ntegrate tool must be run to add the two new vertices. &therwise, the
Any 'erte( otion will not connect those two features unless there were coincident
vertices resent.
00. Jiht%click the network dataset and click .uild.
&he new network dataset is identical to the oriinal one, except it is usin the Any (ertex
option instead of )nd :oint.
0G. Start ArcMap and open the .mxd file saved in Step /A<
Note the new network 3unction. &his
3unction was not present in the oriinal
network dataset we worked with !see the
diaram in Step //, for comparison". &he
Interate tool added the coincident
vertices needed so that the Any (ertex
option would consider the two streets to
#e connected.
A
Note that this has not split the street features.
0F. +se the Select 1eatures tool to verify that
there are still only two street features !see the
diaram to the riht".
However, there are now four network edes.
0H. +se the Network Identify tool to verify
that there are four network edes at that
intersection !see the diaram to the riht".
0D. 5lick Solve.
Notice that the results are now as expected.
&he take home lesson is that NA does not connect streets 3ust #ecause they look like they
should #e connected. &here must #e proper topoloical connectivity.
0B. )xit #oth Arc5atalo and ArcMap !it is not necessary to save the chanes to the map
document", since &utorial / is finished.
7
Summary:
&he Interate = Any (ertex approach works well for lines that pass over one another, #ut
should #e connected !also known as unresolved intersections". .efore runnin Interate,
these lines were non%planariEed !so called #ecause they can #e thouht of as existin at
two different elevations, or planes". +sin #oth the Interate tool and the Any (ertex
option had the effect of planariEin these two lines, meanin they are now considered to
meet at the same elevation, thus allowin cars to turn from one street to the other. &his is
a ood approach if the data was ,spahetti%diitiEed-. If, however, the data has properly
resolved intersections, then &utorial 0 will #e of more interest.
/C
Tutorial ". #lanari!ation and ele$ation %ields.
&his is the method used #y most commercial data providers to prepare data for use with
NA. 8ith this method, lines are physically split wherever they intersect, and the network
dataset is #uilt with the )nd :oint option. Lou may wish to review &utorial / to
familiariEe yourself with the other main approach, and with terms such as planariEation,
the )nd :oint option, etc.
/. Start ArcMap with an empty map document.
0. Add a pre%#uilt network dataset to the map.
5lick the Add 4ata #utton and naviate to the
9&utorial.d#; eodata#ase !it should #e in the same
folder that this .doc file is in".
4ou#le%click the 9&utorial.d#; eodata#ase.
4ou#le%click the 9planariEation; feature dataset.
4ou#le%click the 9planariEationIN4; network dataset.
Note that this network dataset was created using the default settings.
5lick Les when prompted to add all the feature classes.
Note the data has two intersections< the one to the riht has no network 3unction, which
means these lines are not connected. 8e will use the Split tool to planariEe this
intersection.
Althouh not re$uired, it is very helpful to have vertices located at all unresolved
intersections.
G. In Arc&ool#ox, open and run the Interate tool.
)xpand the 4ata Manaement &ools tool#ox.
)xpand the 1eature 5lass toolset.
4ou#le%click the Interate tool.
5lick on the dropdown arrow to the riht of Input 1eatures and choose 9street;.
Keave the OL &olerance parameter #lank.
5lick 2P.
Althouh the data looks the same after runnin Interate, vertices have #een added to
#oth streets at the intersection.
F. Start editin.
H. Set up the snappin environment.
5lick )ditor, and click Snappin.
5heck the #ox to turn on (ertex
snappin for the 9street; layer.
Keave all other #oxes un%checked.
//
5lose the Snappin )nvironment window.
D. Sinle%click this line to select it.
Note< &his is the location we will make two separate
splits at, referred to in Step B.
Note< &his is the ,horiEontal cross street- referred to
in Step A.
B. 5lick on the Split tool and then click exactly where the selected line is crossed
#y the other street !identified in the fiure a#ove".
&he selected line will #e split into two lines exactly at the intersection #ecause Interate
added vertices there that are #ein snappin to. &his would #e much trickier without
usin Interate.
A. Select the horiEontal cross street !see fiure, a#ove", and then repeat Step B with it.
7. Stop editin and save your edits.
/C. Jun the .uild )ntire Network 4ataset command.
Notice that a new network 3unction was added at this
intersection.
Notice also that there are now four separate lines
instead of the two that we started with. &his means
the streets have #een planariEed with the Split tool.
5ars can now turn #etween these streets, unlike in the
oriinal data.
&o make this workflow reasona#ly efficient, the Interate tool was used to create vertices
to snap to. &he network 3unctions were also displayed to see which intersections re$uired
work. &here are other ways of achievin the same result, and some are much more
efficient !such as usin eodata#ase topoloy, or usin the 8orkstation 5K)AN
command aainst an ArcInfo coverae". If you have an Arc)ditor or ArcInfo license, you
should investiate these other methods.
Jeardless of how the streets are planariEed, the real%world overpass=underpass situations
still must #e considered. A lot of free data already has #een fully planariEed, even at
overpass=underpasses. &his means the model would allow cars to turn directly #etween a
freeway and a city street without usin any on=off ramps, when in reality, cars would only
/0
travel alon on=off ramps to make the maneuver. &hese intersections need to #e ,un%
planariEed-. )levation fields will #e used to accomplish this.
/G
//. 5reate a new field named 9fIelev; on the 9street; layer.
In Arc&ool#ox, expand the 4ata Manaement &ools tool#ox.
)xpand the 1ields toolset.
4ou#le%click the Add 1ield tool.
5lick on the dropdown arrow to the riht of Input &a#le and select the 9street;
layer.
&ype %&ele$ for the 1ield Name.
4o not chane any other properties.
5lick 2P.
/0. Jepeat Step //, this time addin a field called 9tIelev;.
&hese two fields can #e named anythin, #ut 9fIelev; and 9tIelev; !for ,from elevation-
and ,to elevation-" are widely used #y the GIS community, and )SJI software ,knows-
what they are.
/G. 5hane the 9street; layer sym#ol to show which direction each line is diitiEed in.
Sinle%click the line sym#ol
shown in the ArcMap &a#le
of 5ontents under the 9street;
layer.
In the Sym#ol Selector
window, choose 9Arrow at
)nd;.
5lick 2P.
/F. Ka#el the streets with the 2#3ectI4s so that we can tell one street from another.
&b!ect#)s in a geodatabase feature class are always uni*ue between different
features.
4ou#le%click the 9street; layer in the
ArcMap &a#le of 5ontents.
5lick the Ka#els ta#.
5heck ,Ka#el features in this layer-.
Set the Ka#el 1ield to 92.N)5&I4;.
5lick 2P.
Note to shaefile users+ the &b!ect#) field will be called ,-#)..
)ach line should now have an arrowhead
indicatin the diitiEed direction, and the
2#3ectI4s should #e la#eled.
8e need to prohi#it turns #etween streets A or
/D to streets /C or /B, since this is a real%world
/F
overpass=underpass. 8e also need to maintain connectivity #etween streets /D and A !the
overpass", and #etween streets /B and /C !the underpass". 5urrently, cars can turn all
ways here since there is a network 3unction that connects all four streets.
/H. Start editin.
/D. Select street /D and click the Attri#utes
#utton located on the )ditor tool#ar to see
that the two new fields created earlier #oth
contain QNull6 values !they would #e Eero
for shapefile users".
&he intersection needed to #e fixed is where streets A, /C, /D and /B come toether. &his
is at the to%end of street /D since it is next to the arrowhead for street /D. Jemem#er, ,to-
in this case means relative to the diitiEed direction, and the ,Arrow at )nd- sym#ol
indicates diitiEed direction. So the elevation to #e edited is at the to%end of street /D.
/B. Since we need to chane the to%end of the
line, type the num#er 1 into the t&ele$ field, and
then press the )nter key on the key#oard.
The actual number does not matter /it
could be any number0, but 1 is widely used
by the 2#S community for an overass.
Street /D is now complete. &here is no need to do anythin to the from%end of this street
since there is no over=underpass at that intersection, so we will leave the fIelev field for
street /D QNull6.
Street A also needs an elevation of / !so
that it will remain connected to street /D",
#ut should it #e set as the from% or to%
elevation> Kook at the arrowhead on street
A in the diaram to the riht, and notice it
is at the opposite end from the intersection
we are workin on. &hat means the %&ele$
field must #e set to /.
/A. Select street A, and type in the value 1 for the %&ele$ field. 4o not type anythin into
street A-s tIelev field since that end of street A is 3ust a reular intersection where cars are
permitted to turn all ways.
&he elevation value for streets /C and /B need to #e set, since they are currently QNull6
for #oth elevation fields.
/7. Select street /C and set the %&ele$ field to '.
/H
0C. Select street /B and set its %&ele$ field to '.
Aain, the actual value does not matter, #ut #oth lines must use the same value !since
they are at the same level" and C is commonly used for an underpass. A further rule is that
the underpass num#er must #e different from our overpass num#er. Notice #oth fIelev
fields were set to C, and #oth tIelev fields were left Qnull6. &his is simply #ecause #oth
of these lines were diitiEed away from our intersection.
&his intersection is now complete, since all four street ends that meet at this intersection
have #een assined an elevation. 8e do not have to do anythin with the elevation fields
at ,normal- intersections, so most values will remain QNull6. &his only has to #e done
where there are non%planariEed intersections.
&he tricky part here is to know which of the two elevation fields you have to type into,
and whether to type a C or a /. Lou will know you made a mistake if cars are still a#le to
make turns they are not supposed to after re%#uildin the network.
Note to eodata#ase users !does not apply to shapefiles"< If you have a point feature class
that participates in the network dataset, and if you happen to have points located exactly
at overpass=underpasses !such as a traffic sinal" then you must add a field to your point
feature class !call it ele$, data type Short Inteer" and set this field to #e C or /.
0/. Stop editin and save the edits.
00. )xit ArcMap.
5lick 1ile, and click )xit. Save the .mxd file.
Lou will not #e a#le to complete the followin steps if ArcMap is runnin.
0G. Start Arc5atalo and naviate to the network dataset 9planariEationIN4;.
See the selected item in the screenshot from Ste %.
/D
0F. Select the network dataset and delete it.
Notice the ,lanarization3N)34unctions. feature class is also deleted by Arc2#S
since it is art of the network dataset.
0H. +se the New Network 4ataset wiEard to re%create the network dataset.
Jiht%click the 9planariEation; feature dataset, click New, and click Network
4ataset.
5lick the Next #utton three times to et to the elevation field pane.
Nothin needs to #e done here since we used field names that ArcGIS
reconiEed. If you had used different field names, you would pro#a#ly have to
fill in this window yourself.
5lick the Next #utton three times, past the attri#utes panel.
5lick Les to add the cost attri#ute.
5lick Next past the directions panel.
5lick 1inish to create the network dataset.
5lick Les to #uild the network.
0D. Start ArcMap and open the .mxd file saved in Step 00.
If desired, turn off the la#els and the arrows to make the display less cluttered.
0B. 5reate a new Joute analysis layer.
2n the Network Analyst tool#ar, click Network Analyst, then click New Joute.
/B
0A. Add two stops as indicated in the diaram #elow.
5e sure to add the two stos in the correct order.
07. 5lick Solve.
NA is a#le to find a route
#etween the stops #ecause the
riht%hand most intersection
was planariEed #y splittin
the line features. A route
would not have #een found
with the oriinal data.
GC. Move stop 0 to the location shown #elow, and click Solve.
NA can not find a route since the only way to et from stop / to stop 0 would #e to 3ump
off the overpass, which is now present due to the elevation fields. A route would have
#een found with the oriinal data without the elevation fields.
G/. 5lick the 5lose #utton in the pop%up window.
At first lance, it appears that there is only one 3unction at the left%hand intersection in the
diaram.
G0. +se the Network Identify tool on that 3unction.
&he Network Identify window will report that there are actually two coincident 3unctions
at this point. )ach connects to only two streets. In the oriinal data, there was only one
3unction at this intersection, and it connected all four streets.
GG. )xit ArcMap and Arc5atalo since &utorial 0 is finished.
/A
Summary:
&he Split tool !or much more efficient procedures with a hiher license, such as usin
eodata#ase topoloy, or usin the 8orkstation 5K)AN command aainst an ArcInfo
coverae" can #e used to planariEe unresolved intersections. +sin the )nd :oint
connectivity option in con3unction with elevation fields is the recommended workflow
when you have fully planariEed street data. &he )nd :oint option is the default, so it does
not have to #e specified it in Step 0H.
/7
Tutorial (. Adding a dri$e)time %ield.
Most free data does not come with a drive%time field. &hat means NA can only find the
shortest route #y distance !i.e. #ased on the diitiEed lenth of your streets" since ArcGIS
automatically adds and uses a lenth%#ased cost attri#ute if no other attri#ute is specified
!as seen in the previous two tutorials". &his meets the needs of many people, #ut it
inores the fact that some roads, such as freeways, are faster than others. If it is more
important how lon it takes to drive somewhere, as opposed to how far it is, a drive%time
field is more appropriate. &wo components are needed to calculate drive time< lenth and
speed. 8ith #oth, it is possi#le to calculate how lon it takes to drive each line in the
network.
6ength+
All eodata#ase line feature classes have a field called 9ShapeIKenth;, or somethin
similar, and the values in it are always correct.
If the data is a shapefile, you will have to calculate the lenth of each street. &he su#%
tutorial at the end of &utorial G will step throuh this procedure.
If the coordinate system uses eoraphic coordinates !decimal derees" then you need to
do some extra data processin. &his is e$ually true for shapefile and eodata#ase users.
NA will happily use eoraphic coordinate ,lenths-, #ut you should not. A decimal
deree is not a valid unit of lenth, as it can vary #ased on latitude. A deree of lonitude
at the e$uator is a#out D0 miles, #ut is nearly C miles at the North :ole. +se Arc&ool#ox-s
:ro3ect command to convert the data into +&M, State :lane, or some other pro3ected
coordinate system. &he other option is to keep the data in eoraphic coordinates and use
5alculate Geometry to calculate the lenths #ased on a pro3ected coordinate system. &his
procedure is demonstrated at the very end of the current tutorial, in a separate su#%
tutorial.
Seed+
Start #y examinin what fields are already present have in the street data. Hopefully,
there is field called speedIlimit or somethin similar. If there is a speed field, then start
from Step /D of this tutorial.
If not, then look for a field called 5155, 5155/ or 51550 !it may #e called 155, 155/
or 1550". 5155 codes are a widely used classification scheme for roads. 1or example,
,A/C- means 9:rimary road with limited access or interstate hihway, ma3or cateory;,
while ,ABG- means 9Alley, road for service vehicles, usually unnamed, located at the rear
of #uildins and property;. &he full ta#le can #e accessed at
http<==support.esri.com=index.cfm>fa?knowlede#ase.techarticles.articleShow@d?//7DD.
&hese codes provide a shortcut to calculate speed limits. It is common practice to assume
that roads with the same 5155 code have the same speed. 1or example, all ,A/C- roads
could #e assumed to have a speed of DH mph, while /H mph could #e reasona#le for all of
the ,ABG- roads. If there is a 5155 field, start from Step /G of this tutorial.
0C
If there isn-t a 5155 field, then either create one, or create a speed field. &his can take
weeks or months for a lare dataset, so look very carefully to make sure there isn-t
already a 5155 or speed field. &he followin tutorial assumes the worst, with no helpful
fields at all.
/. Start ArcMap with an empty map document.
0. Add a pre%#uilt network dataset to the map.
5lick the Add 4ata #utton and naviate to the 9&utorial.d#; eodata#ase !it
should #e in the same folder that this .doc file is in".
4ou#le%click the 9&utorial.d#; eodata#ase.
4ou#le%click the 9drive&ime; feature dataset.
4ou#le%click the 9drive&imeIN4; network dataset.
Note that this network dataset was created using the default settings.
5lick Les when prompted to add all the feature classes.
G. 2pen the attri#ute ta#le for 9roads;.
Note that there are no seed limit or 7-77 fields.
F. 2n the Network Analyst tool#ar, click Network Analyst, and click New Joute.
H. +sin the 5reate Network Kocation &ool, add two stops as shown #elow, and click
Solve.
#n the diagram above, the &b!ect#)s for ,roads. are labeled to identify each street /this
labeling ste is not necessary 88 refer to the diagram above when &b!ect#)s are
mentioned0.
Joads /, 0 and G are slow city streets, while the curved road to the south is a hihway.
&he two vertical roads are intermediate%speed connectors. Since there isn-t a drive time
field, NA used the diitiEed lenth to find the shortest route, even thouh the hihway
path is faster.
D. &urn off the 9Joutes; layer !in the &a#le of 5ontents" so that it does not display.
8e will need a field to hold the 51550 codes. 51550 codes are a simplified version of
the more detailed 5155 codes.
B. 5reate a new field named 951550; on the 9roads; layer.
In Arc&ool#ox, expand the 4ata Manaement &ools tool#ox.
)xpand the 1ields toolset.
0/
4ou#le%click the Add 1ield tool.
5lick on the dropdown arrow to the riht of Input &a#le and select the 9roads;
layer.
&ype C*CC" for the 1ield Name.
5hane the 1ield &ype to T+,T !you may need to scroll up in the list to find it".
Set the 1ield Kenth to ".
4o not chane any of the other settins.
5lick 2P.
A. Start editin.
7. Set the 51550 field for all of the slow city streets to A-.
Select from the 9roads; layer all of the slow city streets !2#3ectI4s of /, 0 and G".
5lick the Attri#utes #utton on the )ditor tool#ar.
8ithin the Attri#utes window, click 9roads; in the left%hand pane.
This allows you to secify the 7-77% code for all selected records
simultaneously. This can save lots of time
when editing thousands of records that will all
have the same 7-77 code.
In the riht%hand pane, type A- into the 51550
field, and press the )nter key on the key#oard.
/C. Set the 51550 field for the moderate speed streets to A(.
Select the roads with 2#3ectI4s of D and B.
5lick 9roads; in the left%hand pane of the Attri#utes window.
Set the 51550 to A(.
//. Set the 51550 field for the hihway streets to A".
Select the roads with 2#3ectI4s of H, A and 7.
5lick 9roads; in the left%hand pane of the Attri#utes window.
Set the 51550 to A".
/0. Stop editin and save the edits.
2ne shortcut to the a#ove workflow would #e to pre%set all 51550 codes to AF, usin
the ArcMap field calculator. Actually, you would set it to whatever code will #e the most
common in your dataset, which for cities is usually AF. Lou would then only have to use
the ArcMap editor to chane streets that have a different value. Alternatively, you could
have used the ArcMap field calculator throuhout, and never use the )ditor. 1inally,
eodata#ase users should use default values and domains, especially for lare datasets.
Now that our 51550 field is fully populated, they can now #e ,converted- into speed
limits.
00
/G. 5reate another field to the 9roads; layer called speed, with the 1ield &ype set to
./012+.
/F. +se the 1ield 5alculator to calculate the 9speed; field #ased on a (.A expression.
2pen the attri#ute ta#le for 9roads;.
Jiht%click the 9speed; field, and click 1ield 5alculator.
5lick the Koad #utton.
4ou#le%click the file called 9&utorialG.cal; !it should #e located in the same folder
that this .doc file is in".
A pre%written (.A expression will #e loaded.
This code sets the seed field based on the 7-77% codes. -or e(amle, all
,A1. freeways will have a seed value of 9: mh, while the ,A;. city
streets will be set to %: mh.
&he second line of code !9speed = 1;" will only #e used if the 51550
value is QNull6. Modify the value to #e whatever is appropriate for your
data.
0G
/H. 5lick 2P to run the 1ield 5alculator.
&he attri#ute ta#le should
now look like the diaram to
the left.
8hen you are ready to work with your real data, the speed values in the a#ove Select
5ase statement should #e modified to match your local speed values. In this example, the
freeways and ma3or hihways !A/" were set to DH mph, #ut in your data it may #e lower
or hiher. 1or example, use<
Case "A1"
Speed = 55
for areas with a lower freeway speed limit.
Also, it is not necessary to specifically use 5155 codes. It is possi#le to use another type
of classification field, since this field is only used to assin speed values. &hat is why it is
so important to examine the data carefullyR there may #e an unlikely field that can #e
used to calculate speeds. 1or example, there may #e a field called 9a#c; that had three
different values< a, # and c, where a ? freeways, # ? feeder roads, and c ? city streets.
2ne would never uess this from the field name, so #e sure to check the metadata
carefully, if it is present. &hese three cateories can #e converted to a (.A expression
like the followin<
Dim speed As Integer
speed = 1
Select Case [abc]
Case "a"
speed = 65
Case "b"
speed = 45
Case "c"
speed = 25
End Select
As a final option, you could skip road classification codes altoether and 3ust type the
speed limits directly into a speed limit field.
0F
/D. 5reate a new field to the 9roads; layer called minutes, with a 1ield &ype of
./012+.
&he new field can #e named anythin, #ut ArcGIS reconiEes a field named 9minutes;,
so it will save time later. It is a ood idea to follow namin conventions used #y the
ArcGIS community wherever possi#le, since it means others will #e a#le to use your data
$uickly, and fewer people will #e askin you $uestions that can #e easily answered in the
data.
&he lenth and speed fields are already populated, so the drive times can now #e
calculated. 1or this tutorial, we want drive time in minutesR althouh any time unit can #e
used. &o do this, the correct formula must #e used. &he #asic formula is Kenth = Speed.
1or example, a GC mile lon road with a speed of DC mph would takes C.H hours to drive.
However, such a simple formula is rarely used, since the distance and time units usually
complicate matters. &he formula we will use is<
minutes ? SSHA:)IKenthT = H0AC U DC = SspeedT
Ket-s examine this in some detail. &he data happens to #e in State :lane feet, so the
SHA:)IKenth field is in feet. .ut the speed values are in miles per hour. &his means
there are two different units of distance< feet versus miles. &hat is why we have to divide
the lenth #y H0AC, so that everythin would #e in miles. &he same loic explains why
we have to multiply #y DC %% the time units are hours for the speeds, #ut the drive times
are to #e reported in minutes.
Any units can #e used for the inputs !lenth and speed" as well as for the output !the drive
time field", #ut the correct constants must #e used. If the constants are wron, NA will
still find the $uickest route !as these are 3ust constants" #ut the time it reports #ack will
not #e what is expected. .elow is an easy workaround for this situation<
5onvert all the distance lenths into miles.
o 5reate a new field, and set it to< feet = H0AC.
5onvert the speeds to miles per minute.
o 5reate another new field, and set it to< mph = DC.
1or example, DH mph #ecomes /.CAGGG miles=minute.
+se the #asic formula !Kenth = Speed" for the drive time field.
The basic e(ression works since all inuts are now in miles and in minutes.
/B. +se the 1ield 5alculator to calculate the 9minutes; field #ased on an expression.
In the attri#ute ta#le for 9roads;, riht%click the 9minutes; field, and click 1ield
5alculator.
+ncheck the Advanced #ox.
4elete anythin in the ,minutes ? - #ox.
:aste the followin expression into the ,minutes ? - #ox<
SSHA:)IKenthT = H0AC U DC = SspeedT
5lick 2P to run the calculator.
0H
8e now have drive times, in minutes, for all of the roads.
/A. 5lose the attri#ute ta#le for 9roads;.
&he network dataset now needs to #e modified, since the current one did not have the
9minutes; field when it was oriinally #uilt.
/7. )xit ArcMap
5lick 1ile, and click )xit. Save the .mxd file.
Lou will not #e a#le to complete the followin steps if ArcMap is runnin.
0C. Start Arc5atalo and naviate to the network dataset 9drive&imeIN4;.
0/. 5reate a new 9Minutes; attri#ute on the network dataset.
Jiht%click the network dataset and click :roperties.
5lick the Attri#utes ta#.
#t currently only has the default
attribute, which is based on the
digitized lengths of the lines.
5lick the Add #utton and fill in the
Add New Attri#ute window<
o &ype 3inutes for the Name.
o (erify that everythin else is as
shown to the riht.
o 5lick 2P.
Note that no evaluators need to #e set manually #ecause the field was called 9minutes;,
so ArcGIS reconiEed it. If the field had a non%reconiEed name, then you would have to
click on the )valuators #utton and specify the evaluators manually.
<ou may want to click on the "valuators button !ust to see how Arc2#S set the
evaluators for this attribute. )o not make any changes in the "valuators dialog,
and click 7ancel to close the "valuators dialog.
&here are now two 5ost attri#utes in this network, Kenth and Minutes, so we will have
to tell the system which one ArcMap should #e usin #y default. &he network can have as
many 5ost attri#utes needed, #ut only one can #e the default. 5urrently the default is the
Kenth attri#ute, as indicated #y the #lue default icon. 8e want to set the default to the
Minutes attri#ute we 3ust created.
0D
00. Jiht click on the 9Minutes; attri#ute in
the Network 4ataset :roperties window, and
click 0se 1y .e%ault.
&he #lue default icon will move to the
Minutes attri#ute.
0G. 5lick 2P on the Network 4ataset
:roperties window.
0F. Jiht%click the network dataset and click .uild.
Lou always have to re#uild the network dataset after it has #een edited. &his is true
whether the edits are to the rows !via the ArcMap )ditor" or to the schema !such as
addin a new attri#ute".
0H. Start ArcMap and open the .mxd file saved in Step /7.
)ven thouh the default 5ost evaluator was chaned in Arc5atalo, this has no effect on
existin map documents. &he chane is only reflected when addin the network dataset to
a new .mxd file. Since the 9Joute; layer in this map was set up to use the Kenth
attri#ute, we have to chane it to use the new Minutes attri#ute.
0D. 5hane the Analysis Settins for this 9Joute; layer to use the Minutes attri#ute.
5lick the Joute :roperties #utton in the NA window
5ick the Analysis Settins ta#
5hane the Impedance from ,Kenth !1eet"- to
,Minutes !Minutes"-.
5lick 2P #utton.
Note that the terms =7ost> and =#medance> both mean the same thing to NA.
0B. &urn the 9Joutes; layer #ack on in
the &a#le of 5ontents.
0A. 5lick Solve.
Notice that NA has chosen the route usin the hihway. )ven thouh this is a loner route
!#y distance", it is now the correct one since it has a shorter drive time.
07. )xit ArcMap and Arc5atalo since this tutorial is complete.
0B
Sub)tutorial. Adding a lengt4 %ield to a s4ape%ile t4at is in geograp4ic coordinates.
+sin data that is in decimal derees, this su#%tutorial will enerate a lenth field that is
in meters.
/. Start ArcMap with an empty map document.
0. Add the 9streetsIG5S.shp; shapefile to the map !it should #e in the same folder that
this .doc file is in".
G. 4etermine if the data uses
eoraphic coordinates.
Jiht%click the
9streetsIG5S; layer in the
&a#le of 5ontents, and click
:roperties.
In the Kayer :roperties
dialo, click the Source ta#.
)xamine the 4ata Source
window.
1or this data, it contains a
eoraphic coordinate system, and
is not pro3ected.
If the coordinate system for your own data is 9+ndefined; or 9+nknown;, then use the
methods descri#ed in http<==we#help.esri.com=arcisdesktop=7.0=index.cfm>
id?BB@pid?BG@topicname?IdentifyinIanIunknownIcoordinateIsystem. 4o not
proceed further if you see 9+ndefined; or 9+nknown;, until it has #een fixed.
F. 5lick 5ancel to close the Kayer :roperties dialo.
0A
H. 5hane the map-s coordinate system to a pro3ected coordinate system.
Jiht%click 9Kayers; in the &a#le of 5ontents, and click :roperties.
5lick the 5oordinate System ta#
In the ,Select a coordinate system<- #ox, expand :redefined 6 :ro3ected
5oordinate Systems 6 +tm 6
Nad /7AG.
5lick 9NA4 /7AG +&M
Mone /DN;.
This coordinate system
was chosen for this data
because the coordinate
system uses meters for a
linear unit, and this data
is secific to Atlanta.
5lick 2P.
5hoose a coordinate system that
makes sense for your study area,
iven the desired units. 1or example,
State :lane would #e a common
choice for those wantin distances in
feet, while Al#ers would #e ood for
those with a study area
encompassin many states.
Now that we know this data uses eoraphic coordinates, and have chosen an appropriate
coordinate system in the desired distance units, we can now create a field that will hold
the lenth of each polyline.
D. 5reate a new field named 9meters;.
Jiht%click the 9streetsIG5S; layer in the &a#le of 5ontents and click 2pen
Attri#ute &a#le.
5lick 2ptions 6 Add 1ield.
Set the Name to meters and the &ype to .ouble.
4o not chane any other settins.
5lick 2P.
1or your own data, name the field the linear unit !e.., 9feet;" used #y the coordinate
system you chose, as NA will automatically know what to do with fields that are named
after linear units.
07
B. 5alculate the field with the
lenths #ased on the coordinate
system.
Jiht%click the new field
and click 5alculate
Geometry.
(erify the settins are the
same as in the diaram to
the riht.
5lick 2P.
&his field can now #e used with NA since it contains a valid unit of lenth !meters", even
thouh the data is still in eoraphic coordinates !decimal derees".
&he 5alculate Geometry command can also calculate in any linear unit. 1or example, we
could have chosen to calculate in ,Pilometers SkmT- instead of meters.
A. )xit ArcMap since this su#%tutorial is complete.
If the eometries of any of the lines are edited or new line features are added, then you
will need to perform Step B aain, as the lenth field will not #e updated automatically.
Jemem#er to rerun 5alculate Geometry whenever the eometry is edited.
If your shapefile data has a pro3ected coordinate system, then you would still do
everythin a#ove, except you would skip Step H !since the map is already in a pro3ected
coordinate system", and you would choose the first option in Step B !,+se coordinate
system of the data source-".
If you are usin a eodata#ase that uses eoraphic coordinates, the procedure is the
same as descri#ed a#ove. If your eodata#ase uses a pro3ected coordinate system, then
you can skip this su#%tutorial entirely since the 9ShapeIKenth; field is already in linear
units.
GC
Tutorial -. 3aking NA respect one)way streets.
&his tutorial will demonstrate how to enforce one%way streets.
/. Start ArcMap with an empty map document.
0. Add the 9theStreets; line feature class to the map.
5lick the Add 4ata #utton and naviate to the 9&utorial.d#; eodata#ase !it
should #e in the same folder that this .doc file is in".
4ou#le%click the 9&utorial.d#; eodata#ase.
4ou#le%click the 9one8ay; feature dataset.
4ou#le%click the 9theStreets; feature class.
Note that there is no re8built network dataset in this data.
)xamine the data !see the fiure #elow". &he oal is to find the shortest route from the
extreme left side of the feature class
all the way to the extreme riht%hand
side. Notice that there are two ways
of doin this, the short top%most route
and the much loner +%shaped lower
route. If a 2ne%way restriction is not
used, the shorter top%most route
would #e found #y the solver. &he
oal is to make the top%most route a one%way street, so the solver will have to o the lon
way around, via the lower +%shaped route. &he arrow shows the permitted direction of
travel that cars are allowed to take, and that will #e set in this tutorial.
.efore makin any edits, we must first know which way each line is diitiEed.
G. Sym#oliEe the 9theStreets; layer usin the 9Arrow at )nd; sym#ol<
Sinle%click the line sym#ol shown in the ArcMap &a#le of 5ontents under the
9theStreets; layer.
The Symbol Selector window oens.
5hoose the 9Arrow at )nd; sym#ol.
5lick 2P.
)ach line is now sym#oliEed with its diitiEed direction.
#n the diagram to the left, the
&b!ect#)s for ,theStreets. are
also labeled to identify each
street /you do not have to do
this0.
F. 5reate a field to hold the one%way values.
G/
In Arc&ool#ox, expand the 4ata Manaement &ools tool#ox.
)xpand the 1ields toolset.
4ou#le%click Add 1ield tool.
5lick on the dropdown arrow to the riht of Input &a#le and select the
9theStreets; layer.
&ype /neway for the 1ield Name.
5hane the 1ield &ype to T+,T !scroll up to see &)O&".
Set the 1ield Kenth to ".
4o not chane any of the other settins.
5lick 2P.
As usual, this field can #e named anythin, #ut 92neway; will save work later on, as
noted in previous tutorials, #ut it really makes a difference for a one%way field since it
avoids havin to type in (. code. .e sure to name it 92neway;, or one of the other
supported field names listed in Appendix / to avoid (. prorammin.
H. )dit the one%way street to #e desinated as one%way.
Start an edit session.
Select the line that is to #e made a one%
way street. In this case, select the line
with 2.N)5&I4 ? /C.
5lick on the Attri#utes #utton on the
)ditor tool#ar.
&ype T* into the 2neway field in the
Attri#utes window, and then press the
)nter key on the key#oard.
1or each one%way street, the 2neway field has the value of either ,1&- or ,&1-. Nothin is
in the field for two%way streets. ,1&- means travel is allowed in the diitiEed direction
!i.e., travel is permitted in the 1rom%&o direction, #ut not the other way". ,&1- means
travel would #e permitted only aainst the diitiEed direction !i.e. &o%1rom travel is
allowed, #ut travel would not #e allowed in the 1rom%&o direction". &he oal with this
data is to allow traffic to travel from riht to left, and there#y prohi#it travel from left to
riht. Since the line is diitiEed from left to riht, the value of the 2neway field must #e
,&1- since we are allowin travel only aainst the diitiEed direction.
D. Ka#el the Streets feature class with the 2neway field.
&he map should look like this<
G0
B. Save the edits and stop editin.
A. )xit ArcMap and save the .mxd file.
7. Start Arc5atalo, naviate to 9&utorial.d#; and open it.
/C. Jiht%click the 9one8ay; feature dataset, point to New, and click Network 4ataset.
//. 5lick the Next #utton without chanin any settins until you arrive at the ,Specify
the attri#utes for the network dataset- panel.
Notice that there is already an attri#ute called 2neway. &his is #ecause the field created
earlier was named 2neway, so the software automatically picked it up. &he +sae is
9Jestriction; since one%way streets are desined to prevent specific movements.
/0. 5lick the )valuators #utton.
GG
/G. 5lick on either of the two records in the main window and click on the )valuator
:roperties #utton !circled in red #elow" to see the (. Script code )SJI uses #y default
for one%way streets<
4o not chane anythin in hereR 3ust click 5ancel twice !once each for the 1ield
)valuators dialo and for the )valuators dialo" to et #ack to the New Network 4ataset
window.
/F. 5lick the Next #utton. A messae will appear sayin that there must #e at least one
cost attri#ute. 5lick Les to create an attri#ute usin the lenth of the lines as the cost !as
opposed to travel time, for instance".
/H. 5lick the Next #utton aain, and then click 1inish. 8hen prompted, click the Les
#utton to indicate you want to #uild the network dataset.
/D. )xit Arc5atalo and start ArcMap. 2pen the .mxd file saved in Step A.
GF
/B. Add the 9one8ayIN4; network dataset to the map.
5lick Add 4ata.
Naviate to 9&utorial.d#; and dou#le%click it.
4ou#le%click the 9one8ay;feature dataset.
4ou#le%click the 9one8ayIN4; network dataset.
5lick Les to add all of the feature classes to the map.
/A. 2n the Network Analyst tool#ar, click Network Analyst 6 New Joute.
/7. 2n the Network Analyst tool#ar, click ,Show=Hide Network Analyst 8indow- if it is
not already present. In the upper riht%hand corner of the Network Analyst 8indow, click
the tiny #utton that is circled in red #elow<
&he Kayer :roperties window will open.
0C. 5lick on the Analysis Settins ta# and verify that 92neway; is checked in the lare
,Jestrictions- #ox and click 2P.
0/. 2n the Network Analyst tool#ar, use the ,5reate Network Kocation &ool- to add a stop
all the way to the left of the feature class, and then a second stop all the way to the riht%
side of the feature class. .e sure to et the order of the two stops correct.
00. 2n the Network Analyst tool#ar, click the Solve #utton.
&he loner path will #e found since the 2neway restriction prohi#its the shorter path.
0G. 2n the Network Analyst tool#ar, click the ,Select=Move Network Kocation &ool-, and
then select and delete #oth stops you placed earlier.
0F. Add the same two stops #ack as you did in step 0/, #ut in the opposite order, i.e. add
the riht%hand most stop first, and then add the left%hand most stop.
0H. 5lick the Solve #utton.
GH
&his time, the shortest route will #e found since travel is allowed from riht to left on this
one%way street.
0D. 5lose ArcMap since this tutorial is finished.
Some find usin 1& and &1 confusin. Here is a much simpler way of approachin this,
if you don-t mind editin your data. 1or every one%way street, use the )ditor-s 1lip
command to make sure the diitiEed direction follows the permitted direction of travel,
and then set the 2neway field value to *T. &his avoids any possi#ility of ettin 1& or
&1 confused since only 1& will #e used !since all of the one%way streets would #e
diitiEed in the direction of travel".
However, if your data already has the four house num#er fields !1romKeft, etc," used for
eocodin, then flippin the polyline would mess up eocodin. Lou will also have to
9flip; all four house num#ers to compensate. &here is a tool at
http<==arcscripts.esri.com=details.asp>d#id?/0ACA that will fix the four house num#er
fields after the line has #een flipped.
&here are other ways of modelin one%way streets which are not covered here. Some use
a value of %/ with two fields instead of usin 1& and &1 in one field. &he 1&=&1 format
was chosen for use in this tutorial since it is widely used #y data vendors.
It is not necessary to use the values of ,1&- and ,&1-R any values can #e used. &his is
especially useful for those who do not primarily speak )nlish. However, if you do not
use values of ,1&- and ,&1-, then you will have to #e capa#le of editin the (. Script
evaluator. .y default, the )SJI evaluator uses the followin code for the 1rom%&o
direction<
restricted = alse
Select Case !Case"[#ne$a%]&
Case "'"( ")"( ")"* restricted = )r+e
End Select
Lou can su#stitute your own values instead of usin the three default values of VNV, V&1V
and V&V. 1or the &o%1rom direction, )SJI uses VNV, V1&V, and V1V, so you will have to
edit this evaluator as well. Lou would chane the values in the 1ield )valuators dialo
while #uildin the network dataset, as shown in the diaram in Step /G.
Lou could also use values of ,tf- or ,ft- instead of ,&1- or ,1&- since NA converts all
values to upper case !usin the (. +5ase function".
GD
Tutorial 5. 0sing global turns.
So far, turns have #een inored. &his is not a very ood idea since it means NA will treat
a left%hand turn the same as a riht%hand turn, even thouh left%hand turns in the real
world usually take loner to make than riht%hand turns. Kater on, &utorial D will descri#e
another way of dealin with turns that is much more time consumin, #ut also more
precise. &he current tutorial demonstrates a simple way of specifyin somethin like ,all
u%turns will take GC seconds, all left turns will take 0F seconds, all riht turns will take /0
seconds, and oin straiht throuh any intersection will take D seconds-.
/. Start ArcMap with an empty map document.
0. Add a pre%#uilt network dataset to the map.
5lick the Add 4ata #utton and naviate to the 9&utorial.d#; eodata#ase !it
should #e in the same folder that this .doc file is in".
4ou#le%click the 9&utorial.d#; eodata#ase.
4ou#le%click the 9lo#al&urns; feature dataset.
4ou#le%click the 9lo#al&urnsIN4; network dataset.
Note that this network dataset was created using the default settings.
5lick Les when prompted to add all the feature classes.
G. 2n the Network Analyst tool#ar, click Network Analyst, and click New Joute.
F. +se the 5reate Network Kocation &ool to add two stops as #elow, then click Solve.
At first lance, it miht seem as if the
loner route has #een chosen, #ut this
is #ecause the network was #uilt with a
time%#ased impedance, as opposed to
lenth. &he 9minutes; field for
9roads1orGlo#al&urns; has #een
la#eled !you do not have to do this". If
you add up the num#ers, you will
notice that NA chose the $uickest route
%% the route found was H.H minutesR the
other route would have #een H.BH
minutes. However, the route found has
three left turns, so may#e this isn-t the
#est route> Jemem#er that NA can only use what it is iven, and this network does not
know that left turns take loner than riht turns. 8e will now #e addin lo#al turns to
the network dataset.
H. )xit ArcMap !save the .mxd file".
D. Start Arc5atalo, naviate to 9&utorial.d#; and open it.
GB
B. 2pen the 9lo#al&urns; feature dataset.
A. Jiht%click the network dataset 9lo#al&urnsIN4; and click :roperties.
7. 5lick the Attri#utes ta# and select the 9Minutes; attri#ute, then click the )valuators
#utton.
/C. 5lick the 4efault (alues ta#.
Notice the )lement called 9&urn;. &hese are the lo#al turns that you et when you create
a default network dataset with the New Network 4ataset wiEard !shown in the left%hand
fiure #elow".
//. 5hane the evaluator
&ype property of 9&urn; to (. Script, and click the )valuator :roperties #utton.
&he Script )valuators window that opens allows us to type code that specifies how much
of a delay turns have. If 95onstant; instead of 9(. Script; was selected for the evaluator
type, we can specify that all turns have a delay of /H seconds !or any other amount of
delay". &he (. Script evaluator allows us to #e more sophisticated and specify that left
turns are slower than riht turns. +se the (. Script evaluator to model conditional
delays.
/0. 5lick the Koad #utton and dou#le%click 9&utorialH.sev; !it should #e located in the
same folder that this .doc file is in".
&he pre%written (. code will #e loaded.
GA
&he varia#le 9t+rn)ime;
must #e in minutes !turns and
edes need to #e in the same
units, and this impedance
attri#ute is in minutes".
&his code specifies that all
left turns to #e 0F seconds
!which is C.F minutes", all
riht turns are /0 seconds, all
straiht%ahead-s are D
seconds, and all +%turns are
GC seconds.
9)+rn,Angle; is
somethin NA creates
automatically, and is used
here to define a left turn as
any time two lines connect to
each other with an anle of
#etween 0/C and GGC
derees. Lou can use any
anle values that make sense
for your data %% 3ust #e sure
the ranes do not overlap one
another.
&he code sets up four different turn cateories !left vs. straiht vs. riht vs. +%turns" #ut
the code can #e modified to use a different num#er of cateories. 1or example, the
document at http<==support.esri.com=index.cfm>
fa?knowlede#ase.techarticles.articleShow@d?07HGD demonstrates penaliEin only left
turns, and inores the other three types, meanin riht turns, etc. are ,free-. &his same
document also explains )+rn,Angle in more detail.
/G. 5lick 2P three times !once each for the Script )valutors dialo, the )valuators
dialo, and the Network 4ataset :roperties dialo".
/F. Jiht%click the network dataset 9lo#al&urnsIN4; and click .uild.
Jemem#er that the network needs to #e re%#uilt any time an attri#ute is chaned.
/H. Start ArcMap and open the .mxd file you saved in Step H.
G7
/D. 5lick Solve.
NA now chooses the other availa#le route.
/B. 2pen the attri#ute ta#le for the output 9Joutes; feature class !#e careful, this is
different from 9Joute;".
Notice that the time for the route is D.HH minutes. &his is the time for the four edes !/.H
W /.BH W / W /.H ? H.BH minutes" plus one left turn !C.F minutes" plus two riht turns !at
C.0 ? C.F minutes".
<our time may be slightly different if you did not locate the two stos exactly at the
very end of both lines.
/A. 5lose the attri#ute ta#le.
/7. :lace a #arrier on the 9/.BH; ede and Solve aain.
&he oriinal route !which was H.H minutes in Step F" is now D.A minutes since there is
now three left turns and one straiht%ahead turn. &his is why the result of Step /D is now
a different route than #efore.
+nfortunately, there is no way to visualiEe lo#al turn delays on a map, as a typical F%
way intersection has /D possi#le turns countin +%turns %% we have to count each turn
manually when analyEin the results.
0C. )xit ArcMap and Arc5atalo since this tutorial is finished.
FC
Tutorial 6. .igiti!ing turn %eatures.
In &utorial H, lo#al turns were used. &his tutorial will demonstrate creatin turn features
for specific intersections. &here are two reasons to do this. 1irst, it can take loner to turn
at one intersection than at another, and individual turn features can model this %% these are
called delay turns, #ecause it tells NA that you can turn here, #ut there is a cost associated
with doin so. Secondly, turn features can #e used to prohi#it certain turns altoether %%
these are called restricted turns. &his tutorial will cover #oth uses.
&urn features should not #e used to prohi#it turnin on to one%way streets. Instead, set up
a one%way field to deal with one%way streets, which was covered in &utorial F. Make
restricted turns only to restrict turns #eyond the one%way restriction.
/. Start Arc5atalo and naviate to the line feature class for this tutorial.
Naviate Arc5atalo to the 9&utorial.d#; eodata#ase !it should #e in the same
folder that this .doc file is in".
4ou#le%click the 9&utorial.d#; eodata#ase.
4ou#le%click the 9diitiEed&urns; feature dataset.
5lick the 9theJoads; feature class.
Note that there is no re8built network dataset in this data.
0. 5lick the :review ta#, and chane the :review dropdown list to &a#le.
Notice that there is already a one%way field !9oneway;" and a cost field !9minutes;"
added to this feature class and fully populated, as per the instructions in &utorials G and F.
G. 5hane the :review dropdown list to Georaphy.
Notice there are several divided hihways, which have #een modeled as one%way streets.
&hese divided hihways have #een included into this tutorial exercise, as they can cause a
lot of confusion when creatin turn features.
F. 5lick the 5ontents ta# in Arc5atalo.
H. Jiht%click the 9diitiEed&urns; feature dataset, point to New, and click Network
4ataset.
D. 5lick Next five times to et to the Attri#utes panel of the New Network 4ataset
wiEard.
Notice that NA automatically created #oth the 92neway; and 9Minutes; network
attri#utes !from the 9oneway; and 9minutes; fields, as they used field names that it
would reconiEe".
B. 5lick Next two more times, then click 1inish to create the network dataset. 8hen
prompted to #uild it, click Les.
F/
Arc(iew G.x and 8orkstation #oth used flat !non%spatial" ta#les to store turns. ArcGIS
takes a very different approach< it uses a spatial feature class.
A. 5reate a new turn feature class.
Jiht click the 9diitiEed&urns; feature dataset !not the network dataset", point to
New, and click 1eature 5lass.
2n the first panel, set the Name to
t4eTurns, and chane the &ype to
Turn *eaturesR do not chane
anythin else.
5lick Next.
2n the second panel, accept the default
settins.
5lick Next.
2n the third panel, inspect the fields
that )SJI already added to this feature
class.
These fields contain all of the roerties that define a turn feature. 5ecause
turns are a secial feature class, "SR# will automatically oulate these fields
when creating individual turn features /which we will do later using the
Arc?a "ditor0.
Scroll down to the end of the fields and add a new field called minutes, and set its
4ata &ype to .ouble.
This field will indicate the turn delays.
Add a second field called
Tra$ersable, set its &ype to
Te7t, and ive it a Kenth
of 1.
This field determines
whether a turn feature
is a delay turn /in
which case the value
will be Y /for <es0 as
delay turns can be
traversed0 or a
rohibited turn /N for
No, since they are not allowed to be traveled0.
5lick 1inish.
Note that we didn-t #uild the network dataset yet, since no turns have yet to #e added.
@e could build it now, but we would need to build it again after creating the turn
features.
F0
7. Modify the network dataset so that it makes use of the new fields.
Jiht%click 9diitiEed&urnsIN4; and click :roperties.
5lick the Attri#utes ta#.
Select 9Minutes; under the Name property and click the )valuators #utton.
Select the record where Source ? 9the&urns;.
5hane the &ype to *ield.
Notice that NA automatically sets the 'alue to the correct field /because of its
name0.
5lick 2P to close the )valuators window.
&his is all that needs to #e done to set up a delay turn. However, a restriction attri#ute
must also #e set up since some of these turns will #e prohi#ited.
/C. 5reate a new restriction attri#ute.
5lick the Add #utton.
Set the Name to 9&raversa#le;.
Set the +sae &ype to
9Jestriction;.
5lick 2P.
//. Set the evaluators on the new 9&raversa#le; attri#ute.
Select the 9&raversa#le; attri#ute and click the )valuators #utton.
Select the record where the Source is 9the&urns;.
Set the &ype to 1ield and click the )valuator :roperties #utton.
5lick the Koad #utton and dou#le%click 9&utorialD.fev;.
The rewritten '5 code will be loaded.
FG
In the (. code, 9[)ra-ersable];
refers to the field that was created in Step
A. A value of 9N; !for No" in this field
means that travel is prohi#ited. &hat
means this (. code must return &rue to
restrict travel. In other words, if the
9&raversa#le; field says 9N;, then the
varia#le in the (. code called
9restricted; will #e &rue and cars
cannot travel throuh this turn. 1or all
other values #esides 9N;, travel would #e
allowed.
/0. 5lick 2P three times !once each for the 1ield )valutors dialo, the )valuators dialo,
and the Network 4ataset :roperties dialo".
/G. .uild the 9diitiEed&urnsIN4; network dataset.
/F. )xit Arc5atalo.
/H. Start ArcMap with an empty map document.
/D. Add the 9diitiEed&urnsIN4; network dataset to the map.
5lick the Add 4ata #utton and naviate to the 9&utorial.d#; eodata#ase !it
should #e in the same folder that this .doc file is in".
4ou#le%click the 9&utorial.d#; eodata#ase.
4ou#le%click the 9diitiEed&urns; feature dataset.
4ou#le%click the 9diitiEed&urnsIN4; network dataset.
5lick Les when prompted to add all the feature classes.
/B. Moom in until the data fills the canvas.
Notice there are four intersections in this dataset.
/A. Moom into the lower%riht intersection.
#f you label the &b!ect#)s of ,theRoads.
feature class, the intersection should look like
the figure to the right.
FF
8e would like to model a delay from street GF turnin left onto street GH, since this
intersection is a #usy crossroad. 5ars will still #e allowed to make this turn, #ut there will
#e a FH second penalty imposed.
Note that a car would not be able to turn left from street A; onto street AB since the
oneway attribute revents this.
/7. :repare the )ditor for creatin a new turn feature.
Start )ditin.
2n the )ditor tool#ar, click )ditor, and click Snappin.
&urn on snappin only for )de for 9theJoads;.
#t is critical to use snaing when making turns.
2n the )ditor tool#ar, set the &aret layer to 9the&urns;.
Make sure the &ask is set to 5reate New 1eature.
5lick on the Sketch &ool !the ,pencil- tool".
)ach turn re$uires a minimum of two points to #e diitiEed. &he first point must #e the
first street encountered #y a car drivin the turn. In this case, this is street GF. &he final
point must #e the last street encountered #y a car drivin the turn. In this case, this is
street GH.
0C. 5reate the turn feature with two vertices.
5lick once !usin the left mouse #utton" on the first street !street GF" to create the
first vertex. .e sure that it is snapped to the street.
This verte( is shown in red in the diagram.
Move the mouse to the upper%left until it is
snappin to the destination street !street GH".
The diagram to the right shows the Sna
Ti.
4ou#le%click on street GH to finish sketchin
the turn feature. .e sure that it is snapped
#efore dou#le%clickin.
&he error messae shown to the left will
occur #ecause streets GF and GH are not
ad3acent to one another. Notice that
street GD is the #lock that ,connects- #oth
GF and GH, so it needs to #e included in
the turn feature.
0/. 5lick 2P to close the error messae.
00. 2pen the attri#ute ta#le for 9the&urns; and delete any rows you see.
The editor may not delete the invalid turn that was !ust made.
Ket-s try it aain, and create the turn feature with all three streets.
FH
0G. 5reate the turn feature with three vertices.
5lick on street GF.
5lick on street GD.
4ou#le%click on street GH.
5e sure to sna roerly to all three
streets.
Aside from snappin, it does not matter where exactly you click alon each street %% you
could have clicked closer or further from the intersection. If you plan on displayin the
turns in the map, you will want to make them lare enouh to see at whatever map
scale!s" you intend to work at.
0F. 2n the )ditor tool#ar, chane the )dit &ask to Modify 1eature.
Notice the turn feature we created looks like any other line feature.
0H. 5hane the )dit &ask #ack to 5reate New 1eature.
Note that we could have also have set up snappin to the network 3unctions !feature class
9diitiEed&urnsIN4INunctions;, in this network" and added another vertex at the
3unction at the north%end of #lock GD, #efore finishin on street GH. Some prefer this look,
#ut it makes no difference to NA. Many never display the turn features anyway.
0D. 8ith the new turn feature is still selected,
click the Attri#utes #utton on the )ditor tool#ar.
Note that NA has automatically filled in all of the
re$uired fields !these #ein with 9)de;".
)xamine these re$uired fields carefully.
&he fields that were created in Step A must still #e filled in manually.
0B. Scroll down in the Attri#utes window and type '.85 into the 9minutes; field !the
delay is FH seconds, #ut the impedance is in minutes"R and type 9 into the &raversa#le
field, since cars are allowed to make this turn !i.e., it is not a prohi#ited turn".
Actually, there is no need to tye Y since the '5 code loaded in Ste 11 only checks
for N. Some like to enter this information so that there aren>t any CNullD values.
0A. Stop editin and save the edits.
07. 2n the Network Analyst tool#ar, click the .uild )ntire Network 4ataset #utton.
Remember, the new turn will not be recognized by NA until the network dataset is
built.
&he turn will draw as a #lue line with an arrow after the network dataset has #een #uilt.
FD
GC. Moom out until all of the streets can #e seen.
G/. Solve a route on the network<
2n the Network Analyst tool#ar, click Network Analyst, and click New Joute.
+se the 5reate Network Kocation &ool to create two stops as shown #elow !left%
side diaram". .e sure to et the order of the two stops correct.
5lick the Solve #utton.
&o really understand these results, compare the results to the exact same Solve if it was
performed riht after Step B of this tutorial !i.e. #efore we made the turn feature class", as
shown in the results a#ove in the riht%hand diaram. 8ithout the new turn the fastest
route was via streets GH and 0C, #ased on all turns havin a delay of C. After a FH second
delay was added oin left onto street GH, it is now $uicker to take streets G0 and G7. Note
that it is still leal to turn on to street GH, #ut it is now slower.
G0. :lace a #arrier on street G0 and re%Solve the analysis.
&he route will take streets GH and 0C, #ut the 9&otalIMinutes; field in the output
9Joutes; feature class will take into account the turn delay.
GG. 4elete the #arrier added in Step G0, and the two stops added in Step G/.
&his concludes the section on delay turns, and will move on to the section on prohi#ited
turns.
GF. Moom in to the intersection at the lower%left corner of the dataset.
Here there are two divided hihways intersectin.
&here are no overpasses or underpasses here %% 3ust
stop lihts.
GH. 5reate two new stops in the order shown, and
click Solve.
#f you turn on &b!ect#) labels, your screen
should look like the diagram to the right.
FB
8e want to prohi#it a +%turn from street /A to street /B. Notice that NA did not take
street 07 !which would #e shorter" since the one%way restriction will not allow it.
GD. &urn off the 9Joutes; layer.
GB. Start )ditin.
GA. :repare the )ditor for creatin a new turn feature.
(erify the snappin is still turned on for )de in the 9theJoads; layer.
Set the &aret layer to 9the&urns;.
Make sure the &ask is set to 5reate New 1eature.
5lick on the Sketch &ool.
Streets 0/, 0A and G/ are all called interior edes #ecause they are
inside the intersection. &he turn feature we will create will have to
reference all three of these interior edes, as well as the two exterior
edes /A and /B.
G7. 4iitiEe the new turn #y clickin on edes /A, 0/, 0A, G/ and /B,
in that order !see diaram to left". .e sure to dou#le%click on the last
!fifth" vertex to finish the turn feature.
It is not necessary to set a delay time for this new turn feature since this is a prohi#ited
turn.
FC. In the Attri#utes window, leave 9minutes; at QNull6 #ut chane 9&raversa#le; to N,
which means this turn can not #e traveled on.
F/. Stop editin and save the edits.
F0. Jun .uild )ntire Network 4ataset.
FG. &urn the 9Joutes; layer #ack on.
.efore the route can honor the new turn restriction, it needs to #e activated.
FF. 2pen the Joute :roperties and click on the Analysis Settins ta#.
5heck on 9&raversa#le; in the Jestrictions window !if it is not already
turned on" and click 2P.
FH. 5lick Solve.
Notice that the route no loner does a +%turn, #ut instead it does
somethin leal, #ut strane< it travels from street /A to 0/ to 0A to G/,
then 3umps on to 07 !since this one%way street is oin the correct way",
and then #ack on to 0/, 0A and G/ aain, and finally, on to /B. It is all
FA
perfectly leal with respect to the turn feature at this intersection, #ut it is not what is
expected.
2ne miht think the solution here is to make a smaller turn that prohi#its movement
#etween street G/ and street 07.
FD. 5reate a turn feature as shown to the riht.
Start editin.
4iitiEe a turn from street G/ to street 07.
In the Attri#utes window, set its 9&raversa#le; field to N.
Stop editin and save the edits.
FB. Je#uild the network dataset.
&here is a #uild error.
FA. 5lick the Show .uild )rrors #utton.
1or the turn created in Step FD, there is the messae<
SourceName< the&urns, 2#3ectI4< F, &he edes of the turn element conflict with
existin interior=exterior edes.
&his is a common messae, which is why this tutorial is demonstratin it. &his messae
means that once a turn uses an ede as an interior ede to itself, that ede must #e used
only as an interior ede #y other turns !i.e., no other turn is allowed to use it as an
exterior ede". )de G/ is already used #y the first turn as an interior ede, so the new
short turn cannot use it since it would #e used as an exterior ede.
F7. 5lose .uild)rrors.txt and click 5lose on the Network 4ataset .uild )rrors dialo.
HC. Start )ditin. 4elete the new small turn feature created in Step FD, #ut keep the +%
turn feature created in Step G7.
Here is the rule that has #een overlooked< +%turns at divided hihways should always #e
made in pairs, even if only one +%turn is desired.
H/. 4iitiEe a new turn feature #y clickin on edes GC, G/, 07, 0/ and 0C, in that order.
H0. Since this turn is not prohi#ited !remem#er, this turn is only #ein created since turns
at divided hihways should #e in pairs" set the 9&raversa#le; field ? 9L; in the Attri#utes
window.
HG. Stop )ditin and save the edits.
HF. .uild the network dataset.
HH. Solve the analysis.
F7
&he route will now o way up to the north #efore turnin at
a different intersection and comin #ack, as expected !see
the diaram to the left".
HD. Move the two stops as shown in the diaram to the
riht.
HB. Solve the analysis.
Notice the route will not have to take a lon route since the
second +%turn is traversa#le. )ven thouh this second +%
turn does not restrict or delay any travel, it had to #e made
so that NA could ,interpret- the first +%turn correctly.
HA. 5lose ArcMap since this is the end of &utorial D.
#f you will be modeling only delay turns, you do not need to add the ,Traversable. field.
4ust add the ,minutes. field in Ste E. &n the other hand, if you will be modeling only
rohibited turns, then you should not add the ,minutes. field in Ste E.
HC
Tutorial 8. A parameter)based restriction.
Imaine havin #rides that have weiht or heiht limits. 1or example, one #ride may
not #e safe for trucks heavier than five tons, #ut another #ride may #e a#le to easily
handle a heavier vehicle. It is easy to store this information in a field, such as
9weihtIlimit;, for the #ride feature class. .ut the followin is a more difficult pro#lem<
imaine also havin trucks of different weihts. &o deal with this, we would have to #e
a#le to specify what the current truck weihs riht #efore solvin the analysis. 8e would
#e askin ,8hat is the #est route for a 0.H ton truck>-, which could ive a very different
route than if we had asked ,8hat is the #est route for a /C ton truck>-. (ehicle weiht in
this case is a varia#le that cannot #e put into any field, as it can #e chaned immediately
#efore solvin the analysis. :arameters allow varia#les, such as vehicle weiht, that can
#e specified and chaned in ArcMap immediately #efore performin an analysis.
/. Start Arc5atalo and naviate to the line feature classes for this tutorial.
Naviate Arc5atalo to the 9&utorial.d#; eodata#ase !it should #e in the same
folder that this .doc file is in".
4ou#le%click the 9&utorial.d#; eodata#ase.
4ou#le%click the 9weihtJestriction; feature dataset.
Note that there is no re8built network dataset in this data.
0. Inspect the two feature classes in the 9weihtJestriction; feature dataset< 9#rides;
and 9hihways;. &he former has a field called 9weihtIlimit; !1ield &ype ? 42+.K)".
:review the &a#le of the 9#rides; feature class. Notice there is a different weiht limit
for each of the three #rides.
The bridges are in a searate feature class from the rest of the roads, but that is not
essential.
G. Jiht%click the 9weihtJestriction; feature dataset, point to New, and click Network
4ataset.
F. 5lick the Next #utton once.
H. 5lick the Select All #utton to select #oth feature classes, and click Next four more
times to et to the attri#utes window.
As usual, the Attri#utes panel is where most of the action happens, and settin up a
parameter%#ased restriction is more involved than creatin the attri#utes we set up in
previous tutorials. .e very careful in the followin steps to type names exactly as
descri#ed. If anythin is misspelled, the tutorial will not work.
H/
D. 5reate a descriptor attri#ute that indicates the maximum weiht of each road.
5lick the Add #utton.
Set the Name property to
ma7:eig4t.
Set the +sae &ype to
.escriptor.
Set the 4ata &ype to
.ouble !#ecause the
9weihtIlimit; field was
defined as 4ou#le".
5lick 2P.
B. Set up the evaluators for this new descriptor attri#ute.
5lick the )valuators #utton
Select the two records where Source ? 9#rides;.
Jiht%click anywhere in the selected area and choose &ype 6 1ield.
Jiht%click in the same area and choose (alue 6 8)IGH&IKIMI&.
5lick 2P.
&he descriptor attri#ute does not do much #y itself !since the Jestriction attri#ute really is
of interest", #ut it provides a way to ,point- to the 9weihtIlimit; field, and it will #e
eventually tied in to the restriction.
A. 5reate the restriction attri#ute.
5lick Add on the New
Network 4ataset wiEard.
Set the Name to :eig4t.
Set the +sae &ype to
;estriction.
5lick 2P.
7. 5reate the parameter for the restriction attri#ute.
.e sure that the new 98eiht; attri#ute is selected.
5lick the :arameters #utton.
5lick the Add #utton in the 8eiht :arameters window.
&ype <e4icle :eig4t for the Name.
The names of the arameters should be carefully considered, since these
names are what is shown in Arc?a.
4o not chane any other properties, as they are already set correctly.
Having the Tye set to Double makes sense for us since a truck can weigh
%.9BE tons, for e(amle. #t also makes sense as our weight limit field in our
bridge feature class is also )ouble. The )efault 'alue should be set to the
most common vehicle weight that will be used. -or e(amle, if most of your
trucks are five tons, then set the )efault 'alue to :. #n this tutorial, we used F
H0
because to model solving mostly for cars. The weight of F reresents a car
since a car can travel over any bridge. This allows for us in Arc?a to only
have to tye in a weight for heavier vehicles.
5lick 2P twice !once each for the Add :arameter window and the 8eiht
:arameters window" to et #ack to the New Network 4ataset window.
8e now need to tell NA that a vehicle cannot travel on a #ride if its weiht is reater
than the #ride-s weiht limit. &his is a conditional test, so it will re$uire some (. code.
/C. Set up the evaluators for the restriction attri#ute.
Make sure the 98eiht; attri#ute is selected, and click the )valuators #utton.
Select the two records where Source ? 9#rides;.
Jiht%click anywhere in the selected area and choose &ype 6 (. Script.
Jiht%click aain in the same area and choose (alue 6 :roperties.
5lick the Koad #utton and then dou#le%click the 9&utorialB.sev; file, to add some
prewritten (. code.
&he main varia#le in this code is 9restricted;. If it ends up #ein set to &rue,
then that means travel is not allowed on that #ride #ecause the vehicle is too
heavy. &he varia#le 9$eig.t; is the current vehicle-s weiht. It is also the value
that will #e typed in ArcMap riht #efore solvin. &he varia#le 9ma/0eig.t; is
the weiht limit for the current #ride. If necessary, NA will examine each
#ride-s weiht limit !the 9Edge,; means the sinle #ride currently #ein
HG
evaluated". &he heart of the loic is 9$eig.t 1 ma/0eig.t;. If the vehicle
weiht !9$eig.t;" is reater than the current #ride-s weiht limit
!9ma/0eig.t;", then this code will return &rue. Since this is for a Jestriction
attri#ute, &rue means that #ride is restricted. &hat means NA will have to find a
different route that does not use this #ride.
5lick 2P twice !once each for the Script )valuators dialo and the )valuators
dialo".
&he restriction attri#ute is now complete.
//. 1inish creatin the network dataset.
5lick Next.
5lick Les to create the re$uired lenth%#ased 5ost attri#ute.
5lick Next.
5lick 1inish
5lick Les to #uild the network dataset.
/0. Start ArcMap with an empty map document.
/G. Add the 9weihtJestrictionIN4; network dataset to the map.
5lick the Add 4ata #utton and naviate to the 9&utorial.d#; eodata#ase !it
should #e in the same folder that this .doc file is in".
4ou#le%click the 9&utorial.d#; eodata#ase.
4ou#le%click the 9weihtJestriction; feature dataset.
4ou#le%click the 9weihtJestrictionIN4; network dataset.
5lick Les when prompted to add all the feature classes.
/F. Make the 9#rides; feature class a different sym#ol.
The diagrams below show them with the railroad symbol. Those diagrams are
also labeled with the ,weight3limit. field, indicating the ma(imum allowable
vehicle weight for each bridge.
/H. :erform a Joute analysis.
2n the Network Analyst tool#ar, click Network Analyst, then click New Joute.
+se the 5reate Network Kocation &ool to add two stops as shown in the diaram
#elow.
5lick Solve.
HF
NA found the shortest possi#le route !remem#er that the 5ost attri#ute for this network is
#ased on ShapeIKenth". However, since a vehicle weiht was not specified, and the
default vehicle weiht for the parameter was set to C, this is the #est route when drivin a
car.
/D. Modify the Joute analysis for a H%ton truck.
5lick Joute :roperties.
5lick the Attri#ute :arameters ta#.
This is where we secify vehicle weight.
&ype 5 into the (alue property of the (ehicle 8eiht parameter.
5lick 2P.
5lick Solve.
A different route was chosen. &he vehicle !the H%ton truck" is now too heavy to travel
across the 0.H ton #ride, so it had to take a loner route.
HH
/B. Jepeat Step /D, this time specifyin a (ehicle 8eiht of /C tons. NA will now choose
the lonest possi#le route.
/A. 1inally, solve usin the (ehicle 8eiht set to /H tons.
Lou will et the )rror ,No solution found-, since none of the #rides can handle a truck
this heavy.
/7. 5lose ArcMap and Arc5atalo since this tutorial is finished.
Lou can have as many parameters as you need !such as vehicle heiht and width, as well
as vehicle weiht", #ut you will need to #e a capa#le (. prorammer if you would like to
model a complex pro#lem.
HD
Appendi7 1. Good %ield names to use.
As has #een demonstrated repeatedly in this tutorial, life is easier if fields are called
certain names. &hat way, )SJI will look for them when creatin a network dataset, and it
will automatically turn them into valid network attri#utes. &his is, at the very least, a nice
convenience and, as seen with one%way streets, it can also save you from typin in (.
code. .elow is a list of the more common fields NA looks for !case does not matter, so
92neway; is the same as 92n)wAy; etc."<
2ne%way field can #e called oneway, oneIway, dirtravel, dirItravel, traveldir, or
travelIdir. &he field-s 4ata&ype must #e Strin !&ext".
&ime%#ased 5ost fields can #e called minutes, seconds, hours, or days. 4ata&ype
must #e 4ou#le.
4istance%#ased 5ost fields can #e called meters, inches, feet, yards, miles,
nautical miles, millimeters, centimeters, kilometers, or decimeters. 4ata&ype must
#e 4ou#le.
&here is also a eneric 5ost field. It must #e called cost, 4ata&ype 4ou#le. &he
+nits will #e set to esriNA++nknown. +se this if the 5ost field units are
somethin not listed a#ove, such as dollars or derees 1ahrenheit or milliseconds.
)levation fields !always paired" can #e called fIelev=tIelev, fIElev=tIElev,
fnodeIelev =tnodeIelev, or fnodeIElev =tnodeIElev.
1or drivin directions, the street name field can #e called addrIsn= fname= fename=
stInmI#ase= street%name= streetIname= streetInam= streetname= stIname= st%name=
strIname= str%name= name= street= roadname= or road.
&he a#ove list is not complete. )xamine the file Network4ataset5onfiuration.xml to see
the full list. It lists the other components for drivin directions, such as prefix direction,
street type etc., as well as several lesser%used attri#utes specified in this file that NA can
set up automatically. It is located in the ArcGIS install directory under<
XYArcGISYNetworkAnalystYNetwork5onfiurationY
1or example, if you accepted the default installation location, the file will #e located at<
5<Y:roram 1ilesYArcGISYNetworkAnalystYNetwork5onfiurationY
&he file can #e opened in Internet )xplorer or #y dou#le%clickin it in 8indows )xplorer.
Note that this OMK file can also #e edited to add your own fields etc., #ut this will
re$uire knowlede of OMK. .e sure to make a #ackup copy of this file #efore modifyin
it. Note that modifications to this file are not supported #y )SJI &echnical Support.
HB

You might also like