Professional Documents
Culture Documents
COM/2012/09
/30/CALCULATINGTHEVOLUMEANDSURFACEOFARESERVOIRUSINGARCGIS
/#COMMENTS)
Todaywearegoingtoseehowtocalculatethevolumeofaprojectedreservoirwhichwillbecreatedwith
theconstructionoftheVillafriaDaminNorthernSpainusingArcGISanditsextension3DAnalyst.
Westartbyactivatingthe3DAnalyst(http://www.esri.com/software/arcgis/extensions/3danalyst)
Extension:Customizemenu>Extensions
Thedatarequiredforthisexerciseisacontourmapwithlinesplacedat5meterintervals(contours.shp).
(https://watergis.files.wordpress.com/2012/09/contours.jpg)
ThefirststepisconvertingthecontourmapintoaTriangulatedIrregularNetwork(TIN):
OpenArcToolbox>3DAnalystTools>TINManagement>CreateTIN
Selectcontours.shpastheInputFeatureClassandnametheOutputTINterrain_tin:
(https://watergis.files.wordpress.com/2012/09/create_tin.jpg)
TheprocessofcreatinganewTINmaytakeseveralminutes,dependingontheaccuracyoftheoutput
surface.
(https://watergis.files.wordpress.com/2012/09/reservoir_tin.jpg)
Wenowhavetoselectthecontourthatmarksthereservoirmaximumlevel,whichaccordingtothe
projectissetat1115metersabovesealevel.So,weselectthe1115contourusingtheSelectbyAttributes
tool:Selectionmenu>SelectByAttributes.Inthequerybuilderenterdataasshowninthenext
picture:
(https://watergis.files.wordpress.com/2012/09/select_by_attributes.jpg)
Pleasenotethat,inordertoperformsurfaceandvolumecalculations,thecontourmustbeclosed,so
unselectallothercontoursthatarenotlinkedtotheactualreservoirsurface.
Thiscontourgivesusanideaofthemaximumfloodextentofthereservoironcefilledatitsfullcapacity.
(https://watergis.files.wordpress.com/2012/09/reservoir_surface.jpg)
Thenextstepisconvertingtheselectedcontour(Polyline)intoaPolygon:ArcToolbox>Data
ManagementTools>Features>FeatureToPolygon.
(https://watergis.files.wordpress.com/2012/09/reservoir.jpg)
Andfinally,tocalculatethetotalvolumeofthereservoir,weusethetoolPolygonVolume:ArcToolbox
>TerrainandTINSurface>PolygonVolume.
Selectterrain_tinastheInputSurface;1115_contour_polygonastheInputFeatureClass;andHeight
FieldasCONTOUR.InReferencePlane,makesurethatBELOWisselected.Thevolumeandsurface
areawillbecalculatedbelowthereferenceplaneheightofthepolygon.Leavetherestasdefault:
(https://watergis.files.wordpress.com/2012/09/polygon_volume.jpg)
ClickonOK.Thecalculationprocessmaytakeseveralminutes.
Asthefinalresult,twonewfieldsareaddedtothe1115_contour_polygon.shpattributetable:
VolumeandSArea.Inthiscase,theresultisincubicmeters,sinceweareworkinginInternational
SystemofUnits(S.I.):11,834,796.1198(equivalentto11.835cubichectometers).Wealsogotthetotal
floodedsurface:1110140.5082squaremeters(equivalentto111.014hectares).
(https://watergis.files.wordpress.com/2012/09/final_result.jpg)
(https://watergis.files.wordpress.com/2012/09/villafria.jpg)
(https://watergis.files.wordpress.com/2012/09/reservoir_surface.jpg)
FILEDUNDERSPATIALANALYSIS
APRIL8,2012 3COMMENTS(HTTPS://WATERGIS.WORDPRESS.COM/2012/04
/08/WATERSHEDDELINEATIONUSINGARCGISMODELBUILDER/#COMMENTS)
InpreviouspostswetookanoverviewofgeoprocessinginArcGIS(https://watergis.wordpress.com
/2012/03/17/geoprocessinginarcgis/)andwediscussedaboutdelimitingwatershedsusingtheHydrology
tools(https://watergis.wordpress.com/2012/03/23/watersheddelineationusingarcgishydrologytools/)of
theArcGISSpatialAnalysttoolset.NowwearegoingtoautomatethistaskbyusingModelBuilder.
WewillcreateanautomatedprocesstodelimitatewatershedsfromaDigitalElevationModel.Inthis
example,IwillbeusingasaninputthesameDEMastheWatersheddelineationusingArcGISHydrology
tools.
1.IntheArcMap10Catalogwindow,webrowsetoToolboxes>MyToolboxes.Rightclick
onMyToolboxesandselectNew>Toolbox,toaddanewtoolboxtowhichwegivethenameof
ModelWatershed.
(https://watergis.files.wordpress.com/2012/04/catalog_window.jpg)
RightclickonModelWatershedtoolbox>New>ModelThispromptstheModelBuilderwindow.
(https://watergis.files.wordpress.com/2012/04/model_builder.jpg)
2.RightclickontheModelBuilderwindow>CreateVariableInthelist,weselectRasterLayer.A
blankovalisthenaddedtotheModelBuilderwindow.
(https://watergis.files.wordpress.com/2012/04/raster_layer.jpg)
3.IntheCatalogwindow,webrowsetoSystemToolboxes>SpatialAnalystTools>HydrologyDragand
droptheFill,FlowDirection,FlowAccumulation,StreamLinkandWatershedtoolstothe
ModelBuilderwindow.
Next,gotoSystemToolboxes>DataManagementtools>FeatureanddragFeatureVerticesToPoints
tooltotheModelBuilderwindow.
Finally,gotoSystemToolboxes>SpatialAnalystTools>MapAlgebraanddragRasterCalculator
tool(Mapalgebra).
(https://watergis.files.wordpress.com/2012/04/model_blank.jpg)
4.IntheModelBuilderwindowstandardtoolbar,selecttheConnecttoolandlinkthepreviously
addedtools.Theresultwilllooklikethis:
(https://watergis.files.wordpress.com/2012/04/model_connect.jpg)
5.Rightclickoneachoftheinputsandoutputs(blankovals),selecttheoptionsModelParameterand
AddToDisplay.Theresultisshowninthefigurebelow:
Asyoucansee,aPappearsnexttoeachinputandoutput,indicatingthattheyareparameters.
(https://watergis.files.wordpress.com/2012/04/model_parameters.jpg)
6.RightclickonRasterLayer(thevariablewecreatedinstep2),selectOpenAwindowpromptsin
whichwehavetoselecttheDEMwewanttouseasaninput.OnceselectedtheinputDEMyoucansee
howsomeofthetoolsgetactivatedbychangingtheircolorasshownbelow:
(https://watergis.files.wordpress.com/2012/04/dem.jpg)
(https://watergis.files.wordpress.com/2012/04/model_2.jpg)
7.RightclickonRasterCalculator,selectOpenAwindowwillappearinwhichwemustspecifythe
minimumsizeofthecellscoveringthewatershed.Inthiscasewewritethefollowingexpression:Con
(%Outputaccumulationraster%>20000,1).Inthiscase,Outputaccumulationrasteristheoutputof
theFlowAccumulationtooland20000istheminimumsizeinpixelsforagivenwatershed.Inthis
example,thepixelsizeoftheDEMis55msotheminimumsurfaceoftheresultingwatershedswillbe
100,000m2(thisprocedureavoidthecreationofmicrobasins).
(https://watergis.files.wordpress.com/2012/04/map_algebra.jpg)
TheModelBuilderwindowwilllooklikethis:
(https://watergis.files.wordpress.com/2012/04/model_3.jpg)
8.RightclickonFeatureVerticesToPoints,selectOpenInthefieldPointType(optional)we
specifyEND.
(https://watergis.files.wordpress.com/2012/04/vertice_point.jpg)
9.Wehavetoindicatethepathinwhichtheoutputswillbestored.
RightclickonFilltool,selectPropertiesIntheEnvironmentstab,activateWorkspaceandclick
onValues.WemustfilltheCurrentWorkpaceandScratchWorkspacewiththelocationofthe
folderwhereyouwanttosavetheoutputs.
(https://watergis.files.wordpress.com/2012/04/env_settings.jpg)
10.Finally,werunourmodelbyclickingontheRuntoolofthestandardtoolbar.Afterafewminutes,
thisisthefinalresult:
(https://watergis.files.wordpress.com/2012/04/watersheds.jpg)
Themainadvantageofthismodelisthatwecanrunitasmanytimesaswewantusingdierentdatasets.
Additionally,ModelBuilderallowsyoutoexportanymodeltoPythoncode,whereyoucanrefineyour
modelbyaddingadvancedconditionalanditerativelogic.Wewillseeinlaterpostshowtodothis.
FILEDUNDERSPATIALANALYSIS
MARCH23,2012 7COMMENTS(HTTPS://WATERGIS.WORDPRESS.COM/2012/03
/23/WATERSHEDDELINEATIONUSINGARCGISHYDROLOGYTOOLS/#COMMENTS)
Therequireddataforthistutorialisa55mcellsizeDigitalElevationModel(DEM)obtainedfromthe
NationalAerialOrthoimageryDataset(PNOA(http://centrodedescargas.cnig.es/CentroDescargas/)).The
studyareaisfromasmalltorrentialbasininthecentralPyrenees(Arasravine),wellknownforaflash
floodevent(http://www.sciencedirect.com/science/article/pii/S0013795298000763)thatwipedouta
campsiteon7thAugust,1996claimingthelivesof87people.
(https://watergis.files.wordpress.com/2012/03/dem.jpg)
First,intheArcToolboxwindowexpandSpatialAnalystTools>Hydrology.
(https://watergis.files.wordpress.com/2012/03/hydrology.jpg)
1.FillsinksintheDigitalElevationModel:Westartbyremovingsmallimperfectionsinthedigital
elevationmodelusingtheFilltool.OpentheFilltool.SettheinputsurfacetotheDigitalElevationModel
(DEM)ofthestudyarea.
(https://watergis.files.wordpress.com/2012/03/fill.jpg)
ItisimportanttobuildadepressionlessDEMforallsubsequenthydrologicalanalyses.Areasofinternal
drainagecancauseproblemslaterinthewatersheddelineationprocess.
2.FlowDirection:Directionofflowmustbeknownforeachcell,becauseitisdirectionofflowthat
determinestheultimatedestinationofwaterflowingacrossthesurface.ThenumbersintheFlow
Directionlayershowflowdirectionfromeachcelltoitssteepestdownslopeneighbor.
(https://watergis.files.wordpress.com/2012/03/fdir.jpg)
3.FlowAccumulation:Thistoolcalculatestheflowintoeachcellbyaccumulatingthecellsthatflowinto
eachdownslopecell.IntheFlowAccumulationlayereachcellcontainsavaluerepresentingthenumber
ofcellsupstreamfromthatcell.Cellswithhighervalueswilltendtobelocatedindrainagechannels
ratherthanonhillsidesorridges.Wewillsymbolizetheflowaccumulationlayertomakethese
dierencesclear.
(https://watergis.files.wordpress.com/2012/03/facc.jpg)
4.CreateWatershedPourPoints:InArcCatalogwewillcreateanewemptyshapefiletostorethenew
pourpoint.WedelineatethepourpointatthewatershedoutletusingtheEditortoolbar.Everything
upstreamfromthepourpointwilldefineasinglewatershed.
(https://watergis.files.wordpress.com/2012/03/ppoint.jpg)
5.SnapPourPoint:WewillusetheSnapPourPointtooltoensureyourourpointislocatedonthe
highestflowaccumulationcellwithinaspecifiedradius.Wesetthesnapdistanceat100meters.The
SnapPourPointtoolalsoconvertsthepourpointintotherasterformatneededlaterinthewatershed
delineationstep.
(https://watergis.files.wordpress.com/2012/03/snap_pp.jpg)
6.Delineatewatershed:Inthisfinalstep,weselecttheflowdirectiongridastheinputflowdirection
raster,andtherasterversionofthepourpointastheinputpourpointdata.Finally,weselectanoutput
rasterpathname.Thenewwatershedrasterwillbeaddedtothemap.
(https://watergis.files.wordpress.com/2012/03/watershed.jpg)
Forareacalculationsandforlaterusetoclipotherdatasets,weconvertthewatershedrastertoapolygon
usingtheConversionToolsoftheArcToolbox(ArcToolbox>ConversionTools>FromRaster>Rasterto
Polygon).
(https://watergis.files.wordpress.com/2012/03/orthoimage.jpg)
Thisisallfornow.InlaterpostsIwillshowyouhowtoautomatethisprocessusingModelBuilderand
Pythonscripting.
FILEDUNDERSPATIALANALYSIS
MARCH17,2012 3COMMENTS(HTTPS://WATERGIS.WORDPRESS.COM/2012/03
/17/GEOPROCESSINGINARCGIS/#COMMENTS)
What is geoprocessing?
GeoprocessingisforeveryonethatusesArcGIS.Whetheryoureanewuseroranoldpro,geoprocessing
willbecomeanessentialpartofyourdaytodayworkwithArcGIS.
ThefundamentalpurposeofgeoprocessingistoallowyoutoautomateyourGIStasks.Almostallusesof
GISinvolvetherepetitionofwork,andthiscreatestheneedformethodstoautomate,document,and
sharemultiplestepproceduresknownasworkflows.Geoprocessingsupportstheautomationof
workflowsbyprovidingarichsetoftoolsandamechanismtocombineaseriesoftoolsinasequenceof
operationsusingmodelsandscripts.
Thekindsoftaskstobeautomatedcanbemundaneforexample,towrangleherdsofdatafromone
formattoanother.Orthetaskscanbequitecreative,usingasequenceofoperationstomodelandanalyze
complexspatialrelationshipsforexample,calculatingoptimumpathsthroughatransportationnetwork,
predictingthepathofwildfire,analyzingandfindingpatternsincrimelocations,predictingwhichareas
arepronetolandslides,orpredictingfloodingeectsofastormevent.
Geoprocessingisbasedonaframeworkofdatatransformation.Atypicalgeoprocessingtoolperformsan
operationonanArcGISdataset(suchasafeatureclass,raster,ortable)andproducesanewdatasetas
theresultofthetool.Eachgeoprocessingtoolperformsasmallyetessentialoperationongeographicdata,
suchasprojectingadatasetfromonemapprojectiontoanother,addingafieldtoatable,orcreatinga
buerzonearoundfeatures.ArcGISincludeshundredsofsuchgeoprocessingtools.
(https://watergis.files.wordpress.com/2012/03/workflow.jpg)
Geoprocessingallowsyoutochaintogethersequencesoftools,feedingtheoutputofonetoolinto
another.Youcanusethisabilitytocomposeaninfiniteofgeoprocessingmodels(toolsequences)thathelp
youautomateyourworkandsolvecomplexproblems.
Geoprocessingtoolsperformsmallyetessentialoperationsongeographicdata,suchasextractingand
overlayingdata;changingmapprojections;addingacolumntoatable;andcalculatingattributevalues,
polygonoverlays,andoptimalroutes,tonameafew.Therearehundredsoftoolsatyourdisposal,and
youcancreateyourowntoolsusingModelBuilder,avisualprogramminglanguage,orscripting,a
textbasedprogramminglanguage.
Toolsarestoredintoolboxes.ArcGISshipswithhundredsoftoolsorganizedintoadozenorsotoolboxes,
providingarichsetoffunctionalityacrossawiderangeofdisciplines.
Toexecuteatool,youmustfirstfindit.Therearefourwaystofindatool:
1.AhandfulofcommonlyusedtoolscanbefoundintheGeoprocessingmenufoundon
theStandardtoolbar.YoucancustomizethislistusingCustomize>Customizemode.
2.SearchforatoolintheSearchwindow.Searchallowsyoutoenterkeywords,shortphrasesthat
describewhatthetooldoes.
3.BrowseforatoolintheCatalogwindow.Browserequiresyouknowwhichtoolboxcontainsthetool.
4.BrowseforatoolintheArcToolboxwindow.TheArcToolboxwindow,liketheCatalogwindow,
displaystoolboxesandtoolsasatreeview.Youcanaddyourcustomtoolboxesto
theArcToolboxwindow.
ThemostcommonlyusedGIStoolsautomatetasksthatwerehistoricallydonemanuallycompilingnew
mapsbyoverlayingoneontopoftheotherorphysicallycuttingmapsintopiecesrepresentingspecific
studyareas,thenchangingtheirprojection.Someofthesemanualtasksweresoarduousandcomplex
thattheyheldbackthedisseminationofgeographicknowledgeanddataandweretheprimaryimpetus
behindtheinventionofGIS.
Thefirsttwosetsofcommonlyusedtoolsanswertwoofthemostbasicquestionsingeography:Whats
ontopofwhat?andWhatsnearwhat?
Surfaces
Geographicphenomenaarenotlimitedtodiscretepoints,lines,andpolygonsbutincludedata,suchas
elevation,slope,rainfall,andtemperature,thatvariescontinuouslyacrosstheearthssurface(orwhatever
planetorobjectyourestudying).Suchcontinuousdataiscalledasurfaceandismodeledwithrastersand
TINs.
Oneoftheaxiomsofgeographyisthatthingsthatareclosetogetheraremoresimilarthanthingsthatare
fartherapart.Thisaxiomformsthebasisofpowerfulspatialstatisticstoolsthatallowyoutodiscoverand
characterizegeographicpatterns.
Table management
ArcGISstoresdataineasilyaccessibletables,andthemajorityofworkflowsinvolvesomesortoftable
management,suchasaddingordeletingfields,creatingrelationshipsbetweentables,orcreatingfeatures
fromcolumnscontainingcoordinates.
GISdatasetsoftencontainmuchmoredatathanyouneed,andacommonsetoftasksistoreduceor
extractdatafromlarger,morecomplexdatasets.
Geoprocessingallowsyoutochaintogetherasequenceoftools,feedingtheoutputofonetoolinto
another.Youuseageoprocessingmodeltochaintoolstogether,andModelBuilder,shownbelow,ishow
youcreatemodels.
(https://watergis.files.wordpress.com/2012/03/modelbuilder.jpg)
Pythonisafree,crossplatform,opensourceprogramminglanguagethatisfast,powerful,andeasyto
learn.Pythonisconsideredascripting(orinterpretive)language,sinceitdoesnotrequireacompiler.
ProgramsthatyouwritewithPythonarecalledscripts.Thereareotherscriptinglanguagesbesides
Python,butESRIhaschosenPythonasitspreferredscriptinglanguagebecauseofitspowerandwide
acceptance.
PythonisautomaticallyinstalledwhenyouinstallArcGIS.Allgeoprocessingtools,aswellasawide
varietyofusefulfunctionsforinterrogatingGISdata,areavailableintheArcPysitepackage.A
sitepackageisPythonstermforalibrarythataddsadditionalfunctionstoPython,andtheArcPy
sitepackageishowGISfunctionsareaddedtoPython.TheArcPysitepackageisinstalledwithArcGIS.
UsingPythonandtheArcPysitepackage,youcandevelopaninfinitenumberofusefulprogramsthat
operateongeographicdata.
TherearethreebasicwaysyoucanrunPythoncodeinArcGIS:
1.YoucanexecutePythoncodeinteractivelyinthePythonwindow,openedwith
thePythonwindowbuttonorbyclickingGeoprocessing>Python.ThePythonwindowisan
interactivewindowthatletsyouenterPythoncode,executeitimmediately,andviewtheresultsin
youractivemap.
2.YoucanexecuteaPythonscript(afilewiththe.pyextension)fromtheoperatingsystemprompt.
Sinceyouexecutethescriptfromtheoperatingsystemprompt,youdonothavetohaveanArcGIS
applicationrunning(suchasArcMap).Scriptsthatareexecutedfromtheoperatingsystempromptare
referredtoasstandalonescripts.
3.YoucancreateyourowngeoprocessingtoolthatexecutesaPythonscript.Atoolthatexecutesascript
iscalledascripttool,andyoucanuseascripttoollikeanyothergeoprocessingtool,embeddingitin
modelsorusingitinotherscripts.ScripttoolsarenotlimitedtoPythonscriptsyoucancreatea
scripttoolthatexecutesanything,suchasaJavaScript,AML,.bat,or.exe.
(https://watergis.files.wordpress.com/2012/03/python.jpg)
FILEDUNDERSPATIALANALYSIS
GISforWaterandEnvironmentalManagement
CreateafreewebsiteorblogatWordPress.com.TheEnterpriseTheme.