Professional Documents
Culture Documents
Zhou
HONGKONGBAPTISTUNIVERSITY
GEOG3600/4017GeographicalInformationSystems
Lab9
NetworkAnalysis
Objectives
TheexercisedemonstrateshowtheGISnetworkanalysisfunctionscanbeusedtosolvedaily
transportationproblemsinanurbanenvironment.Thestudentswillpractisethetechniquesin
establishingnetworkdatabase,assigningimpedanceandothernetworkparameters,andproblem
solvinginselectingtheoptimalroute,findingtheclosestfacilitiesandidentifyingtheserviceareaofa
givenfacility.
Tasksinclude:
Constructanetworkdatasetbyusinglinefeatureanddefiningtimecost;
SolvedifferentnetworkrelatedproblemsbyusingtheNetworkAnalyst;
o Selectoptimalroute;
o Selectthebestorderforseveraldestinations;
o Findtheclosestfacilitiesforincidents;
o Identifytheserviceareaofafacility;
Guidelines
Preparation
1. LogontoworkstationusingyourGISLABaccount.Withthehelpofyourtutor,copythedataset
fromK:\GEOG4017\lab9toyourownspace(i.e.J:\GEOG4017\lab9);
Thefoldercontainssevenshapfiles:
hk_territory.shptheoutlineofHongKongSARterritory;
current_roads.shpsimplifiedroadnetworkforentireHongKongSARterritory;
day_trip.shpThestopsofproposeddaytrip;
services_stops.shpThestopsofservicetrip;
hospital_selected.shpThelocationsofselectedhospitals;
accidents.shpThelocationsofaccidents;
baptist.shpThelocationofHongKongBaptistHospital;
2. StartArcCatalog.NavigatetoyourJ:\geog4017\lab9.Selectindividualshapefiles.Select[Preview]
panetopreviewtheircontents(bothGeographyandTable).
Constructionofnetworkdataset
3. StartArcMapwithablankMapDocument.Addthehk_territory.shpandcurrent_roads.shp(both
intheJ:\geog4017\lab9)intothedataframeaslayers.Opentheattributetableofcurrent_roads
layer.
Questions:
Whatmanyroadsegmentsarethereincurrent_roadslayer?___________________________
Whatarethelengthsofthelongestandshortestroadsegments(inmeters)?
Longestroadsegment______________(m) Shortestroadsegment.________________(m)
4. Beforeyoucansolveanything,youneedtogetyourdatabasereadyfortheanalysis.Theattribute
tableofcurrent_roadscontainsallnecessaryinformationexceptthetraveltimethatisrequired.
Thetraveltimeisdefinedasthetimerequiredtodrivethroughthegivenroadsegmentwhich
shouldbespecifiedasanattributefieldintheattributetableofcurrent_roads.
Thetraveltimeisdefinedas:T=L/S*T0*R,whereTistherequiredtraveltimeinminutes,Listhe
distance(field"LENGTH")inmeters,Sisthespeedlimit(field"SPEED_LIMIT")inkm/hour,T0isthe
timeunitscalarforspeedunit(equalto0.06fortheunitofTasminutes),andRistheroadtype
(field"TYPE")whichspecifiedexpectedtraveldelaysindifferenttypesorroad.Forexample,for
roadtype1(i.e.Highway),theextradelayisassumedminimal,whileforroadtype3(i.e.localback
street),substantialdelaywouldoccur.Forthisexercise,weassumethatthebackstreetwouldcost
usabout3timestraveltimeasthatofspeedlimit.
Weneedtocreateafieldwhichisusedtostoretherequiredtraveltime(inminutes).Pressthe
[TableOptions]buttononthetableandselectAddField.Setthepropertiesofthefieldasbelow:
Name: Drivetime
Type: Float
Precision/Scale: (Leaveasdefaults)
Thenpress[OK]tocreatethisfield.
5. RightclickthefieldnameDrivetimeandselectFieldCalculator.Studythewarningmessageand
thenclick[Yes]toskipit.
Typetheequationasstatedinstep4intheFieldCalculator.
Questions:
ListyourequationthatyouusedinFieldCalculatorbelow:
(DriveTime=)_____________________________________________________________________
Whichsegmentrequiresthelongesttraveltimeandwhatisitstraveltime?
SegmentFID____________________ Traveltime____________________(minutes)
Doesitthelongestsegment(intermofdistance) Yes/No(circleyouranswer)
Whenyoufinishcalculatingthefield,closethetable.Youmayremovethecurrent_roadslayer
(rightclick>Remove)atthisstage.
6. SwitchtoArcCatalog.Wewillcreateanetworkdatasetbaseoncurrent_roadsfeatureclass.We
needtouseNetworkAnalystextensiontocreateandanalyzethenetworkdataset.
SelectCustomize>Extensions.Tickthe3DAnalyst(ifitisnotticked),thenclick[Close]toclosethe
dialogbox.
TheArcGISNetworkAnalystextensionallowsyoutobuildanetworkdatasetand
performanalysisonanetworkdataset.Thisextensioniscomposedofanumberof
parts:awizardtocreateanetworkdataset(inArcCatalog),adockableNetwork
Analystwindow(inArcMap),aNetworkAnalysttoolbar(inArcMap),andanumberof
geoprocessingtoolscontainedwithinArcToolbox.
7. IntheCatalogtree,rightclickthecurrent_roads.shp(inJ:\geog4017\lab9)andselectNewNetwork
Datasettocreateanewnetworkdataset
Click[Next]sixtimestoacceptalldefaultsettingsinnetworkdatasetcreation.Checkyoursettings
inthesummaryandthenclick[Finish]tocreatethenetworkdataset.
Oncethenetworkdatasethasbeencreated,amessagewillbeprompted.Click[Yes]tobuildit.
Whentheprocessfinished,anewnetworkdatasetcurrent_roads_ND.ndwillbecreated
(Moreover,ashapfilecurrent_roads_ND_Junctions.shpwillalsobecreatedatthesametime).
searchCreatinganetworkdatasetandBuildingnetworkdatasetinArcGISDesktop
Help
8. Previewthenewlycreatedcurrent_roads_ND.ndandcurrent_roads_ND_Junctions.shp.Thenyou
mayquitArcCatalog(File>Exit).
ReturntoArcMap.Addthecurrent_roads_ND.ndintothedataframe(File>AddData).A
messagewillappeartoaskyoutoaddallfeaturesclassesthatparticipatinginthenetworkdataset
tothemap.Click[Yes]toaccept,andthecurrent_roads_ND.nd,current_roads.shpand
current_roads_ND_Junctions.shpwillbeaddedtothedataframeaslayersautomatically.
9. SelectCustomize>Extensions.TicktheNetworkAnalystifitisnotticked,thenclick[Close]to
closethedialogbox.
Moreover,turnontheNetworkAnalysttoolbar(Customize>Toolbars>(tick)NetworkAnalyst)for
ourlatteruses.OntheNetworkAnalysttoolbar,clicktheShow/HideNetworkAnalystWindow
button toshowtheNetworkAnalystWindow(atthismomenttheNetworkAnalystWindow
shouldbeempty).
NetworkAnalysttoolbar
NowthenetworkdatasetisreadyandtheNetworkAnalystisactivated.Wemayusethemtosolve
ournetworkproblems.
Selectingtheoptimalroute
10. WeareproposingadayfieldtriptoTaiOonLantauIsland.AstudentwholivesinShaTinneedsto
cometoHongKongBaptistUniversityatKowloonTongtocatchthebus,whichwilltrytogettoTai
Oasquickaspossible.
Addtheday_trip.shpintothedataframeasalayer.Viewthelocationsofthestops(hint:youmay
hidethecurrent_roads_ND_Junctionsandcurrent_roadslayersootherpointlayerscanbeviewed
cleareronyourmap).
OntheNetworkAnalysttoolbar,clickthe[NetworkAnalyst]buttonandselectNewRoute.
IntheTableofContents,anewlayerRoute{(randomdigits/characters)}willbecreated.Anditwill
alsoappearintheNetworkAnalystWindow.
RightclicktheStopsinNetworkAnalystWindowandselectLoadLocations
IntheLoadLocationsdialogbox,ensuretoLoadFromday_trip,leaveotherparametersasdefaulst
andclick[OK]toacceptthedefaultsettings.
Thenyouwillfindthethreestops(ShaTin,KowloonTong,TaiO)havebeenloadedintotheroute
(clickthe+signinfrontofStopstoview).Andtheyshouldalreadybeinthecorrectorder.
Question:
Canyousuggestareasonwhythestopshavebeenarrangedincorrectorder(evenwedidnothing
before)?
_________________________________________________________________________________
_________________________________________________________________________________
_________________________________________________________________________________
Onceyouconfirmtheorderofstopsiscorrect,clicktheSolvebutton ontheNetworkAnalyst
toolbartocreatetheshortestrouteusingNetworkAnalyst.
Clickthe+signinfrontoftheRoutes(inNetworkAnalystWindow).RightclicktherouteShaTin
TaiOandselectProperties
Question:
WhatisthetraveltimefromShaTintoTaiOviaKowloonTong(inminutes)?
_________________________________________________________________________________
Click[OK]toclosethePropertieswindow.SavetheMapDocumentasJ:\geog4017\lab9\lab9a.mxd.
Thisparthasalreadyfinished.
Selectingtheoptimalrouteandthebestorder
11. YoumayremaininthesameMapDocument.Onceyoufinishedthelastpart,youmayremovethe
layersRouteandday_trip.Atthesametime,addtheservice_stops.shpintotheDataFrameasa
layer.
Thenextproblemisforaservicemanwhoneedstovisitanumberofplacestodothejob.He
needstostartfromhisTsimShaTsuioffice,andvisitplacesinKowloonTong,ShaTin,FanLing,Ap
LaiChauandTuenMun,thenreturntohisTsimShaTsuioffice.Noteinthiscase,hehastokeep
thetravelintheaboveorder,i.e.visitTuenMunafterApLaiChaubeforegoinghomeofficeatTsim
ShaTsui.Thestopsarealreadygiveninservice_stoplayer.
Wemayusesimilarmethodasthatinstep9tosolvetheproblem.OntheNetworkAnalysttoolbar,
clickthe[NetworkAnalyst]buttonandselectNewRoute.RightclickStops(inNetworkAnalyst
Window)andselectLoadLocationsagain,butthistimeselectORDERasSortFieldinLoad
Locationsdialogboxbeforeyouclick[OK].
Moreover,rememberthattheservicemanneedstoreturntohisofficeinTsimShaTsuiafterthe
trip.ThereforeyouneedtoaddtheseventhstopinTsimShaTsui(byrightclickingTsimShaTsui
andselectCopythenPaste,orbydragginganddropping).
FinallyyoumayclicktheSolvebuttononNetworkAnalysttoolbartofindthebestrouteforthis
problemandtherequiredtraveltime.
Question:
Whatisthetraveltimeforthistrip(inminutes)?
_________________________________________________________________________________
SavetheMapDocumentasJ:\geog4017\lab9\lab9b1.mxd(File>SaveAs).
12. Now,iftheservicemancanplanearlysothathecanrearrangethevisitorder,canhesavemuch
traveltime?WemaychangetheanalysissettingandletNetworkAnalysttodeterminethebest
orderforusinsuchcase.
ClicktheRoutePropertiesbuttoninNetworkAnalystWindow.
IntheLayerPropertiesdialogbox,select[AnalysisSettings]tab.Thistime,ticktheReorderStops
ToFindOptimalRouteoption.Moreover,ensurethatPreserveFirstStopandPreserveLastStop
optionsarealsoticked(astheservicemanmuststartathisofficeandreturntohisofficeafter
visitingalllocations).Thenclick[OK]toconfirmchangingthesetting.
ClicktheSolvebuttononNetworkAnalysttoolbaragain.
Questions:
WhatistheoptimalorderdeterminedbyNetworkAnalyst?
_________________________________________________________________________________
_________________________________________________________________________________
Howmuchtime(inminutes)canbesavedbyadoptingthisroute?
_________________________________________________________________________________
SavetheMapDocumentasJ:\geog4017\lab9\lab9b2.mxd(File>SaveAs).
Findingtheclosestfacilities
13. RemaininthesameMapDocument.Onceyoufinishedthelastpart,youmayremovethelayers
Routeandservice_stops.Atthesametime,addtheaccidents.shpandhospital_selected.shpinto
theDataFrameaslayers.
Therehavebeen5roadaccidentcasesspecifiedinlayeraccidents.Foreachofthecases,findthe
closesthospitalwithinthetraveltimeof15minutes.Thehospitalfacilitiesaredefinedinlayer
hospital_selected.
OntheNetworkAnalysttoolbar,clickthe[NetworkAnalyst]buttonandselectNewClosetFacility.
RightclickFacilities(inNetworkAnalystWindow)andselectLoadLocations.SetLoadFromto
hospital_selected(click[OK]toclose).ThenrightclickIncidents,selectLoadLocations,setLoad
Fromtoaccidents,click[OK]toclose.
Questions:
Howmanyfacilitiesandincidentsarethereinourstudyhere?
Facilities:____________________ Incidents:____________________
WhytwofacilitiesareclassifiedasUnlocated?
_________________________________________________________________________________
ClicktheRoutePropertiesbuttoninNetworkAnalystWindow.IntheLayerPropertiesdialogbox,
select[AnalysisSettings]tab.SettheDefaultCutoffValuetobe15.AndensuretoselectIncident
toFacilityforTravelFrom.Click[OK]toconfirmit.
Onceeverythingisokay,clicktheSolvebutton ontheNetworkAnalysttoolbartofindoutthe
closethospitalforeachaccident.
Questions:
Completethetablebycheckingthepropertiesofeachroute.
Accident ClosetHospital TravelTime(minutes)
Accident1
Accident2
Accident3
Accident4
Accident5
WhyNetworkAnalystcannotfindclosethospitalforoneoftheaccidents?
_________________________________________________________________________________
_________________________________________________________________________________
SavetheMapDocumentasJ:\geog4017\lab9\lab9c.mxd(File>SaveAs).
Identifyingtheservicearea
14. RemaininthesameMapDocument.Onceyoufinishedthelastpart,youmayremovethelayers
ClosetFacility,accidentsandhospital_selected.Atthesametime,addthebaptist.shpintothe
DataFrameasalayer.
LocationofHongKongBaptistHospitalisgiveninlayerbaptist.Wewilldrawamapshowingthe
extentofallservicetimezonesof30minutes,15minutesand5minutes.
OntheNetworkAnalysttoolbar,clickthe[NetworkAnalyst]buttonandselectNewServiceArea.
RightclickFacilities(inNetworkAnalystWindow)andselectLoadLocations.EnsuretosetLoad
Fromtobaptist,click[OK]toset.
ClicktheRoutePropertiesbuttoninNetworkAnalystWindow.IntheLayerPropertiesdialogbox,
select[AnalysisSettings]tab.SettheDefaultBreakstobe5,15,30,andsettheDirectiontobe
TowardsFacility.(doNOTclick[OK]atthismoment)
Thenselect[PolygonGeneration]tab.EnsurethattheOverlapTypeissettobeRings.Thenclick
[OK]toconfirmthesettings.
Onceeverythingisokay,clicktheSolvebutton ontheNetworkAnalysttoolbartogeneratethe
serviceareazones.
Youmaychangethesymbolsofdifferentserviceareazonestomakethemapnicer.Moreover,
remembertoswitchtoLayoutView(View>LayoutView)andinsertallnecessarymapelements.
Question:
(PrintthelayoutoutinaA4sizepaperusingcolorprinter)
SavetheMapDocumentasJ:\geog4017\lab9\lab9d.mxd(File>SaveAs).ThenquitArcMap(File>
Exit).Turnoffyourworkstationbeforeyouleave.
Ifyouareinterestedinthistopic,youmaydownloadamorecomprehensivetutorial
viathefollowingaddress:
http://help.arcgis.com/en/arcgisdesktop/10.0/pdf/networkanalysttutorial.pdf