Académique Documents
Professionnel Documents
Culture Documents
TheAttributeTable
OnetypeofdatainGeographicInformationSystem(GIS)istheattributedata.Theattribute
dataisthestoragefacilityofinformationforacertainfeatureinafeatureclassorshapefile.Itis
anonspatialdata.Thewaythattheattributedataisactuallypresentedandorganizediswhat
wecalledtheattributetable.Theattributetableishowtheinformationaboutthefeaturesin
yourshapefileorfeatureclassispresentedtotheGISuser.ForaGIStobemoreuseful,a
featurewithinafeatureclasshastocontainenoughinformationforittobeprocessed.
ExploreAttributeTableinArcMap
Toopentheattributetableofafeatureclass,rightclickonthelayernameclickonAttribute
Table.ThedockableTablewindowisdisplayed.Thetermdockablemeanthatyoucan
placethewindowintoastationarylocationwithinArcMap.InFigure31,showsoneofthe
signsthatwillappearwhenyoutrytomovethewindow,thesearevaliddockingarea.
Figure 3-1
Wheneveryouputthedraggingcursorofthewindowintooneofthisdockinglocationand
releaseit,thewindowwillfillaportionintheArcMap.Bydefaultthewindowwillalwaysbe
shown,butifyouwouldliketohidethewindowautomaticallywheneveritisoutoffocus,just
clickthethumbtackicontoautohideit ,andtosetitbacktokeepshown,justclick
thethumbtackbutton .
FromtheTablewindow,youcanobservethatthedataisdisplayedinagridtypeformation,
muchlikeaspreadsheetapplication.Thetableiscomposedofrowsandcolumns.Thecolumns
containlabelswhichrelatetotherowsbelowit.Therowontheotherhand,containsthe
individualdataandeachdatamayormaynotrelatetofeatureinthefeatureclassorshapefile.
AFieldissimplytheareainthetablewherelabelsareplaced;simplyitisthecolumnpart.The
Recordistherowofthetablewhereindividualdataisstored.Figure32showsthelocationof
theseFieldsandRecords.
31
Records
Fields
Figure 3-2
AddinganddeletingFieldinAttributeTable
GotothetopleftcorneroftheTablewindow,andclickonTable Options dropdown
button.Toaddacolumn/field,selectAdd Field.
Note:Youcannotbeinanothereditingsessionwheneditingtheattribute
table;forinstance,ifArcCatalogisopen,youwillgetanerrormessage.
OnceyouselectAdd Field,anewwindowwillappearwhichallowsyoutoenterthefields
Name andType.TheNameofthefieldthatyouwillchoosehastobeanyvalidname,this
meanthatyouhavetofollowtheprogrammingconventiononvariabledeclarations.Ifyoure
notfamiliarwiththat,letmegiveyouasimpleidea,invalidnameisanamethatcontains
numericalvaluesbeforeanyalphabets,whitespacecharacter,arithmeticoperators(+,,*,/,
^),logicaloperators(i.e.%,&,|,<,>),andspecialcharacters(!,@,#,$,(,),~,:,;,,,?).Click
OK ifyouthinkthatwhatyouhaveinputtedisalreadyappropriate.Wheneveryouprovidedan
invalidname,ArcMapwillpromptanerrordialogboxandwillsuggestareplacement.After
everythingwillbeok,anewfieldwillappearinyourattributetable.Youcandeletethisfieldby
rightclickingonthename,andselectingDelete Field.
Sorting,summarize,andothermanipulationsinAttributeTable
Ifyourightclickonanycolumnname(orclickonthetopofthecolumn),youcansortbythat
variable(inascendingordescendingorder).Additionally,youcangeneratesummarystatistics
aboutthatvariable,findoutitsproperties,ordobasicarithmeticcalculations.Forinstance,you
cancreateanewfieldandthen,usingtheField Calculator tool,assignthevaluesofthis
variabletobethesumoftwopreviouslyspecifiedvariables.Youcanalsocalculatethe
geometryoffeatures,includingtheirarea,perimeter,XandYcoordinatesofcentroid(whichare
thex,ycoordinatesatthegeometriccenterofthefeature).
32
AddingDatatoaMap:JoinsandRelates
Whenyoudownloadashapefileorafeaturefile,theonlyinformationitwillcontainis
geographicinnature.Associalscientists,weareofteninterestedinhowsocial,political,and
economicvariablesmapontothesegeographicfeatures.Inotherwords,theinformation
containedintheshapefilealoneisnotextremelyhelpfulinansweringsocialscienceresearch
questions.Inordertoanswerquestionsofgreatersubstantiveinterest,youneedtomergeyour
ownspatiallylocateddatatabletotheappropriatespatialdatainArcMap.
Toconnectyourowndatatablewithalayerattributetable,youcanuseatablejoinorrelate.A
joinappendstheattributesofthenonspatialtabletothelayerattributetable,makingonebig
table.Arelatekeepsthetwotablesseparatebutlinked,sothatrecordselectionsinonetable
causecorrespondingselectionsinanother.Yourdatashouldbesavedasacommaseparated
valuesorcsvfile(filethathasanextensionofcsv).Whetheryouchoosetojoinorrelateatable
dependsontherelationshipbetweenthetwotables.Jointhetableswhenthereisa1:1
relationshipbetweenrecordsinthespatialandnonspatialtables.Relatetableswheneach
recordinthelayerattributetablehasmorethanonematchinthenonspatialtable.Inorderto
useeitherajoinorrelate,theremustbesomewaytomatchrecordsinthetwotables,whichis
theremustbeonegeographicvariableineachofthetwodatatablesthatisidenticalfor
observationsthataregoingtobejoinedorrelated.Iftherearemoreobservationsinthe.csv
thanintheshapefile,onlythoseobservationsthatmatchwithobservationsinthe
shapefile/featurefilewillbejoined.
Example:JoiningTables
YouwillmostlikelywanttojoinyourdatawiththespatialdatainArcMap.Ourexamplejoins
U.S.statespatialdatafromtheNationalHistoricGISwebsite(www.nhgis.org)toacsvfile
containingdataonstatepopulation.Figure33showstheattributetableoftheU.S.state
shapefile.
Figure 3-3
33
Figure34isascreenshotofthecsvcontainingthepopulationdata(thatis,aseparatefilefrom
theshapefile):
Figure 3-4
NoticethatbothtablescontainthefieldGISJOIN.Thisisauniquevariable/fieldthatidentifies
eachstateidentically,andcanbeusedtomatchrecordsforbothtablesforourspatialjoin.
(Note:theuniquevariable/fieldcouldbedifferentineachtableGISJOINandSTATE_CODE).
Tojointables,completethefollowingsteps:
1.Rightclickonthespatiallayername.
2.ClickJ oins and Relates,andthenselectJ oin(asshowninFigure35).
Figure 3-5
34
Figure 3-6
3.Under1. Choose the field in this layer that the join will be based on:,selectthename
ofthevariablethatcontainsvaluesthatarethesameforboththespatialandyourdatasets.In
thiscase,thevariableisGISJ OIN.
4.Under2. Choose the table to join to this layer, or load the table from the disk:,select
the.csvfilecontainingthedatathatyouaremergingintothespatialdata.(Here,
population.csv)
5.Under3. Choose the field in the table to base the join on:,selectthevariablenamein
yourdatasetthatisidenticaltotheoneinthespatialdataset.Again,thisisGISJOIN,though
thenamesoftheuniqueindicatorvariablesmaybedifferentinthetwotables.
6.ClickOK.Itmaytakeaminuteorsotoprocess,particularlyifyouarejoininglargefiles.
35
7.Whentheprogramisdoneprocessingthejoin,opentheattributetable.Scrolltotherightto
seeallthefields.Makesurethatallthedatafromyour.csvfilehasbeenaddedtotheattribute
table(asshowninFigure37.
Figure 3-7
Noticethatthetwotableshavenowbeenmerged,includingredundantvariables.Youwillnow
havetwoGISJOINvariables,whichshouldcontainidenticalobservations.ThePopulation
variable,whichisthesubstantivevariableofinterest,hasalsobeenaddedtotheattribute
table.
SQLQuery
Sincetheattributetableisconceptuallystructuredlikeadatabase,thereforeitwouldalsobe
appropriateforittobetreatedassuch.Commonly,adatabasehasitsownlanguagein
accessingitscontent.Thisaccessingtermisusuallycalledquery.Asyouinquiredatafromthe
database,thebestwaytodoitistomakeuseofanearlycommonEnglishquerylanguage
whichiscommonlycalledStructuredQueryLanguage(SQL).Unliketheusualprogramming
language,SQLcanbemoreunderstandableandobvious.But,becauseitisrunningina
computer,ofcourseithastofollowitsrules,anditsproperconstructionorsyntax.Syntaxisthe
properarrangementofcorrectkeywordsforacertainprogramminglanguageorinthiscasethe
SQL.Fortunatelyforus,ArcInfocanbefriendlierintermsofSQLbecauseitcanshortenthe
detailrequirementsofaSQLquerystatement.
LetushaveanexampleofasimpleselectionoflocationusingtheArcMap.Asyoucanrecallin
ourexerciseusingthemapofphilshapefile,theattributetablecontainthedataofprovinces,
regions,andthepopulation.Ifwecarefullystudytheattributetable,wecanassumethatthe
populationisdirectlyrelatedtotheprovince.Itsignifiesthatthecollectionofthepopulation
wasbasedontheindividualprovinceratherthantheregion.Now,letusselectalocationonthe
36
mapbyaspecifyingaprovince.TodothatyouhavetomakeuseoftheSelectByAttributes
selectiontool(asshowinFigure38).
Figure 3-8
ASelectByAttributesdialogboxwillthenbedisplayed.PortionoftheSQLstatementhasbeen
alreadyprovidedbythedialogbox(refertoFigure39).
AfterwhichwearetheonewhowillprovidetheWHEREstatement(whichisinprogramminga
kindofcondition).Therefore,wehavetomakesurethatontheLayerdropdownboxisthe
layerthatwewanttohaveourquery.TheSelectByAttributesdialogboxwilldisplaythefields
containedintheselectedlayer.DoubleclickonthePROVINCEtextdisplayedonthelistbox,
andthenclickontheequalsignbutton .ClickontheGetUniqueValuesbutton
toloadalluniquevaluesstoredintheattributetableunderthePROVINCE
field.Fromthelistofuniquevalues,scrolldownandlocateCebu.Onceyouareabletolocate
itdoubleclickonCebu.Asyoucanseethetextboxatthebottompartofthedialogbox
constructedalineofquerystatementwhichcontinuedtheSELECTstatement.Thestatement
appearedonthetextboxis"PROVINCE"='Cebu'.UponclickingtheOKbutton,youwillbeable
toseethattheentireprovinceofCebuhasbeenhighlighted.Withthisselectionactive,youcan
zoomtotheselectedfeaturebyclickingonSelection>ZoomToSelectedFeatures.Bynowyou
37
maywanttoremovetheselection.Inremovinganyselectedfeaturesonalayer,justclickthe
ClearSelectedFeaturesbutton .
TheSQLstatementcanbeaveryusefultoolthatanyGISusersshouldneed.Obtainingthe
knowledgeinqueryingdatawillallowyoutoutilizevastamountoftoolsmadeavailabletousin
ArcInfo10.WhatwehavesofarobtainedasfarasSQLqueryisconcern,isjusttheselectionof
afeaturewithinafeatureclass.But,usingtheSQLquerystatementcanallowyoutoprocess
datatoansweryoureveryquestiononyoureverygeoprocessingneeds.
38
GISLaboratoryExercise3WorkingwithTables
Objectives:
Inthisexercise,youwill:
- Add,delete,andsortingafieldintheattributetable
- Selectingsomerecords
- Sortanattributetableonmultiplefields
- Adddatatoamapusingjoinorrelates
- Createagraphfromanattributetable
Addingafield
o StartArcMapandopenCebuCity_Pop.mdxfromyour..\LearnGIS2\WorkingWithTables
folder.
o SaveyourmapasmyCebuCity_Poptoyour..\myGISOutputsfolder.
o RightclickBrgysOfCebuCitylayerandclickOpenAttributeTable.
o Dockthetablewindowatthebottomoftheapplicationwindow.
o Scrolldownthroughtherecordsandthenbackup.
1. Howmanyrecordsareintheattributetable?Fields?
Records:________________
Fields:__________________
o Gotothetopleftcornerofthetablewindow,andclickonTableOptions .
o SelectAddField.
o TheAddFielddialogboxwillappear.
o InputthefollowinginformationintheAddFielddialogbox:
Name:Brgy_Code
Type:Text
39
Alias:BarangayCode
o Verifyyourinputswiththefollowinggraphic.
o ClickOK.
2. Whatisthedefaultvaluethatappearedineachrowsunderthenewaddedfield?
_______________________________
Deleteandhidingafield
SinceCebuCitydoesntspecificallyrequireacapitalbarangay,thereforewecandeletethe
Capitalfield.
o DeletetheCapitalfield,rightclickontheCapitalfieldnameandclickDeleteFieldfrom
thepopupmenu.
o TheConfirmDeleteFielddialogboxwillappearasawarning,chooseYes.
o DeletetheMUNIPOLSlayeraswell.
YoumayalsobeableturnoffafieldthatismakingalayerinvisiblefromtheAttributeTable.
o RightclickonthenameofthePOLYIDlayerandchooseTurnFieldOff.
3. DescribethedifferencebetweenDeleteFieldandTurnFieldOff.
________________________________________________________________________
________________________________________________________________________
Sortingafieldandselectingsomerecords
310
ItisalsonecessaryfortheGISusertosortthedatainorderperhapstogettherankingorto
checkitscompleteness.
o RightclickAREAfieldandselectSortAscending.
4. WhatbarangayinCebuCitythathasthelargestandsmallestlandareaandhowmuch:
a. Thelargest:_____________________________
b. Thesmallest:_____________________________
o ClickthegrayboxontheleftmostsideofSubarecordasshownbelow.
o HolddowntheCtrlkeyonyourkeyboardandselectPasilandParianrecord.
o ClicktheShowselectedrecordsbutton .
5. DescribewhathappenedaftertheShowselectedrecordsbuttonwasclicked?
________________________________________________________________________
o ClickShowallrecordsbutton .
o Atthetopofthetablewindow,clickClearSelectionbutton .
Sortinganattributetableonmultiplefields
Sortingasinglefieldmightnotbeenoughtorankthewholetable.Anorderofselectedfields
mightbenecessarytorankitaccordingtotherequiredcategories.Therefore,selectingthe
appropriatefieldsisnecessarytofulfilalltherequirements.
o RightclickontheBRGYPOLSfieldheadingandchooseAdvancedSorting.
311
o OntheAdvancedTableSortingdialogbox,setthefirstdropdownlist(Sortby)to
BRGYPOLS.LeavetheoptionontherightsettoAscending.
o Settheseconddropdownlist(Thensortby)toAREA.Leavetheoptionsetto
Ascending.
o Setthethirddropdownlist(Thensortby)toCOASTAL.Leavetheoptionsetto
Ascending.
o ClickOK.
6. Describewhathappenedtotheattributetable.
________________________________________________________________________
________________________________________________________________________
Fromthepreviousstepwevedonerelatingtoaddingafieldintoourtablewhichisthe
Brgy_Code,thistimewearegoingplacecontentsintothatfield.
o RightclickontheBarangayCodefieldfromBrgysOfCebuCitytableandselectField
Calculator.
o BelowtheType:label,selectString.
o FromthelistofFunctions:,clickUCase().Note:UCase()isafunctionthatwillconvert
anylowercasetextintouppercase(ie.Allincapitalletters).
o FromthelistofFields:,doubleclickonBRGYPOLS.
o VerifythatthetextjustbelowBrgy_Code=isUCase([BRGYPOLS]),thenclickOK.
o Saveyourmap.
Addingdataintotheexistingattributetable
Therearesituationsinwhichthedatathatwehaveimbeddedintoourfeatureclassor
shapefilemightnotbeenoughtoprocessthenecessaryinformationweneed.Therefore,we
needtocollectoracquireadditionaldatainordertocompletewhatarenecessary.Wemight
312
thinkthatwehavetomanuallyencodeeverydataintoourexistingattributetableto
accomplishthis.Fortunately,ESRIArcInfo10provideduswiththecapabilitytolinktoan
externaldatabymeansofJoinorRelatetables.OuravailableBrgyOfCebuCitydoesntcontain
anyinformationregardingpopulation.But,wearesofortunatethatwehaveanexcelfile
availablethatcontainsomerecordedpopulationofallbarangaysinCebuCity.
o FromtheCatalog,expandCebuCity_PopsanddragdropCebuCityPopulation$.
ThetableofcontentsautomaticallychangedthemodefromListByDrawingOrdertoListBy
Source.Thereasonforthat,isbecauseCebuCityPopulation$isanelement(actuallya
worksheet)withintheCebuCity_Popsexcelfile.
o ChangethemodeofthetableofcontentsbacktoListByDrawingOrder.
7. CanyouseetheCebuCityPopulation$attributetable?Why?
________________________________________________________________________
________________________________________________________________________
o ChangebacktoListBySource,toviewtheCebuCityPopulation$onceagain.
o RightclickonCebuCityPopulation$andonthepopupmenuclickOpen.
8. ListdownthefieldsintheCebuCityPopulation$table.
________________________________________________________________________
o NowexaminetheBrgysOfCebuCityattributetableandcompareitwiththeCebuCity
Population$attributetable.Youcanexaminebothtablesbysettingthearrangementof
openedtables(Hint:ClickonTableOptions,selectArrangeTables,andclickNewVertical
TabGroup).
9. Whatisthecommonfieldthatyoucanassociatewiththesetwotables?
________________________________________________________________________
o Inthetableofcontents,rightclickontheBrgysOfCebuCitylayer,pointtoJoinsand
Relates,andchooseJoin.
313
o IntheJoinDatadialogbox,makesurethefirstdropdownlistissettoJoinattributes
fromatable.
o Under1.Choosethefieldinthislayerthatthejoinwillbebasedon:,chooseBarangay
Code.
o Under2.Choosethetabletojointothislayer,orloadthetablefromdisk:,confirm
thatCebuCityPopulation$isselected.
o Under3.Choosethefieldinthetabletobasethejoinon:,selectBrgy_Code.
o UnderJoinOptionsgroupbox,besurethatKeepAllRecordsisthecurrentselection.
o Confirmyourinputsonthefollowinggraphic.
o ClickOK.
o IntheTablewindow,closetheCebuCityPopulation$table.
o ScrollthroughtheBrgysOfCebuCityattributetable.
o TotherightoftheShape_Area,allthefieldsfromtheCebuCityPopulation$tablehave
beenappended.
314
o Hidethefollowingfields:
LGU
BARANGAY
Brgy_Code
o Saveyourmap.
MapinquiryusingSQL
Asidefromsortingthetabletorankthedataintheattributetable,theotherwaytoobtainany
requiredinformationisbyusingtheSQLquerystatement.
o ScrolltheBrgysOfCebuCityattributetabletotherightuntilyouseethePopulation_1960
field.
o SortthePopulation_1960fieldindescendingordersothatthehighestpopulationwill
beatthetop.Repeatthisfor1970,1980,1990,and2000.
10. Rankthetop5barangaysthathasthemostnumberofpopulationsin1960,1970,1980,
1990,and2000.
Rank\Year 1960 1970 1980 1990 2000
1Highest
2
3
4
5Lowest
o SelecttherecordforbarangayTalamban.Hint:Selectthegreyboxontheleftsideofthe
attributetabletoselecttheentirerow.
11. Describewhathappenedtothemap.
________________________________________________________________________
12. DescribethepatternofpopulationforbarangayTalamban.
________________________________________________________________________
________________________________________________________________________
315
ThistimewillgoingtouseSQLtoselectafeatureonthemap.
o ClicktheClearSelectedFeaturefirst.
o ClickontheSelectionmenuandclickSelectByAttributes.
o OntheSelectByAttributesdialogbox,setthefollowing(besurethatthetextboxis
clear,tomakesureclicktheClearbutton:
Layer:BrgysOfCebuCity
LocateBrgysOfCebuCity.BRGYPOLS(doubleclickonitwhenfound).
Clickontheequalsignbutton.
ClickonGetUniqueValuesbutton.
Onthelistofuniquevalues:LocateTalamban(doubleclickonitwhenfound).
o BesurethatyourSelectByAttributesdialogboxinputswillbethesameasthe
following.
o ClickonVerifybutton,tocheckyourSQLstatementisvalid.Ifitsnot,checktheSQL
statementagain(clearitfirstbeforedoingthesameprocedureagain).
13. Describeyourobservation.
316
________________________________________________________________________
________________________________________________________________________
LetusgenerateaSQLstatementthewillselectthemostpopulousbarangayin1980.
o Ifacurrentselectionisactive,clicktheClearSelectedFeaturefirst.
o SortthePopulation_1980fieldindescendingorder.
14. Whatbarangayhasthehighestnumberofpopulationin1980andhowmuch?
________________________________________________
o OpentheSelectByAttributesdialogboxandinquireaselectionofthatbarangay.
15. WritedowntheSQLstatementgeneratedbyyourselection.
___________________________________________
Creatingagraph
Thistimewearegoingtocreateagraphofpopulationsfortheyear2000.
o ClickontheTableOptionsandclickCreateGraph.
o OntheCreateGraphWizarddialogbox,setthefollowing:
Graphtype:VerticalBar.
Layer/Table:BrgysOfCebuCity
Valuefield:Population_2000
Xfield(optional):BRGYPOLS>Ascending
Xlabelfield:BRGYPOLS
BesurethatAddtolegendischecked.
Color:Palette>Rainbow
o Clicknexttocontinue.
o SettheTitleasGraphofCebuCityBarangaysPopulationin2000.
317
o MakesurethattheGraphlegendischeckedandPositionitattheBottom.
o ClickFinish.
Thegraphwindowisnowdisplay.Stretchthewindowtohaveafullviewofthegraph.
o RightclickanywhereinsidethegraphwindowandclickonExport.
o OntheExportDialogwindow,selecttheFormatasPDFandclickSave.
o OntheSaveAsdialogbox,savethefileasGraphofCebuCityBarangaysPopulationin
2000on..\myGISOutputsfolder.
ChangethesymbologyofBrgysOfCebuCity
Thistime,letsmakeuseofthejoinedtablethatwehaveintermsofvisuallypresentingit
throughsymbology.
o OpentheBrgysOfCebuCitylayerproperties.
o ClicktheSymbologytabifnecessary.SettheShowtoQuantities>Dotdensity.Referto
thefollowinggraphic.
o OntheFieldSelectionlist,clickonPopulation_1990andclickthegreaterthanbutton
.
o SettheDotSizeto10andtheDotValueto100.RightclickontheColorRampand
unchecktheGraphicView.
o SelectCoefficientBiasfromthedropdownboxoftheColorRamp.
318
o FromtheSymbol|Fieldlist,doubleclickonPopulation_1990.FromtheSymbol
Selector,selectCircle2andclickOK.BesurethattheDotSizeis10andtheDotValueis
100.
o ClickOKtoconfirmyourinputsandclosetheLayerPropertiesdialogbox.
16. Listdownatmost5,thosebarangaysthathasamorecompactdots;dotsthatare
overlappingwitheachother.
________________________________________________________________________
17. Discussthereasonswhythesedotsareoverlappingwitheachother.
________________________________________________________________________
________________________________________________________________________
o Nowselectthefeaturethathasthehighestpopulationin1990.Hint:usetheSelectBy
Attributestool.
18. Doestheselectedfeaturecontainlotsofoverlappingdots?Explainwhy.
________________________________________________________________________
________________________________________________________________________
o Clearanyfeatureselection.
o AddafieldintotheBrgysOfCebuCityattributetableandnameitasPop1990Density.Set
theTypeasDoubleandclickOK.
o OpentheFieldCalculatorandonthelistoffields,doubleclick'CebuCity
Population$'.Population_1990,clickthe/button ,andfromthelistofFields
doubleclickBrgysOfCebuCity.AREA.
o Verifythatthecontentinthetextboxis['CebuCityPopulation$'.Population_1990]/
[BrgysOfCebuCity.AREA]andthenclickOK.
319
o SorttheBrgysOfCebuCity.Pop1990Densityindescendingorderandselectthetop5in
theattributetable.
19. Writedownthetop5barangaysyouhaveselected.Doesthesebarangaysincludedin
your#16answer?
________________________________________________________________________
________________________________________________________________________
Again,letschangethesymbologyandviewthetrendofpopulationchangesforeachbarangay.
o ClearanyselectedfeaturesandclosetheTablewindow.
o OpentheLayerPropertiesofBrgysOfCebuCityandclickonSymbologyifnecessary.
o BelowtheShowlabel,clickonChartsandselectBar/Column.ClickonPopulation_1960
intheFieldSelectionlistandpressshift.Withoutreleasingtheshiftkey,clickon
Population_2000thenclickthegreaterthanbutton .Makesurethatthe
arrangementoffieldsfromtoptobottomisfrom1960to2000.
o ClickOK.
20. Whichofthebarangaysthathas:(Hint:UsetheIdentifytoolandclickonthegraphs)
a. Significantincreaseinpopulation:________________________
b. Significantdecreaseinpopulation:________________________
c. Unusualfluctuationinpopulation:_______________________
o CloseTablewindow.
o SetthesymbologyofBrgysOfCebuCitylayerbacktoSingleSymbol.
320
o RightclickonBrgysOfCebuCitylayer,pointtoJoinsandRelates,pointtoRemoveJoin(s),
andclickCebuCityPopulation$.Note:Thiswillremovetheappendedfieldsofthenon
spatialdataCebuCityPopulation$.
o Toverify,opentheBrgysOfCebuCityattributetable.
o SaveyourmapdocumentandcloseArcMap.
Relatingtables
AnotherwayofconnectingdatafromonetabletoanotherisbymeansofRelate.Relateisa
waythatyoucanconnectarecordfromonetableintomultiplerelatedrecordsonanother
table.
o RunArcMapandopenUSARelate.mxdfrom..\LearnGIS2\WorkingWithTables2folder.
o InCatalog,locate..\LearnGIS2\WorkingWithTables2\USAgeodatabasefile.Rightclick
onitandclickMakeDefaultGeodatabase.
o SaveyourmapasMyUSARelatein..\myGISOutputs.
o OpentheAttributeTableoftheStateslayer.
o FromtheCatalogwindow,locateandrightclickCrimeData2005.csvandopenitsItem
Descriptionwindow.
o OntheItemDescriptionwindow,clickthePreviewtabifnecessary.
Thistablecontainthecompileddatafrommetropolitanpoliceandcountysheriffdepartments.
Onlythoseareasthathavepopulationsofover100,000wereincludedinthetable.
o ClosetheItemDescriptionwindow.
o FromtheCatalogwindow,dragdroptheCrimeData2005.csvtabletoyourmap.
o Opentheattributetableofthenewlyaddeddata.
o AsyouopentheCrimeData2005table,theexistingopenedStatestableisstillavailable.
But,inordertoviewityouhavetoswitchtabsbyselectingthetaboftheattributetable
asshowninthefollowinggraphic.
321
o Arrangethetablesidebyside.
21. Isthereafieldineachtablethatyoucanusetoassociatethetwotables?Ifthereis,
whatarethosetables?
________________________________________________________________________
o IntheCrimeData2005table,sorttheStateinascendingorder.
Asyoucansee,therearemultipleoccurrencesofasinglestateinthistable.TakeAlabama(AL)
forinstanceithasrecordsforBirmingham,Huntsville,JeffersonCounty,Mobile,and
Montgomerypolicedepartments(undertheAgencyfield).Therefore,ifyouapplyajoin
operationonthesetables,youwilllikelybeabletoconnectonlyoneofthemanypossible
connections.
Whenyoucarefullytakenotesoftherelationshipbetweenthestatesandthepolice
departments,youwilllikelytoconcludethattherelationshipisonetomany.Thatis,oneState
hasarelationshiptomanyAgencies.Conclusively,thetablesarerelated,thereforewehaveto
useRelate.
Relateisapplieddifferently.UnlikeJoin,aspecificfieldhastobeaddedinaRelateoperation,
andthathastobeObjectID.FromtheCrimeData2005table,itcontainsnoObjectID.But,ifyou
aregoingtoexportthistableintoanArcGISmanagedformat,anObjectIDwillbeautomatically
addedtothetable.
o MakesuretheCrimeData2005tableisselected,clickTableOptionsandselectExport.
o OntheExportDatadialogbox,acceptthedefaultsettingtoAllrecordsandsetthe
Outputtableto..\LearnGIS2\WorkingWithTables2\Tablesfolderandnameitas
CrimeData2005.MakesurethattheSaveastypeisdBaseTable.
o ClickSaveandclickOK.
o Whenpromptedtoaddthenewtabletothecurrentmap,justclickYes.
o ClosetheCrimeData2005.csvtableandremoveitfromyourmap.
322
o OpenthenewCrimeData2005tableandarrangetheStatesandtheCrimeData2005
sidebyside.
TheCrimeData2005containthesamedataastheCrimeData2005.csv,butanewfieldisbeing
addedwiththename,OID(asshownbelow).Also,thefieldnamesarebeingtruncatedto10
characterlimit.
o RightclickontheOIDfieldandselectProperties.
AlthoughthespecifiedfieldisObjectIDtorelatetables,butwhatappearedinCrimeData2005is
OID.CrimeData2005actuallyhasanObjectIDfieldtypeasshownbelow.
ThenameoftheObjectIDfieldmayvarywiththefileformat,forexample,indBaseitsOID,
butthefunctionisthesame.
o ClickCancelontheFieldPropertiesdialogbox.
o MakesuretheStatestableiscurrentlyselected.
o ClickTableOptionsandselectJoinsandRelates,andthenclickonRelate.
o IntheRelatedialogbox,set1.Choosethefieldinthislayerthattherelatewillbe
basedon:toSTATE_ABBR.(Note:Thisisthefieldthatiscommonforthelayerattribute
table(ie.Statelayer).)
323
o Setthe2.Choosethetableorlayertorelatetothislayer,orloadfromdisk:to
CrimeData2005.
o Forthe3
rd
dropdownlist,chooseState.(Note:Thisisthefieldthatiscommonforthe
nonspatialtable(ie.CrimeData2005.dbf).)
o VerifythatyourRelatedialogboxwillbethesameasbelow.
o JustacceptthedefaultrelatenameandClickOK.
Itseemsthatnothinghappened.But,therecordsofthetwotablesarenowlinked.
o IntheStatetable,sorttheSTATE_NAMEfieldinascendingorder.
o LocateandselecttheNewYorkrecord.
o ClicktheTableOptions,pointtoRelatedTables,andchooseRelate1:CrimeData2005.
TheCrimeData2005tableautomaticallyshowsallselectedrecordsonly.
22. Howmanyrecordshavebeenselected?_____________
o IntheCrimeData2005,scrolltotheViolent_crfieldandrightclickonit.Clickon
Statistics.
23. Howmuchisthetotalrecordedviolentcrime(Violent_cr)?____________
324
325
o Usingthesameproceduresyoulearned,answerthefollowinginquiry.
24. Howmuchisthetotalrecordedforciblerape(Forcible_r)inCalifornia?_____________
25. HowmuchisthetotalrecordedRobberycasesinHawaii?______________
Whydontwehaveasymbologyoperationinrelatedtables?Thatisbecauseunlikejoin,relate
tablesonlydefinesrelationshipsbetweentwotables.Thelinkeddataisnotappendedtothe
layersattributetablelikejoin.Therefore,therearenodatathatcanbeuseforsymbology.
Whatyoucandoisjusttoviewthedetailrecordsrelatedtorecordsinthelayersattribute
table.
o ClosetheTablewindow.
o IntheTableOfContents,rightclickonStateslayerandselectJoinsandRelates,pointto
RemoveRelate(s),andclickRelate1.
o SaveyourmapandcloseArcMap.
Preparedby:
Engr.JaniceB.Jamora,MEngandEngr.NoelT.Navasca,CompE
December2012
References:
1. ArcGISDesktopII:ToolandFunctionalitybyGEODATA,ESRI