Вы находитесь на странице: 1из 190

Geographic Information Systems: A Primer

D.E. Patterson Department of Geography and Environmental Studies Carleton University 2003

Preface
This do cument originates from a teaching m anual that is used for an introductory c ourse in Geographic Information Systems that I teach at Carleton University. The course is very hands on. I have found that students readily grasp theory and b ackground materials but often have difficulty in doing what they read a bout. For this reason, I will introduce the con cepts and g ive the practica l. Currently we use ArcView G IS produced by E SR I 1 and the dem onstrations are based upon this software. This docum ent appears in paper fo rm and is available in A dobe's 2 PDF format. I hope the various options will acco mmodate people with diffe rent learning styles.

ESRI, ArcView and Avenue are registered trademarks of Environmental systems Research Institute, Inc of Redlands California USA. For more information go to http://www.esri.com Adobe, and their PDF file format are registered trademarks of Adobe Systems Incorporated. For more information go to http://www.adobe.com

Table of contents
Chapter 1 GIS Background . . . . . . . . . . . . . . . 1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Spatial referencing . . . . . . . . . . . . . . . . . . . Geographic Coordinates (longitude-latitude) Datums and ellipsoids in common u se . . . . . UTM, MTM and related grid systems . . . . . . Cadastral . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other recognized referencing systems . . . . . Colloquial referencing . . . . . . . . . . . . . . . . . . 1.3 Representing features . . . . . . . . . . . . . . . . Vector data . . . . . . . . . . . . . . . . . . . . . . . . . . Ra ster (grid or im age) data . . . . . . . . . . . . . . Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4 Levels of measurement . . . . . . . . . . . . . . . 1.5 Op erations within a GIS . . . . . . . . . . . . . . . Pro cess-based G IS . . . . . . . . . . . . . . . . . . . . Chapter 2 The ArcView environment 2.1 ArcView organization . . . . . . . . . Starting ArcView . . . . . . . . . . . . . . Project . . . . . . . . . . . . . . . . . . . . . . Views . . . . . . . . . . . . . . . . . . . . . . . Tables . . . . . . . . . . . . . . . . . . . . . . Ch arts . . . . . . . . . . . . . . . . . . . . . . Layou ts . . . . . . . . . . . . . . . . . . . . . Scripts . . . . . . . . . . . . . . . . . . . . . . Extensions . . . . . . . . . . . . . . . . . . . 2.2 Data types supported by ArcView Vector data . . . . . . . . . . . . . . . . . . Ra ster data . . . . . . . . . . . . . . . . . . Tabular data . . . . . . . . . . . . . . . . . 2.3 Obtaining help in ArcView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...... 1 ...... 1 ...... 2 ...... 2 ...... 4 ...... 5 ...... 5 ...... 6 ...... 6 ...... 7 ...... 7 ...... 7 ...... 8 ...... 9 . . . . . 11 . . . . . 11 15 15 15 16 16 17 17 17 17 17 18 18 19 19 21 24 24 24 25 25 26 27 29 31 31 31 33

........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 3 Viewing spatial data in ArcView 3.1 Preliminary considerations . . . . . . . . . . File type and characteristics . . . . . . . . . . 3.2 Creating a view . . . . . . . . . . . . . . . . . . . Opening the view window . . . . . . . . . . . . Men u options whe n a view is active . . . . Buttons available when a view is active . Tools available when a view is active . . 3.3 Adding themes to a view . . . . . . . . . . . . Establishing project and file locations . . . Ch oosing you r data . . . . . . . . . . . . . . . . . Copying a theme between views . . . . . .

iii

Modifying the view . . . . . . . . . . . . . . . . . . . Navigating the view . . . . . . . . . . . . . . . . . . Resetting the view extent . . . . . . . . . . . . . 3.4 Working with view legends . . . . . . . . . . . Symbolizing a theme . . . . . . . . . . . . . . . . . Co mmon legend contents . . . . . . . . . . . . . Legend types . . . . . . . . . . . . . . . . . . . . . . . Classifying themes using numeric data . . . Symbolizing your themes . . . . . . . . . . . . . Labeling features in a view . . . . . . . . . . . . 3.5 Map projections and me asurement units Specifying theme properties . . . . . . . . . . . Specifying view properties . . . . . . . . . . . . Map units . . . . . . . . . . . . . . . . . . . . . . . . . . Distance units . . . . . . . . . . . . . . . . . . . . . . Projection properties . . . . . . . . . . . . . . . . . 3.6 Saving your w ork . . . . . . . . . . . . . . . . . . Saving for the first time . . . . . . . . . . . . . . . Subsequent saves . . . . . . . . . . . . . . . . . . . 3.7 Making transportable projects . . . . . . . . . Manual rebuild . . . . . . . . . . . . . . . . . . . . . . Other options . . . . . . . . . . . . . . . . . . . . . . . Chapter 4 Working with tables . . . . . . . . 4.1 Table basics . . . . . . . . . . . . . . . . . . . 4.2 Working with table records . . . . . . . . Basic table tools . . . . . . . . . . . . . . . . . Promoting selected records . . . . . . . . Switching and clearing selections . . . . 4.3 Modifying table properties . . . . . . . . . 4.4 Querying feature themes . . . . . . . . . Spatial query ve rsus attribute que ry . . Simple spa tial query . . . . . . . . . . . . . . Sim ple attribute query . . . . . . . . . . . . . Spatial query involving two themes . . . 4.5 Using the query builder . . . . . . . . . . . Defining a query based upon attributes Using wildcards in queries . . . . . . . . . 4.6 Working with fields in a ta ble . . . . . . Sorting records . . . . . . . . . . . . . . . . . . Summ ary statistics . . . . . . . . . . . . . . . Summ arizing records . . . . . . . . . . . . . 4.7 Editing tables . . . . . . . . . . . . . . . . . . Adding fields . . . . . . . . . . . . . . . . . . . . 4.8 Calcula ting values for a field . . . . . . . 4.9 Data reclassification . . . . . . . . . . . . . 4.10 Combining tables . . . . . . . . . . . . . . 4.11 The spatial join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..

33 33 34 36 36 38 39 44 46 48 49 49 49 50 50 51 54 54 54 55 55 56 57 57 59 59 60 60 61 62 62 62 63 63 66 66 67 69 69 70 70 72 73 74 77 79 82

iv

Chapter 5 Working with feature themes . . . . . . . . . . . . . . . . . . 5.1 Create new themes or edit existing themes . . . . . . . . . . . . . Create a new theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Edit an existing theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Add features to a theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Editing feature position or appearance . . . . . . . . . . . . . . . . . Move or delete features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modifying the shape of line and polygon features . . . . . . . . . . Combine, merge or union features in a theme . . . . . . . . . . . . 5.3 Adding attributes to a theme . . . . . . . . . . . . . . . . . . . . . . . . . 5.4 Maintenance operations involving single feature themes . . . Copy a feature theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deleting a feature theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Renaming a feature theme . . . . . . . . . . . . . . . . . . . . . . . . . . . Saving a feature theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5 Cre ate feature themes from tabular data . . . . . . . . . . . . . . . Create dBase (*.dbf) files . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding event themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6 Using AR C/IN FO interchange (*.E0 0) data . . . . . . . . . . . . . Adding the coverage to a view . . . . . . . . . . . . . . . . . . . . . . . . Co nve rting a cove rage to a shapefile . . . . . . . . . . . . . . . . . . . Clean-up following conversion . . . . . . . . . . . . . . . . . . . . . . . . 5.7 Revisiting systems of units, datums and projections . . . . . . Determining the system of spatial referencing . . . . . . . . . . . . Determining file extent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.8 Projecting shapefiles to other systems of spatial referencing Projecting a feature theme . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 6 Working With Vector D ata . . . . . . . . . . . . . . . . . 6.1 Working with Shapefiles . . . . . . . . . . . . . . . . . . . . . . . . Basic object oriented definitions . . . . . . . . . . . . . . . . . . . The shape object model . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Ge om etric properties of ve ctor data . . . . . . . . . . . . . . . Using A venue re que sts in the field calculator . . . . . . . . 6.2.1 Determine polygon area . . . . . . . . . . . . . . . . . . . . 6.2.2 Length or perimeter calculation . . . . . . . . . . . . . . . 6.2.3 Locate the centre of a feature . . . . . . . . . . . . . . . . 6.2.4 Parameters for the bounding rectangle of features 6.3 Combining features in a theme . . . . . . . . . . . . . . . . . Sample data sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Esta blishing ed iting param eters . . . . . . . . . . . . . . . . . . . Available operations based upon feature type . . . . . . . . Examples of combining features within a theme . . . . . . . 6.4 Combining two or more feature themes . . . . . . . . . . . . Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sample data sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Merging themes with no spatial overlap . . . . . . . . . . . . . Merging themes wh en spatial overlap exists . . . . . . . . . v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . 84 . . 84 . . 84 . . 84 . . 85 . . 87 . . 87 . . 87 . . 88 . . 89 . . 90 . . 90 . . 90 . . 90 . . 91 . . 92 . . 92 . . 98 . . 99 . 102 . 103 . 104 . 104 . 105 . 105 . 106 . 111 . 111 . . . . . . . . . . . . . . . . . . . . 116 116 116 117 118 119 120 121 122 122 123 123 123 124 127 132 132 132 133 133

6.5 Queries involving two or more themes . . . . . . . . . . . Spatial query for two or more polygon feature themes Other options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.6 Determining feature-to-feature distances . . . . . . . . . Using the spatial join on point themes . . . . . . . . . . . . Pro ducing a distan ce matrix . . . . . . . . . . . . . . . . . . . . Distance measures involving lines . . . . . . . . . . . . . . . De term ining the shortest route . . . . . . . . . . . . . . . . . . 6.7 Delineating space using buffers . . . . . . . . . . . . . . . . Chapter 7 Customizing ArcView . . . . . . 7.1 Introduction . . . . . . . . . . . . . . . . . . . . 7.2 Steps to customizing the interface . . Initial steps . . . . . . . . . . . . . . . . . . . . . Cre ating scripts . . . . . . . . . . . . . . . . . . 7.3 Applying the scripts to menu choices 7.4 Applying scripts to buttons . . . . . . . . 7.5 Getting real fancy . . . . . . . . . . . . . . . Applying picture images to buttons . . . 7.6 Startup customization . . . . . . . . . . . . 7.7 Hotlinking . . . . . . . . . . . . . . . . . . . . . Cre ating a hotlink field . . . . . . . . . . . . Specifying the hotlink type . . . . . . . . . Testing the hotlinks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . .

. . . . . . . . .

134 135 138 141 141 143 146 148 150 154 154 156 156 156 158 162 164 164 166 167 167 168 170 172 172 172 172 172 172 172 173 173 175 177 177 177 177 177 178 178 180 182 182 183 184 185

.. .. .. .. .. .. .. .. .. .. .. .. .. ..

Appendix A Maintenance Operations for Feature and Grids Themes . . . . . . . . . . . . . . . . A.1 Operations on single themes or grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . De lete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rename . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Convert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A.2 Clipping feature and grid themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating a clip theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Clipping a grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A.3 Importing and expo rting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Feature data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tabular data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other approaches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Appendix B Com puter basics . B.1 Introduction . . . . . . . . . . . B.2 Creating a work folder . . . B.3 Copying and moving files Explorer basics . . . . . . . . . Copying files . . . . . . . . . . . Moving Files . . . . . . . . . . . B.4 File sh aring on a netw ork . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

B.5 Zipping files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 Create the archive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 Open ing an archive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186

vii

Chapter 1 GIS Background


1.1 Introduction
A geographic information system (GIS) is specialized computer software which shares characteristics with spreadsheets, database, graphics and com puter-aided design programs. It is po ssib le to a nalyze spatial inform ation w ithin som e of these programs but yo u generally cannot observe the spatial pattern that may be evident. Cartographic programs fill this void, allowing us to view the spatial patterns in our data, they generally do not allow for modeling or analysis of the data. What separates a GIS from other software is the ability to deal with spatial information in all aspects. A GIS will include the following capabilities: 1 Input This includes the ability to assign/create the necessary spatial component of the data and the attributes for the features in question. 2 Manipulation, handling and analysis. It is possible to change the spatial and attribute data within the GIS software without relying upon other software packages. Similarly, modeling of spatial processes, statistical and database analysis can also be carried out within the software. 3 Output Visualization of the spatial nature of the data is po ssib le within th e software and output to hardcopy or other formats is available. Historically, GIS programs were classified as either raster or vector-based which refers to the form of the spatial da ta (m ore about this later). Today, m ost GIS programs offer som e capability to work with both formats. In this document, specific reference is made to ArcView GIS , a G IS package which allows you to work with vector and raster data. ArcView has a short learning curve and is extremely powerful from an analytical perspective. You should note, however, that the principles discussed are the same regardless of the program being used!

Geographic Information Systems: A Primer

Page 1

1.2 Spatial referencing


Before you begin exploring what a GIS can do, it is important that you have a foundation in how objects on the Earth's surface are referenced. Many questions on the list servers and newsgroups deal with the difficulties that people have trying to get data to display on a map properly particularly when different systems of spatial referencing are used. The way we describe the Earth's shape and the coordinate system, will determine what numeric values we ascribe to an objects position. There are a va riety o f ways to denote the position o f objects or areas on the surface of Earth. The choice o f system depends upon w hat you wish to reference and w hat you inten d to do with the data later. For example, there is no point using a cadastral (legal) referencing system if you want to determine the area of a housing subdivision. Similarly, you don't give longitude/latitude coordinates of your h ouse to a gue st you have invited over for dinn er. The most com mon m ethods of spatial referencing are discussed in the following sections.

Geographic Coordinates (longitude-latitude)


Geographic coordinates are the most common system of spatial referencing on globes and map s. In this system, Ea rth is subdivided on an angu lar basis with position being de noted by a longitude (east-w est) and latitude (north-south). Lines of longitude, or meridians, divide the Earth from pole-to-pole with 0/ longitude running thro ugh G ree nw ich En gland (the Prime M erid ian). The longitude of a point on the E arth 's surface is denoted as an angle between 0 and 180/ east or west of the prime meridian. In a GIS, longitudes east of Greenwich are given a negative value ( -180/ to 0/) while those to the we st are assig ned positive values. Lines of latitude, or parallels, are at 90/ to the lines of longitude. The equator is denoted as 0/ latitude with latitudes in the northern hemisphere varying between 0 and 90 /, and those in the southern hemisph ere are given negative values in the same range. In the Figure 1.1, point A's basic locational geometry is show n w ith reference to the Prim e M eridian and the Equator.

Geographic Information Systems: A Primer

Page 2

Figure 1.1 Longitude-Latitude of a Location

Geographic coordinates are cumbersome to use if you need to determine distance between points or if you need to determine the area of a feature. One should also note that the coordinate system has an arbitrary origin (0,0). It is generally agreed that 0 latitude is the Equator, however, older maps exist where 0 longitude does not run through Greenwich but through som e other location (e.g. Rom e, Beijing etc). The coordinates themselves are not sufficient to describe the location of an object since the size and shape of Earth will determine the relative position of objects on its surface. This can be illustrated by considering the following example: 1 Tw o po ints are located along the equa torial plan e (a 360 c ircular plane). 2 Point A is located at 0 longitude and 0 latitude. 3 Point B is located at 0 latitude but it is located 10,000 kilome ters away alon g the Equator. 4 Earth's circumference at the Equator, at time 1, is estimated to be 40,000 kilometers. Given the above, it stands to reason that point B is located 90 away from A (10,000/40,000 = 0.25, hence, 0.25*360 = 90). Now assume the following 5 It was later found that Earth's circumference was 40,100 kilometers. 6 The actual distance from A to B is still 10,000 kilometers. Given the 5 and 6 above, we can conclude that the A to B distance relative to the equatorial circu mference has changed (10,000/40,100 =0.249376...), hence, the longitudinal position w ith respect to the origin must also be different. (0.24 937 6...* 360 =89.77556 1).

Geographic Information Systems: A Primer

Page 3

This difference in longitude may seem trivial but consider that in the first example, 1 of longitude was equal to about 111.111 kilometers per degree (40,000 km / 360) whereas in the latter example, it is about 111.389 kilometers per degree (40,100 km / 360) resulting in a difference of about 277 metres. If we are mapping on a global scale this is not a huge apparent positional error. If we are mapping a small area around point B, however, using data which have two different Earth models, then features will not line up and objects will appear to be shifted even though they haven't. This shift is associated with mixing and matching data which have d ifferent datums and/or ellipsoid parameters.

Datums and ellipsoids in common use


In sum mary, the shape of Earth can be described using a datum and a ellipsoid wh ich w ill describe the origin of the coordinate system and its re ference axes . A datum allow s position to be recorded in either an XYZ cartesian system or by longitude-latitude and ellipsoid height coordinates. A datum can be global in scope (i.e. WG S84, World Geodetic System 1984) or continental (NAD27, North American Datum 1927). Ordance Survey (2001) describes a datum as nothing m ore than a set of co nve ntions, adopted constants and form ulae. There are many models u sed to describe Earth's shape, howe ver, the follow ing table lists parameters for commonly used ellipsoids for North American maps (the WG S 84 and GRS 1980 are essentially the same). M ost maps produced in North Am erica use eithe r the No rth Am erican Datum of 1927 (N AD 27) o r the N orth A me rican D atum of 1983. N AD 27 m aps are based upon the Clarke 1866 ellipsoid and NAD83 m aps use the GRS80 ellipsoid.

a Equatorial Radius (m) Clarke 1866 6,378,206.400 WG S84 6,378,137.000 GRS80 6,378,137.000 Ellipsoid Sphere 6,371,000.000

b Polar Radius (m) 6,356,583.80 6,356,752.31 6,356,752.31 0.00

f ( a - b)/a 0.003390 0.003353 0.003353

Flattening (1/f) 294.979 298.257 298.257

In the above ta ble, f, refers to flattening which expresses mathematically the fact that the polar radius is less than the equatorial radius. Ecce ntricity, e, can be derived from f using the following equations.

A major concern in using data from different sources, is datum conversion. If you have two

Geographic Information Systems: A Primer

Page 4

maps using the same coordinate system and the same feature appears in two places, then you have a difference in datums. Methods for performing datum shifts can be found in the references.

UTM, MTM and related grid systems


The Universal Transverse Mercator map projection and its associated referencing system provide a linear system of spatial referencing in a spherical world. The system of spatial referencing is be st su ited to loc al area studies. The UTM system is used extensively in North America and it is based upon the transverse Mercator map projection. The UTM system subdivides the earth into 6/ longitudinal by 8/ latitudina l zones. Each UTM zone 's longitudinal extent is num bere d in a straigh tforwa rd fashion, from 1 to 60 beginning at -180 / longitude. UTM zone 1, is therefore, between 180 /174 / longitude and its central meridian is -177 /. The zone's latitudinal extent is denoted using a more cumbersome lettering system. The UTM system applies to latitudes between -80 / to 84/ latitude and they are in 8 / increments (except for the 72 to 84 latitudinal zone). The lettering system starts w ith C and e nds with X with the letters I and O being skip ped. As an example, Ottawa is located at approximately -75 / longitude and 45/ latitude which places it in zone 18T (-78 / to -72 / longitude and 40/ to 48/ latitud e). In order to produce a planar system of referencing out of a spherical one a grid is superimposed over each longitudinal zone. The central meridian of the zone is assigned a metric value (500,000 m) and any point within the zone is given a metric positional value with respect to the equator (0 m) and the central meridian. These values are referred to as eastings and northings. Since the system tries to approximate a planar surface in a non-planar world, the sca le fac tor of the central me ridian assig ned is 0 .9996. Further refine me nts to this system are m ade and the reade r is directed elsew here for a m ore detailed discussion. It is important to note, however, that parts of Canada use a modified transverse Mercator (MTM) projection which is based upon 3/ longitudinal zo nes. In th is system the central meridian is assigned a value of 304,800 m and the scale factor is 0.9999. Complicating both of these systems is the reality that maps exist in both systems that use either the NAD27 or NA D83 datums.

Cadastral
The cadastral systems of referencing are quite varied and they are the official legally recognized registration of the quantity, value and ownership of land parcels. When you buy property, the legal description is the one you will see on you deed.

Other recognized referencing systems


There exists a variety of other recognized systems of spatial referencing which are used

Geographic Information Systems: A Primer

Page 5

extensively. These would include postal code system and the system associated with census data and phone service.

Colloquial referencing
Less useful, but more familiar systems of referencing would include street address designations and the description of place by the use of local features. Information referenced in tables can be located on a map using a process called Geocoding. Geocoding allows the user to locate a street address or a place name with reference to another file (generally a street netw ork file). The key point to remember about spatial referencing is that it may be necessary to convert from one system to another. A GIS program should offer the ability to perform these transformations for you.

Geographic Information Systems: A Primer

Page 6

1.3 Representing features


In any discipline, there is an associated jargon or, if you like, a terminology list. This section introduces you to some of the term s you w ill encounter, inclu ding those specific to ArcView. The se definitions are gene rally widely accepted but variations m ay exist between softwa re vendors.

Vector data
Features on the surface of the Earth can be represented by one or more of the following geometric entities: points, lines, areas (polygons) and surfaces (volumes). Terms that arise from these geometric entities are described as follows: Point A point is a location expressed as a single X,Y coordinate pair. The coordinate system using some coordinate system (e.g.,UT M, latitud e/longitude). Points have no dim ension , only location. Line A line consists of a series of x, y coordinates which define the line's shape. The start and end points of the line are referred to as nodes. Lines may contain intermediate points called vertices (vertex, in the singular). Lines consisting of m ore than o ne line segme nt are referred to as polylines. Lines, in their strictest sense, have the dimension of length but no width. Polygon Polygons represent areas on the Earths surface and, as such, have th e dime nsions of leng th and width (i.e., area). A polygon will begin and end at the same node. Surface A surface is a th ree dim ension al fea ture having the dim ension s of leng th, width and height.

Raster (grid or image) data


Raster data consists of a cell or grid based representation of feature s. A grid cell is sq uare having a known width (and hence, area) which determines the spatial resolution of the features that it covers. Points, lines and polygons ca n all be re presented in a raster environ ment. In ArcView, images and grids are raster representations of map data. Im age data is sim ply a pictu re, for exa mple, a scanned air photo of an area or a satellite image. The values associated with each cell in the grid simply represent its colour or level of grey. The data does not have any value in terms of describing the attributes associated w ith the spatial loc ation. G rid data, on the other hand , are used to represent surface characteristics. A grid can be made of land use or soil properties and each cell in the grid can have attributes associated with it in m uch the sam e way tha t feature themes have an associated table. If the phenomena being represented are continuous, such as elevation or temperature values, then there will not be an associated table.

Geographic Information Systems: A Primer

Page 7

Attributes
An attribute, in GIS terms, is information about a feature in the landscape, whether it is a road (line), a census tract (polygon) or a bird-nesting site (point). In other words, attributes are the characteristics of features. The attributes of a road ma y include its typ e (prim ary, se condary), its width, the cover type (gravel, paved), its maintenance history and the responsible agency (e.g., townships, cities, regional, provincial). In A rcView, the attribute information for features is stored in a separate dBase format table.

Geographic Information Systems: A Primer

Page 8

1.4 Levels of measurement


The level of measurement of a spatially distributed variable is a basic control on: the choice of m ap type , method of analysis and the inferences that one can draw from the spatial structure. As a general rule, you should remember that data can be collected at a higher measurement level and converted to a lower level for mapping and analysis bu t you cannot go the other wa y. The rules which are used to assign a name or number to a phenomena determine what is called the level of measurement, different levels are associated with different rules. There are four basic levels of measurement: nominal, ordinal, interval and ratio. Data measured on a nominal or ordinal scale are often referred to as qualitative data while measurements using an interval or ratio scale are referred to as quantitative data. Nominal The nom inal sca le m akes no assumptions about the values being assign ed to the data. Each value is a distinct ca tegory and is u sed solely to label or nam e the phenomenon. In this case the categories are inclusive and mutually exclusive. Inclusive means we can code thing s so that any ob servation will fall into som e category (e.g. people, non-people). Mutually exclusive, means that no object is capable of being placed into more than one class. There is no implicit ordering in the classes and there is no ability to mathematically or statistically analyze the data. Examples of nominal data would include land use or vegetation classes. Ordinal If it is possible to rank obse rvations consistently according to some criterion, then w e have an ordinal level of m easurem ent. For instance, it is possib le to c lass ify land acco rding to its agricultural potential. Even though ranking is inherent to the ordinal scale, there is no requirement that the spacing between ranks be equal. This means that you cannot necessarily say that class 1 land is twice as valuable as class 2 land. Interval In the interva l level of m easurem ent, ordering exists and the spacing betwe en values is fixed. Thermometers employ an interval scale of measurement since the difference between any two temperatures is the same regardless of the initial temperature. An interval scale has an arbitrary z ero point an d hence, division doesn't make sense. Exam ples of interval data would include Celcius temperature and elevation since both 0 points are arbitrary (i.e. the freezing point of w ater and sea level respectively). Ra tio The ratio measurement scale also possesses ordering and fixed distances between categories but the zero point has true meaning. Temperature in Kelvin degrees and income wo uld be two exa mples of ratio data. The following table su mmarizes the vario us levels of m easurem ent:

Level

Basic operations

Example

Geographic Information Systems: A Primer

Page 9

Nominal Ordinal

Determine equality to a class. Count items w ithin a class De term ine wh ether an observation is greater than, less than, or equal to a given class. Determine interval between ranks. As above, plus the difference betwe en intervals has m eaning. Addition and/or subtraction of values is possible. As abo ve, plus division (ratios) have meaning.

Classification of objects, landuse categories, age groups Land capability classification, city ranking

Interval

temperature in C or F; elevation, distance

Ra tio

mass, or precipitation

Geographic Information Systems: A Primer

Page 10

1.5 Operations within a GIS


Process-based GIS
This se ction introduces so me of the term inology associate d w ith what I will ca ll process-based GIS . These are the words that you will come across or use to describe some of the functionality involved in GIS operations. This list is not exhaustive, but it is a good starting point to get you thinking of some of the tasks that are involved in preparing data for analysis or some of the types of analyses themselves. Add Load, use a data set. Align Mosaic side-by-side, map join. Buffer Produce zones of specified distance around features on a map. Classify Reclassify or change attribute values by recoding or generalization (attribute disso lve). Clip Cookie-cut, select features/grids on one theme/grid using features on another theme, or by u sing manual or graphic selection and creating a new file. Combine Merge or union features within a theme together forming a larger feature. Conflation Re concile po sition of features common to two or more themes, see rubber-sheeting, warp and editing. Convert Change between raster, vector and/or image formats. Copy Produce a duplicate of a file with or without name change. Create Make Cro ss-tabulate Pro duce a sum mary of two field s in a table or two maps showing different themes showing the inter-relationships between the attributes. Delete Rem ove Dissolve Reclassify if for attributes, spatial dissolve removes feature boundaries for adjacent features or consolidate features based upon common attributes resulting in a multi-part features. Edge-match See align, a process to ensure that features on adjoining map sheets meet where a ppro priate (i.e. roads). Ed it Change size, position or shape. Exp ort Pro duce a file in non-native data format. Flip Change order of X or Y coordinates. Generalize Re duce the number of points needed to represent a line . segm ent.

Geocode Determine the coordinates of a feature given its add ress (e.g. street, landma rk). Georeference

Geographic Information Systems: A Primer

Page 11

Provide real-world coordinates for a paper map or image or one in digital form lacking coordinate information. Iden tity A topological overlay of a data set (input coverage) w ith a p olygon data set (identity coverage). The features in the input coverage are assigned the attributes of the feature the identity coverage that they overlay. See intersect and union. Imp ort Add a data set while changing from nonnative to native data form at. Intersect The topological integration of two data sets. The features are preserved within the area of common boundary to b oth data sets. See union an d identity. Interp olate Estimate values in space based upon the values found at known locations. Join Relational join - to join two tables based upon a com mon attribute field. Spatial join - to join attribute information based upon positional information. Load Add, use a data set. Merge Co mbine or merge features in a th em e to form a larger feature. Mosaic Align separate map sheets side-by-side. Move Change position. Name Rename Overlay See topological overlay.

Rectify Register an image or grid. This may involve translation, rotation or scaling of the grid and resampling to obtain values for the grid. Register Provide coordinate information to a theme, grid or image. Re lational join To join two tables based upon a common attribute field. Re sample Reduce image file size by combining information from adjacent pixels. Cell size increases, the image extent remains the same but the quality is reduced. Resize Ch ange the size of an im age or grid. This may entail clipping or mosaicing of adjacent images or grids. Rubber sheet See warp. Ro tate Change X and Y coordinates by angular move ment. Sample Select features based upon a random or predetermined sampling strategy (i.e. stratified, systematic). See also, resample. Save Save files and/or commands. Select Obtain from a table or map by manual or query selection. Sm ooth Gene ralize the pattern of data to remove noise or filter in some other fashion. Sp atial join To join attribute information based upon

Geographic Information Systems: A Primer

Page 12

positional information. Tab ulate Produce a tabular summ ary. Topological overlay A procedure to determine the spatial coincid ence of geographic fea tures. These procedures would include: point-inpolygon, line -in-polygon, polygon overlay. See identity, intersect and union.

Union A topological overlay of two polygon themes. The features from both data sets are retained. The attributes retained for areas of overlap will depend upon the editing properties specified. Warp reference a map or image which contains disto rtion to a reference map or im age w ith known coordinates.

Geographic Information Systems: A Primer

Page 13

Geographic Information Systems: A Primer

Page 14

Chapter 2 The ArcView environment


2.1 ArcView organization
ArcV iew a llows you to use a logical approach to deal w ith spa tial data. Norma lly whe n you are about to undertake a study or p roject you have a set of goals in mind; you may h ave data or will need to collect data; you may need to perform some analyses and finally, present your results.

Starting ArcView
If you are beginning a new study or p roject, you need to know wh at files you are going to use. The data files m ay includ e raster files, vector files , ima ges and/or database tables. It is suggested that you have all these files at yo ur dispo sal before you begin. Once you have assem bled, or know whe re your data are located, you are ready to launch ArcView. Depending upon the installation there are several ways of doing this. If you are using Window s operating systems, the n yo u can navigate the program selection tree by selecting:
Start button | Programs | Es ri | Arc View GIS Version 3.2 | ArcView GIS Version 3.2

as shown in Figure 2.1 (the appearance may look slightly differently depending upon the version of ArcView being used). Figure 2.1 Starting ArcView

Alternately, you can create a shortcut to this program within Windows and then select the shortcut ico n, , on the Windows desktop.

At this stage, ArcView should be active and you will se e the project window . Before you begin to work in ArcView, you should be awa re of the data typ es that can be used w ithin th e program . The m ost common form s of data are sum marized in se ction 2.2 as we ll as the basic requirements to lo ad data that is in a particular form at.

Geographic Information Systems: A Primer

Page 15

Whe n ArcView is launched, you are confronted with a bare-bones screen which contains a Project Window as shown in Figure 2.2. Figure 2.2 ArcView 3.2 Project Window

This application shows several menu and button options. These will vary depending upon what elements are active in the project. In ArcView-speak, the topic or study we are working on is referred to as a project. A project is a text file w ith a *.apr file extension . The structure of ArcView, is as follows:

Project
The necessary information relating to a study you are undertaking. Projects can contain the following compone nts:

Views
A view displays sets of geographic data referred to as themes. The view can be considered a map, with each map containing layers of thematic data. Each view has a separate view window and a project can contain many views. You can, for example, display a soil type theme w ith an ove rlay o f a roadwa y the me. The table of contents of a view will allow you to keep track of what information is contained in the view. Views can display spatial data in a

Geographic Information Systems: A Primer

Page 16

variety o f formats (this will be d iscus sed later).

Tables
Tables contain the attributes (or characteristics) of the features in a map. The table is linked to an associated theme permitting simple spatial query. For example, you can click on a record in a table and the associated feature on the map (in the view window) will be highlighted. Alternately, you can click on a map feature in the view window and the associated record in the data table will be highlighted. More advanced capabilities exist allowing you to perform com plex spatial and attribute query.

Charts
Charts are used to portray tabu lar data in gra phical form . Charts, tables and views are integrated allowing you to chart information by selecting it from the map view or from the table.

Layouts
All documents can be printed directly, however, the Layout document offers the greatest control over print output. Layouts are used if you wish to make a printed version of a view with a scale bar, north arrow a nd/or legend. You can combine different views, or incorporate tables, charts and other im ages in a la you t as we ll.

Scripts
ArcView has its own programming language called Avenue. Avenue allow s you to customize or add to ArcViews functionality. Custom applications can be created, which may be as simple as redesigning the standard interface or you may include certain types of analyses not normally found within a GIS. Script information can be accessed through the help files. There is also a vast number of sites th at contain scripts. O ne of the m ost exte nsive is maintained by ESRI. It contains scripts produced by the company and those submitted by individuals. The site can be accessed at http://gis.es ri.com /arcscripts /scripts.cfm

Extensions
Other tools, called Extensions, are separate add-on software products which provide additional analysis tools. Extensions expand the capabilities of ArcView greatly. Many extensions come with ArcView which allow you to read CAD files, database themes from ESRIs Spatial Database Engine (SDE), ERDAS IMAG INE image files, JPEG images and a variety of others. Other extensions can be purchased from ESRI, the most common ones are the Spatial Analyst and Netw ork Analyst exte nsions which permit raste r data analysis and routing analysis respectively. Yo u can purchase exten sion s from other ve ndors, create your own, or download free one s at the scripts site listed previously.

Geographic Information Systems: A Primer

Page 17

2.2 Data types supported by ArcView


ArcView allows you to work with a wide variety of data formats. It is a good idea to become familiar with the supported file formats since, inevitably, you will need to import data into a project from another source. Issues surrounding the types of data are shown on the Data Types: Preparation Stage flowchart on the next page. The file types are described in a general sense below.

Vector data
Shapefiles The shapefile is ArcViews native data format. This data structure is used to store the geometry and attributes of features. A shapefile consists of at least three files which share a common name but have different file extensions. The files you will see for a particular theme are: filename.shp, filename.shx and filename.dbf where filename is the name o f the theme. It is important to rememb er that these files must reside together in the same folder and all files should be copied together if you are doing file maintenance and backup. CAD themes Da ta from computer-aided design (CA D) p ackages ca n also b e im ported and used in ArcView. The supported formats are AutoCAD (.dwg) or MicroStation (.dgn) drawing files ARC/INFO coverages ArcView ca n view AR C/INFO coverages d irectly. These can be conve rted to native shapefiles. ArcExport (*.E00) Data from ARC/INFO can be imported into ArcView via the export format (*.E00) using a separate utility (Import71). This utility produces ARC/INFO coverages which can used directly in ArcView or they can be saved as ArcView shapefiles if desired.

Geographic Information Systems: A Primer

Page 18

Raster data
ArcView supports a wide variety of raster data formats, including: TIFF, compressed TIF, GeoTIFF, ERDAS .gis, .lan and IMAGINE formats, BSQ, BIL, BMP, Ru n-length com presse d (R LC ), JPEG , Sun raster files a nd ES RIs GR ID The help files describe a variety of other formats. Raster data appears in two incarnations within ArcView. Image files An image file is, in essence, a picture. This could be satellite image, a scanned map or photo of the earths su rface or output from another G IS package in a p articular image format. Images are useful since they can provide a realistic picture of a study area or they can serve as a basis for heads-up (on-screen) digitizing. Grid files A grid file is a raster file consisting of rows and columns of information. The grid cells are of equal size and a numeric value is assigned to each cell. Integer or real data can be assigned to the cell representing the attributes of the grid theme in question. This raster representation of data is useful for a variety of modeling operations.

Tabular data
ArcView allows you to read tabular data in a variety of formats including dBase files, ARC/INFO INFO tables, comma or tab delimited ASCII text files. As well, files from several database servers may a lso b e used. There are also s cripts available wh ich c an be used to read from spreadsheets and M icrosoft AC CE SS data sources. In s hort, it isnt difficult to bring attribute information into ArcView. These data files can be joined or linked to existing shapefiles using a common identifier field.

Geographic Information Systems: A Primer

Page 19

Geographic Information Systems: A Primer

Page 20

2.3 Obtaining help in ArcView


The main help menu can be accessed by selecting Help | Help Topics from the main menu. The He lp Topics: ArcView He lp window displays the choices Co nten ts, Index and He lp as shown in Figure 2.2.

Figure 2.2 Main Help Window

Inform ation o n an y of the listed top ics ca n be obtained by doub le-clicking on the topic. Th ere are a myriad of topics listed within each topic item. When the Index tab is selected, you have the option of typing in key words or phrases to refine you r search. The dialogue window is show n in Figure 2.3

Geographic Information Systems: A Primer

Page 21

Figure 2.3 Help Index Window

The Find tab permits you to further expand your search options. When you first select the find tab you will be requested to select a database keyword search. Just follow the options. When the program is completed, you will see the options shown in Figure 2.4. You can then choose keywords or phrases and the ArcView help system will se arch all the h elp menus for all occurrences of your word or phrase.

Geographic Information Systems: A Primer

Page 22

Figure 2.4 Help Find Window

This document will refer to appropriate sections of the help files where further information can be obtained on how to perform tasks in ArcView. The combination of the help system and the manuals is sufficient to do just about anything you need. There is also help, scripts, tips and techniques at the US and Canadian web sites listed below: US http://www.esri.com Canada http://www.esricanada.ca

Geographic Information Systems: A Primer

Page 23

Chapter 3 Viewing spatial data in ArcView


3.1 Preliminary considerations
File type and characteristics
Figure 3.1 shows some of the preliminary considerations that need to be addressed when working with geographic data. It should go without saying, that you need to know what data you have before you know if it is appropriate for the task in hand. Issues revolving around these considerations will be addressed as they arise. ArcView allows you to use image, raster, vector and tabular data in projects. Other information is not maintained directly in a metadata or header file. It is up to you to determine this information prior to using it. 3.1 File Information Considerations

Geographic Information Systems: A Primer

Page 24

3.2 Creating a view


We will demonstrate the procedure of opening a view window to display mapped data, using some data sets that come with the ArcView program. Start ArcView using one of the methods from section 2.1. Figure 3.2 shows the main menu and project window that appear when you start ArcView. The window h as been annotated to show the steps used to begin a new p roject. Figure 3.2 Starting a New Project

Opening the view window


The view window is the place that you will add themes. You can have many view windows ea ch one containing any number of themes. For example, you could create a view showing a provincial level perspective and another one showing a local level perspective, both view can contain the same themes. Conversely, you could organize your views by the themes that they contain. This would allow you to show economic related themes for a township in one view and environ mental the mes in an other. Use the following procedure to create a view. 1 Double-click on the Views gui, 2 Left click on Views gui, , in the Project Window or

and select New .

A View1 window will appear as shown in Figure 3.3. When a View document is active, the menu items, the available tools and buttons change to reflect the available View-related operations that can be performed. This section provides a brief introduction to some of the menu item s, too ls and buttons that are ava ilable wh en you have a n active View d ocum ent.

Geographic Information Systems: A Primer

Page 25

Figure 3.3 View Window

Menu options when a view is active


The available menu op tion when you have a V iew document are shown below. Som e of these menu item s have a tool or button shortcut equivalent. Figure 3.4 Menu Options When a View is Active

Buttons available when a view is active

Geographic Information Systems: A Primer

Page 26

Some of the buttons that becom e available wh en a View document is active are shown below. More information can be obtained from the Help files. The reader should also be aware that many buttons only become enabled (you can select them) when certain conditions are met. For example, you cannot open a theme's table unless you have a theme or themes selected in a view . A disab led button appears greyed out or dimm ed if pre-conditions are not met. All the buttons

Add Theme Adds a new theme in the View. Opens the Add Theme dialogue box Theme Properties Edit properties of the active theme. Opens the Theme Properties dialog ue b ox. There are several options, see the View Dialogue Boxes section Legend Editor Edit the properties of the legend of the active theme. Opens the Legend Properties dialogue box. Op en Them e Table Opens the tables of the active theme or themes. Find Find features in the active themes using the text you enter. Opens the Find dialogue box. Query Builder Opens the Query Builder dialogue box allowing you to select features based upon a logical expression. Zoom to Full Extent Zoom to the extent of all themes Zoom to Active Themes Zoo ms to the exten t of the a ctive the me (s). Zoom to Selected Zoom to the extent of the currently selected features. Zoom In Zoom s in to the centre of the display.

Geographic Information Systems: A Primer

Page 27

Zoom Out Zoom s out from the centre of the display. Zoom Previous Returns you to the previous extent that you were viewing. Select Us ing Graphic Select features in the active theme(s) using selected graphics.

Geographic Information Systems: A Primer

Page 28

Tools available when a view is active


Tools differ from buttons in that they remain active until another tool is selected. Consult the Help files for more information. All th e Tools

Identify Tool Provides information about a feature. Launches a dialog box showing information about the selected feature(s). Pointer Selects, moves and resizes graphics. Vertex Select vertices for shapes allowing you to move, add or delete them. Normally used during digitizing. Select Features Select features in an active theme by pointing or dragging a bounding rectangle around an area. Zoom In Click a point or draw a rectangle to zoom in to. Zoom Out Click a point or draw a rectangle to zoom out to. Pan Move s the displa y in the direction of cu rsor move ment. Measure Distance Click two or more points on a view to determine the distance between them. Doubleclick to terminate m easurem ent. Label Labels a fe ature from the active them e w ith da ta from its tab le. If you click and hold this tool, a drop-down list of available labeling options will appear Add T ext Creates text on the display. Add Graphics Creates Graphics on the display. Click and hold this tool to reveal the complete graphics options list.

Geographic Information Systems: A Primer

Page 29

3.3 Adding themes to a view Establishing project and file locations


The working environment must be established prior to working with data in ArcView. Many operations create permanent or temporary files which are saved in a default work directory. The default location is ge nerally the C :\Temp or C:\W indow s\Tem p folders. You should create specific directories for each project and place all associate d files there. Ha phazard file managem ent will ca use problem s and you can overwrite files by mistak e. This is particularly important if you are working in a multi-user environment. Remember, you are the sentient one...not the comp uter. There are two ways to establish the general working environment in ArcView. Select one of these options: 1 Make the Project window active and then select Project | Customize | Set Working Directo ry from the main menu. or 2 Make a View w indow active and then select File | Set W orking Directo ry from the main menu.

Choosing your data


Once you have a View document open, feature, grid or image data can be added to it. To add a theme to a view, use the following procedure. 1 Select View | Add Theme from the main menu or use the add theme button Figure 3.5 shows the Add Theme dialogue box. Figure 3.5 Add Theme Dialogue Box .

Geographic Information Systems: A Primer

Page 30

3 Select the theme type: Feature Data Source files containing point, line or polygonal data. Image Data Source raster picture images such as scanned air photos. Grid Data Source raster grid data (this option is only available if the optional Spatial Analyst extension is loaded. In our example, you will be adding feature data. 4 Specify the drive and path to the data files in the Add Theme window. S am ple data exists in the d efault subd irectory c:\esri\av_g is30\avtutor\arcview\qstart (Double-click on the appropriate folder and follow the menu tree). You will then see a list of themes that can be added to your view. 5 Select th e them es to add to the View. You can hold dow n the shift ke y to select m ultiple themes. Figure 3.6 show s an exam ple View docume nt with two added themes. Figure 3.6 A View with Two Them es Added

Geographic Information Systems: A Primer

Page 31

Copying a theme between views


It is often very useful to have two views of the same geographic area on the screen at the same time, perhaps showing the area classed using different variables. This is accomplished by creating another view (the destination view) and copying the desired theme(s) from the source view to the destination view and then reclassifying it. The procedure is as follows. 1 In the Project Window, select View then click on New (or double-click on View). 2 Make your source view active and select the theme(s) you wish to copy by clicking on their legends in the view. 3 Select Edit | Copy from the m ain m enu (or use the GU I shortcut). 4 Make the destination view active. 5 Select Edit | Paste from the m ain m enu (or use the GU I shortcut). 6 Reclass the theme(s) in the destination view according to a different field than in the source or use the same field with a different classification scheme.

Modifying the view


The View1 document will now contain these themes but nothing is in the view. To make a theme appear in the view window, simply click in the raised selection box to the left of each theme nam e in the view s legend. Your view should appear as it is show n in Figure 3.6. Resize and move the View1 to su ite your tastes. You accomplish this b y moving the cursor to the edge of the View docum ent until you see a double-headed arrow. Whe n this occurs, click and drag the selected side and move to resize. Alternately, you can maximize the view by clicking on the central box shape in the top right-hand corner of the View1 document. The themes can be reordered by clicking and dragging the theme name in the legend section of the View. There is a logical order to ordering themes in a View and they should be organized with points first, then lines followed by polygon themes. There can also be a conceptual order as well. For example, if we use the Deg30.shp shapefile to represent water then it should be at the bottom of the list and the World94.shp shapefile should be on top. The flow chart, Mapping Data: Adding a Feature Theme to a View, summarizes the considerations involved in adding a theme to a view.

Navigating the view


Changing ones view focus is a common data exploration task. ArcView has a variety of zoom tools an d buttons ava ilable wh ich a llow you to ch ange you r view ing focus. Note that the tools and buttons have menu equivalents in the View menu.

Geographic Information Systems: A Primer

Page 32

The pan tool, , can be used to move the view area within the view window. Methods of changing view perspective are grou ped in the following ma nne r.

Changing the view incrementally


The zoom in to centre, , and zoom out from centre, perspective based upon the ce ntre of the display. , buttons allow you to change the

User-controlled selection
The zoom in, , and zoom out, , tools allow you to specify a zoom operation on an area other than the centre of the view o r to specify a bounding rectangle to d eline ate the view exte nt (via click and drag with the left m ouse bu tton). Zoom operations can apply to selected themes using the Zoom to Active Themes button, . Co nsider the case wh ere a View contains th em es with different areal exten ts, for exa mple, a map of Canadas provinces and a map of Ontario vegetation. If you wish to zoom in to an Ontario-centred perspective, select, the Ontario vegetation theme in the View's legend and click on the button.

As an alternative, use the following procedure. 1 Select the selector fea ture tool, .

2 Click on the Ontario polygon in Canadian provinces theme. 3 Select the zoom to selected tool, .

The view w ill now zoom ed to an O ntario-centred view . This tool is particularly useful when you are performing database queries and you wish to find selected features on the view ba sed upo n attribute conditions. For exam ple, you could query a database for a hospital name, switch to the view, use the zoom to selected tool and your view would be focused on the hospital location.

Resetting the view extent


The quickest way to reset a view is to use the zoom to full extent button, the view to the exten ts of the them with the greatest areal extent. To switch between views zooms, use the zoom previous button, . , which will change

Geographic Information Systems: A Primer

Page 33

Geographic Information Systems: A Primer

Page 34

3.4 Working with view legends Symbolizing a theme


The legend choice s, and the clas sification sch em e used, to disp lay the view o f the wo rld in Figure 3.6 can be altered in a variety of ways. To edit a legend, use the following procedure: 1 Select the theme in the view. 2 Select Theme | Edit Legend from the main menu or double-click on the them e nam e in the legend in the view window. The legend editor allows you to completely custom ize th e appearance of a theme in a view. The following information w as specified fo r the wo rld94 them e in Figure 3.6 and its legend is show n in Figure 3.7. Theme In Figure 3.7, the World94.shp shapefile was specified. Legend Type A Graduated Color scheme was chosen from a list of options in the Legend Type combobox. Cla ssification Field The data were classed according to a Life_exp field containe d in the database. These data are measured using a ratio measurement scale, hence, a graduated color scheme is a ppropriate. Normilized by This option allows you to divide the values in the field in question by values in another field. For example, you could symbolize a census tract theme based upon population and normalize it by dividing it by the area of the census tracts to obtain population density. In our example, <none> was selected. Color Ramps A red m onochromatic colour schem e w as selecte d from a drop down list. The remaining buttons above the Color Ramp combobox, in Figure 3.7, allow you to add or remove classes, change the order of classes, specify a null value and create/modify color ramps to sym bolize your data. The other theme in Figure 3.6, World30.shp, is simply a theme of 30 longitude-latitude blocks. This the me w as sym bolized with Single Symbol and a light b lue color was chosen. Figure 3.8 shows the result of these options. Figure 3.7 Legend Editor Window

Geographic Information Systems: A Primer

Page 35

Figure 3.8 Sample View Show ing Two Themes

The next sections discuss some of the options available to symbolize the views in a variety of wa ys.

Geographic Information Systems: A Primer

Page 36

Common legend contents


The Legend Editor offers a whole variety of options for customizing map appearance. The contents of the Legend Editor depend upon the Legend Type selected. More details can be found in the ArcV iew H elp file un der Legend Editor (Dialog Box). The common elements to all legend types are the Theme and Legend Type selection dropdown choices and the Load, Save, Default, Statistics and Ap ply buttons.

Theme
If there are seve ral them es active in a view, you can toggle and select th e them e to clas sify. By default, the first active theme will be listed.

Load
Allows you to load a legend file that you have saved.

Save
Allows you to save a legend with a specified name. Legends have a *.AVL extension.

Default
The Default button resets any previously chosen legend type to the Single Symbol legend type.

Statistics
The Statistics button allows you to obtain a quick listing of the statistical parameters for the numeric fields in the themes table.

Apply
The Apply button is selected once you have completed specifying the properties of the legend. This will cause a refresh of the View to show the results of the specified parameters. The other buttons, Advanced and Undo only become active under certain circumstances.

Advanced
This button allows you to specify other optional parameters such as reference scale and a rotation angle field for point data.

Undo
The U ndo button allows you to reve rse an Apply even t. You can retrieve u p to 5 previously specified Apply events.

Geographic Information Systems: A Primer

Page 37

Legend types
Single symbol legends
This is the default leg end typ e. It is useful if you simp ly wish to sym bolize all featu res the same. The Legend Editor window for the Single Symbol legend type is shown in Figure 3.9. Figure 3.9 Single Symbol Legend

Graduated color legends


Graduated color classification can only be used on numeric data fields. The Graduated Color legend window is shown in Figure 3.10 (see Figure 3.7 also). The Cla ssification Field allows you to specify the field to use to symbolize the theme. The Normalize by option allow s you to specify a field to use for normalizing options. For example, if you had a census tract theme you could normalize the population in a particular age group relative to the total population assuming both fields exist in the theme table. The rem aining buttons above the C olor Ram p drop-dow n box allow you to ad d or remove clas ses, ch ange the order of classes, sp ecify a null value and create/m odify color ramps to symbolize your data.

Geographic Information Systems: A Primer

Page 38

Figure 3.10

Graduated Color Legend

The legend window shows three fields that are completely editable. These are: Symbol Double-click on any of the rectangular areas to bring up the Co lor Palette window. Once this window is active, you can specify the colour, fill patterns and a variety of other parameters. Value By default, the value settings are determined using natural breaks determined from the values in the classification field. You can specify the ranges of values to use manually under the Value column or choose another classification method using the Classify button. Label By default, the value and label fields will be the same. You can use the label field to change how the classes appear in the legend. For example, we could replace the numbers with a textu al description of the va lues of the underlying data.

Geographic Information Systems: A Primer

Page 39

Unique value legends


Individual symbols/co lors can be assig ned to data contained in eith er text or n um eric data field s. The legend window is shown in Figure 3.11. Once the Values Field is specified the symbol that will appear under the Symbol field will reflect whether the data type are point, line or polygon.

Figure 3.11

Unique Value Legend

Geographic Information Systems: A Primer

Page 40

Dot legends
Numeric data fields can be represented with a dot of specified size which is useful for creating dot density maps. A variety of options exist which give you complete control over how the dot symbols will be produced. Figure 3.12 shows the choices available for creating dot maps. Figure 3.12 Dot Legend Type

Geographic Information Systems: A Primer

Page 41

Chart legends
Numeric data fields can also be symbolized with a bar chart or pie chart. Figure 3.13 shows the options available for chart legends. Figure 3.13 Chart Legend Type

wh ich includ es such options as: Eq ual Are a, Equal Interval, Natural B reaks, Qu antile and Standard Deviation

Geographic Information Systems: A Primer

Page 42

Classifying themes using numeric data


Choosing the classification method
The Classify button can be selected to modify the method of cla ssification. The default clas sification sch em e for numeric data is th e natural breaks m ethod (see N atural (R equest) in the help files for an hysterical description of the method). Other options include equal area, equal interval, quantiles and standard deviations. The following Classification window shows the options that can be specified.

Specifying null values


The value -99 which appears in Figure 3.7 actually represents no data or a null value. You specify the null value by clicking on the button towards the bottom of the Legend Editor Window. The null value window (see below) will appear allowing you to specify the value representing missing data.

The resultant legend appears in Figure 3.14.

Geographic Information Systems: A Primer

Page 43

Figure 3.14

Reclassified Legend

The reclassified map is shown in Figure 3.15. Figure 3.15 Reclassified Map

Symbolizing your themes

Geographic Information Systems: A Primer

Page 44

You can change the legend colours, fill patterns, text font and a variety of other features once the legend editor window is active. To activate the various options use the following procedure. 1 Select a theme in a view. 2 Select Window|Show Symbol Window from the main or double-click on a symbol in the Legend Editor window. This will launch the Color Palette window. From this window, you can chose the fill pattern, line pattern, marker style, text style and colour for any legend category in a theme. The windows are shown on the following page in order of the selecting icon. The Palette M anager gui allows you to load other palette, m arker, line and fill patterns loc ated in the ESRI subdirectories. These are found in thec:\esri\av_gis30\arcview\sym bols folder.

Geographic Information Systems: A Primer

Page 45

Labeling features in a view


The re are a variety of w ays to labe l the features on a view. These are summ arized in flowchart form as follows.

Geographic Information Systems: A Primer

Page 46

3.5 Map projections and measurement units Specifying theme properties


The properties of the active theme can be defined. These properties include editing, labeling and selection options. To set the properties of a theme, use the following procedure. 1 Make the theme active in a view by clicking on the theme legend. 2 Select Theme | Properties In the Theme Properties window you will see a variety of icons entitled Definitions, Text Labels, Geocoding, Editing, Display, Hot Link and Locking. Selecting e ach of these in turn will cycle you through a variety of options. You should explore what these options do. The most useful to you at present, however, is specifying the theme name. 3 Specify the Theme Name if you wish it to b e different than the shapefile n am e. If you check the Us e Suffix box, the field used to classify the theme will be appended to the theme name. It may be preferable to leave the default to specify the shapefile and use the suffix options in the early stages of your work. Once you a re ready for final presentations, give each theme a meaningful name and remove the check so that classification isnt appended.

Specifying view properties


The setting you specify in the View Properties window controls the map appearance on the screen. To acce ss th e view p roperties window , as show n in Figure 3.16, select View | Properties from the main menu. In this dialogue window, you can change the nam e of the view , find in form ation about the file creation date, add information about who created the file and specify the map units and dista nce units. B y de fault the m ap and distan ce units are not specified.

Geographic Information Systems: A Primer

Page 47

Figure 3.16

View Properties Dialogue Box

Map units
The map units are the units that the theme was created in. The two most common units are: decimal degrees Specify when features use longitude-latitude referencing . This type of spatial referencing is referred to as geographic coordinates meters Specify when features use U TM or M TM referencing or the m ap has been projected. Data referenced using the UTM system is often referred to as projected data. All them es in a view should have the same m ap units. If you have a them e referenced in geographic coordinates and another theme referenced in UTM, load the geographic coordinates theme first, p roject it to U TM then add the UT M theme. Ca utio nary Note! Ma ke sure th at yo u know the datum of your m ap data!!!

Distance units
The distan ce units are the units used wh en dista nce m easurem ents are m ade and wh en a scale bar is cre ated in a layout. The world data set that you have been using as an example has decimal degrees as the map units and kilometers has been chosen as the distance display units.

Geographic Information Systems: A Primer

Page 48

Projection properties
The projection properties can only be specified when the feature data are in geographic coordinates, that is, longitude -latitude specified in d ecim al degree s. If the originating data are not referenced in decimal degrees, there are a variety of programs which will convert between spatial referencing systems. ArcView also has an extension which performs some o f these conversions (the G eop rocessing exten sion is includ ed w ith ArcView 3.2). To specify or change the map projection click on the Projection button show n in Figure 3.16. The projection p rope rties window, sh own in Figure 3.17, will appear. Figure 3.17 Projection Properties Dialogue Box

By default, the category is Pro jection s of the World and the type is Ge ograp hic.

Geographic Information Systems: A Primer

Page 49

By clicking o n the arrow beside C ategory, a d rop-down list sho ws the options listed in F igure 3.18. Figure 3.18 Projection Types

Figure 3.20 shows the resultant view if the options listed in Figure 3.19 are used. Figure 3.19 The World From Space Projection

Geographic Information Systems: A Primer

Page 50

Figure 3.20

The World From Space

Geographic Information Systems: A Primer

Page 51

3.6 Saving your work


It is a very wise idea to sa ve your wo rk as you go along so that yo u dont have to recreate it every time that you start ArcView. Since work is saved as projects use the following procedure.

Saving for the first time


ArcView has a default project name and a default saving location. It is important, as a part of good project management, that you know exactly where your projects are being saved, the project name and the content of the project. The following procedure should be used the first time you save a project. 1 Make the Project window active. 2 Select File | Save Project As. 3 Specify the project n am e and select a loca tion to sa ve th e project. The Save Project As window is shown in Figure 3.21. It is suggested that you select the subdirectory location first then specify a filename. The .APR will automatically be added to the project name. It is a wise person who saves there project files to two locations regularly during the course of wo rk session. Corrupted AP R files are very difficult to fix.

Subsequent saves
Subsequent saves can be made using the File | Save option the main menu or by choosing the save b utton, . Figure 3.21 Save Project As Dialogue Box

Geographic Information Systems: A Primer

Page 52

3.7 Making transportable projects


Projects contain all the definitions about what is contained in the views, the layouts, scripts and charts that you are working with. There is a complication in transporting a project from one m achine to another or onto other disk drives (floppy or hard). ArcView stores the abs olute location of all the data files in the project file. The project file contains these definitions and not the data itse lf. Consider the following scenario. 1 You create a very small project in the path c:\student\yourname (data files and *.apr file reside there). 2 You copy the contents of this path to a floppy drive (ie. a:) drive. 3 You give the disk to a student and ask her/him to load the project on their machine. In this scenario, the project will NOT load smoothly. You will be asked to specify the location of all the files used in the project! This is called project rebuilding. There are several solutions to this problem but it is important that no attempt to rebuild the project should be completed until you have m ade all altera tions to the project. There are very practica l reasons for having to do a rebuild. Conside r the case wh ere students are creating their projects in the following location

C:\student\studentname
where the studentname subdirectory is going to be different for eve ry stu dent. If you w ishe d to access their projects for grading, you would have to mark them on the machine that they used or recreate the subdirectory on your machine. This is a very inefficient process Also, consider the case where you want to have the students hand in a small project on a floppy disk . Cre ating the project on the flop py to begin with, or vie wing a project save d to a flop py, is very slow (floppy drive access is much slower than hard drive access). Projects should be created on the hard drive then transported to a new location, the project can be rebu ilt or a project can be created w hich isnt drive a nd path specific.

Manual rebuild
A m anual rebuild o f a project is a fairly easy way o f rebuilding the project if the project is fairly simple and doesnt contain too many data sets. The rebuild is carried out as follows: 1 Move (not copy) all the files used in the project to its ne w location. This co uld be a flop py d isk, or a new machine and/or a new subdirectory. 2 Launch ArcView and load the project file.

Geographic Information Systems: A Primer

Page 53

3 Specify the new location of each file when requested. You will have to select them individually from the subdirectory tree. 4 Re save th e project once the project is re built.

Other options
There is many extensions that can be used with ArcView to create transportable projects. They are located at the ESR I web site an d can be down loaded for free. These exten sion s sim ply automates a search and replace function which can be employed using any text processor (e.g. No tepad, WordPad). The use of a text ed itor is a preferred option until you understand the logic behind how ArcView saves projects. The logic of the procedure is outlined as follows. 1 Make a backup copy of your *.apr file and put it in a safe place. DO NO T edit the original without a backup since unrecove rable dam age to the file will necessitate a com plete project reconstruction. 2 Load the *.apr file into a text editor and explore the file using your text editors Find option. For example, perform a find operation on C:/ (note the foreslash , this is a Unix path specification which is different from the common Windows backslash denotation). Repeat this step until you have located all the subdirectories that the project refers to. You may be surprised that you have files all over the place, as a result of less than judiciou s path specification during the project co nstruction. Assume that all the files were located in C:\student\studentname and you wish to make the project run from any folder. 3 Use your text editors search and replace option. The syntax should be similar to the following (note the / instead o f \): Search string C:/student/studentname/ Replacement string A:\n t enter anything!) All references to the original path will be replaced w ith the A:\. 4 Save the file. If you want to make a completely generic project which will run off of any location make the replacement string blank!, In this m anner you can copy all the data files and the project file to any subdirectory on any machine and the project will run.

Geographic Information Systems: A Primer

Page 54

Chapter 4 Working with tables


4.1 Table basics
You can view the contents of a theme's attribute table, once you have an active theme in a view. Use the following steps. 1 Make a View d ocum ent active. 2 Click on the theme of interest in the View's table of contents. 3 Select Them e|Table from the menu or use the O pen Table button, 4 Select the Table to make it active. .

Figure 4.1 shows an active table for the feature theme (world94.shp) used in the previous chapter. As indicated previously, the menu items that are available depend upon what the active feature is. Figure 4.1 Table Co ntents for a Shapefile

Each row in the table is called a Rec ord and each column, a Field. The table can have many fields, or attributes, associated with the features shown on the view. The Shape field indicates that fea ture type (Figure 4 .1 shows a polygo n theme with each polyg on re presenting a country). A numb er of buttons become available to the user, when a table is the active document.. These will be referred to when appropriate.

The total nu mber of records in the table and the number of selected records can be viewe d in the table toolbar below the button bar, as shown below.

Geographic Information Systems: A Primer

Page 55

The buttons on this toolbar are as follows: Point Used to se lect re cords in a ta ble

Table Ed it Only active when the table is in edit mode. Iden tify Produces a summary of the attributes of selected records in a table.

There are a va riety o f menu choices ava ilable wh en a table document is active. Y ou should note that not all options are available at all times. For example, in order to perform operations on a table's field, a field must be selecte d first o therwise the m enu choice w ill be greyed out. Subsequent sections deal with operations on tables.

Geographic Information Systems: A Primer

Page 56

4.2 Working with table records


The Table and View documents provide a dynamic link between the textual/numeric description of the data and its m apped representation. The following assumes you have a n active table with no fields selected. There are several ways to select records in a table. These are grouped by method. Before you begin, select the table to query and open it. To work through these examples, use the world94.dbf file which co ntains the attribute informa tion for world94.shp.

Basic table tools


The tools that you will use when working with tables are summarized below. Details of their use follow. Point Used this tool to manually select records in an active table. This tool is the default, click on it if it isnt or if you want to unselect another tool. To select multiple records, hold down the shift key while you are selecting records. Select All This too l selects a ll reco rds in the active table (equivalent Ed it | Select All) Select None Clears all selected records in an active table (equivalent to Edit | Select None) Switch Selection Switches the current selection to all that werent selected (equivalent to the menu item Edit | Switch Selection) Query Builder Allows you to select records based upon a query (equivalent to Tab le | Que ry. Promote Moves all the selected records to the top of the table (equivalent to Tab le | Pro mote). This does not permanently change the table. Table Ed it This tool is only active when the table is in edit mode. Allows you to edit cell values in a table. Iden tify Produces a summary of the attributes for the selected records in a table.

Geographic Information Systems: A Primer

Page 57

Promoting selected records


Records that are selected from a table (manually or via a query) can be brought to the top of the table by clicking on the promote button, , or by choosing Tab le | Pro mote menu item.

Switching and clearing selections


Switching a record selection is equivalent to performing a NOT operation. For example, if we performed a que ry to select all countries with a population greater than 50 million, you could use the Switch Selection button, to find all countries with population less than 50 million. To . clea r a selection , use the, Select None button,

Geographic Information Systems: A Primer

Page 58

4.3 Modifying table properties


To edit a tables properties, use the following steps. 1 Make the table active (see section 4.1). 2 Select Table|Properties from the menu. A dialog ue box, (Figure 4.2), w ill appear and show the va rious ch aracteristics of the active table. In this window, you can change the title, specify the creator and provide comments. You cannot, however, change the field names but you can also supply an alias to describe the field in more detail (for display in the table). Columns can be made visible or invisible in the table by clicking on/off in the Visible column . If a field is hidden , you m ay not be able to perform operations that use that field. Make fields visible if they are needed for any operation. When you are done making changes, click OK to save the changes. The column width of the table can be changed by moving the cursor over the field names in the table. At the point where two field names meet, you should see a double arrow . If you click and drag, the colum n w idth will ch ange interactively. You should note, that changing the field display width only affects the display and does not alter the underlying table structure. Figure 4.2 Table Properties Dialogue Box

The position of any column can be changed in the display by clicking on the field name and drag ging it to a new loc ation to the left or right of its current position. Again, these chan ges are cosmetic and do not alter the underlying table data structure.

Geographic Information Systems: A Primer

Page 59

4.4 Querying feature themes


Spatial query versus attribute query
There is a link between the features in a theme and the associated attribute information contained in the feature table. There are tw o generic type s of questions that G IS handles quite we ll: What is at....? This is a spatial query question since we wish to query the map theme to find information about the attributes for that location. Where is...? This is an attribute query question sinc e w e w ant the loca tion(s) w here certain characteristics or condition s exist. There are a couple of tools th at will allow you to quick ly perform both spatial an d attribute queries.

Simple spatial query


There are a va riety o f ways to perform a spatial qu ery. The m ethod given here allow s you to find attribute information without opening the theme table. To quickly access this information about a feature, use the following procedure. 1 Select the theme in the View window. 2 Click on the feature in the View window with the Iden tify tool, .

A summary of the attributes for the selected feature will appear in an Iden tify Re sults window. The types of variables contained in the table will be listed as well as their values. Every time you select a new feature with the Iden tify tool, more records will be added to the table. Selected queries or all queries can be removed by clicking on Clear or Clear All in the Identify R esults window. When you are done exploring the theme, simply close the window.

Geographic Information Systems: A Primer

Page 60

This method is quick and allows you to encapsulate all the information about a feature in a simple tabular form. It is difficult, however, to compare the attributes of the selected features since only one features attributes will be listed at a time.

Simple attribute query


The Find button, , can be used to query an active theme based upon the attributes contained in its table. To find features in a View that meet certain conditions, use the following procedure. 1 Select a theme to query in a view by clicking on it in the view windows legend. 2 Click on the Find button.

A Find window will appear on screen as shown here.

3 Type in the search condition and click on OK. The search condition may be a number or a string. For example, assume that you have a building theme which lists building function in a table. If the string City Ha ll is typed in the Find window, the database will be searched for the first occurrence of this string. If City Ha ll is found in one of the fields, the feature will be highlighted in yellow on the view. This type of query will only be of use when most features in the theme are unique. If we performed the query using the string fire station only the first found station would be located even though there may be several of them within the theme.

Spatial query involving two themes


The re are several classes of sp atial query w hen two them es are invo lved. T he classe s of query can be considered a series of generic questions which relate to the feature types of the two themes involved. In ArcView, these questions are denoted as Select by Theme operations and the generic questions and ArcView options are listed below.

Containment

completely w ithin point in polygon are completely w ithin line in polygon are completely w ithin polygon in polygon are completely within, completely contain (surround) partial containment intersect

Intersect
points to lines

Geographic Information Systems: A Primer

Page 61

lines to lines lines to polygons polygons to polygons

intersect intersect have their center in, contain the center of, intersect

Proximity

nearness without touching point to point are within a distance of (distance specified) point to line point to polygon line to polygon polygon to polygon nearness and touching lines to polygons Are within a distance of 0 lines to lines polygons to polygons

Adjacency

The two themes involved in a query are denoted as the : Target theme This is the theme that you wish to query. It may contain all features in the theme or previously selected features. Make the them e active before performing the query. Selector Theme This is the theme that you wish to use to select features in the target theme. This may contain all the features in a theme or previously selected features.

Example
How many fire hydrants are there within Kanata? Given a map showing point locations of the hydrants and a census subdivision map (CSD) of Regional Municipality of OttawaCarleton which contains Kanata's boundaries. The hydrant map is the target theme and CSD map is the selector map but Kanata must be selected or queried for before the analysis is started. To perform such a query, use the following steps. 1 Ma ke your target theme active. 2 Select Theme | Select by theme to reveal the following dialogue box

Geographic Information Systems: A Primer

Page 62

3 Select your Selector Theme first in the selected features of area, then choose the selection method in the Select features of active themes that area. 4 Choose New Set 5 Refine a selection by using the Add to Set or Select from Set options. Section 4.3 covers more advanced attribute query options involving the combined use of views of a theme and the theme attribute table. Section 4.7 discusses the spatial join which also allows you to answer certain types of questions.

Geographic Information Systems: A Primer

Page 63

4.5 Using the query builder


It is possible to query all or selected features in a theme. It is important that you know what you are querying since you are given no warning that records are selected in a table other than a visual clue. Selected features are highlighted in yellow in a View and in the theme's table.

Querying all features


To query all features in a theme, hence, all the records in its table, use the following procedure: 1 Select the theme to query in a View or select the theme's table. 2 Click on the Select None button, document is active) , ( it is called Clear selected features if a View

Querying selected features


If you wish to compare the attributes of several selected features, use the following procedure: 1 Select the theme you wish to query in a View. 2 Click on the Select Feature tool, .

3 Click on the feature to query, or hold the Shift key down and click on seve ral features to query. 4 Click on the Op en Them e Table button, , or choose the Them e | Table menu item . The theme's table will now appear and the selected feature(s) will be highlighted in yellow. 5 Click on the Promote button, , to move the selected records to the top of the table.

As an alternative, you can open the theme's Table document and click on records in the table.

Defining a query based upon attributes


The Q uery Builde r, , allows you to select features in a theme that meet certain .This button launches a dialogue box, (Figure 4.2), that permits you to define your query. If the Up date Values check box is checked, a list of unique values found in the selecte d field will appear in the Values area of the window.

Geographic Information Systems: A Primer

Page 64

Figure 4.2 Query Builder Dialogue Box

The query is constructed by typing in an expression or by using the following steps. 1 Doub le-click on the Field to query. 2 Sing le click on the ope rator to u se (e.g. -, +, / <=, and, not ...). 3 Double-click on a value (or type it in yourself). 4 Select the New Set button in the window.

Using wildcards in queries


There are two different kind s of wildcards wh ich c an be used in qu eries: * This symbol in a q uery m eans that the preceding or follow ing characters can be anything. The number of characters represented by the * is no t imp ortant.

? This symbol represents a position sensitive wildcard. Any character can occupy the space. Yo u mu st use as m any ? as are ne ede d to represent the wildcard positions as are necessa ry. Here are some examples of valid queries for the world94.dbf file which contains a Pr_pop2000 (projected year 2000 population) and an Abbrevname (country name) field. 1 Locate Canada in the database. ( [Abbrevname] = C anada ) 2 Find all countries starting with a C ([Abbrevname] = c* )

Geographic Information Systems: A Primer

Page 65

3 Find all countries with a projected population greater than 50 million. ([Pr_pop2000] > 50000000) 4 Find all countries which have a as the second letter of their name. ([Abbrevname] = ?a*) 5 Find all countries which begin with a C and have a population greater than 50 million. ([Abbrevname] = c*) and ([Pr_pop2000] > 50000000) There are a myriad of possible query types. Refer to the help menus. You should note, howe ver, that calcula tions ca n also b e performed within a query. This remove s the need to create a separate column of results prior to querying. In the previous examples, the procedure entailed selecting New Set in the dialogue box shown in Figure 4.2 to complete the query. It is possible to perform step-by-ste p queries that build upon simple queries by using the Add To Set and/or the Select From Set after an initial query has been completed. For example, the query noted in number 5 above, to select all the countries starting with the letter C that have a po pulation greater than 50 million, could have been accomplished by performing query 2 (New Set) first then performing query 3 and using the Select From Set button.

Geographic Information Systems: A Primer

Page 66

4.6 Working with fields in a table


In the previous se ction , basic q uery tas ks w ere introduced. O ften you r focus is on one field within tha t table. For exam ple, you may w ish to obtain an alphabetical listing of the countries in the wo rld94.dbf table or to produce a statistical su mmary of life e xpe ctancy da ta. To perform operations on a field within a table, use the following procedure: 1 Select the field to work on by clicking on its fieldname in the table. 2 Select Field from the m ain m enu . The following m enu option s will appear.

3 select fro m the drop-dow n list. Many of these menu options have button equivalents.

Sorting records
To sort records in a table based upon a field, use the following procedure. 1 Open a theme table. 2 Click on the fieldname to be used as the sort field. 3 Select the sorting preference from Field menu or use the following buttons. Sort Ascending Sorts all the records in the selected field in ascending order or sorts the selected records according to the selected field. Sort Descending Sorts all the records in the selected field in descending order or sorts the selected records according to the selected field.

Geographic Information Systems: A Primer

Page 67

Summary statistics
Summary statistics can be obtained for all records, or selected records, in a n um eric field. 1 Open a theme's table, 2 Select a field to summarize. 3 Select Field|Statistics from the menu. A sample output follows:

You can select re cords ahead of time by selecting them in the table or by p erforming a query. If records are selected, the statistical summary is for those entries.

Summarizing records
You can summarize records in one field based upon the values in another field. Use the following procedure. 1 Select a field nam e to sum ma rize (the primary field). 2 Select Field | Sum marize or 3 Click on the Sum marize button, .

The Summ ary Table Definition dialog ue b ox, as shown below, w ill appear.

Geographic Information Systems: A Primer

Page 68

4 Specify a filename and path by clicking on the Save As button. Many people om it this step and end up losing valuable inform ation because they don't save it in an appropriate location or use the default name which isn't informative to the summary operation being determined. 5 Select the secondary field to use in the summary by toggling the Field combobox. 6 Click on OK If the secondary field is the Shape field, then the only option available is Merge. This allows you me rge features of the sam e type . See the help files u nde r Merge Operations for more detailed information. If the secondary field is a string field, then the only options are First and Last which will find the first and last record respectively during the summary operation. If the secondary field is numeric, a variety of statistical parameters can be calculated. These include average, sum, minimum, maximum , standard deviation, first, last and count. You may select the Add button to add more than one summary option to the output. You can summarize selected records in a database by choosing them first then selecting the summary field followed by a summarize. The pow er of this sum mary operation becomes readily apparent when yo u have tabular data in the

Geographic Information Systems: A Primer

Page 69

4.7 Editing tables


ArcView tables ca n be easily edited allow ing you to ch ange cell values and add or delete records or fields. You can perform a variety of text, logical and/or mathematical operations on existing fields. These operations can also be used to produce values for new fields. These operations will be explained in subsequent sections. To edit a tab le, us e the following procedure. 1 Click on the table to edit to make it active. 2 Choose Tab le | Start Edits from the main menu. 3 Choose Ed it from the main menu. The permitted editing options are shown in Figure 4.6. The available options will depend upon whether the w hole table is selected or a record or field is active. O ptions not perm itted are greyed out. 4 Use the Edit too l , and click on a cell in the table to e dit the entry for any rec ord in a fie ld.

5 Save your edits using Tab le|Save E dits Table|Save Edits As to save to the original file or if a different filename is desired. Figure 4.6 Menu Options When Editing a Table

Geographic Information Systems: A Primer

Page 70

Adding fields
To add a field to an existing table, make sure that the table is in edit mode (Tab le|Start Editing). A field can be added and its characteristics specified, as follows. 1 Select Ed it|Ad d Field from the main menu The Field Definition dialog (Figure 4.7), will appear. Figure 4.7 Field Definition Dialogue Box

The following information needs to be specified. 2 Specify the Name: of the field 3 Specify the Type: from the choice of Number, String, Boolean or String 4 Specify the Width: of the field and 5 Specify the Decimal Places: if the d ata are numeric 6 click OK to create the field. The new field will be created and added to the end of the list in the active table. The position of the field, for visual purposes, can be moved. It should be noted, that you cannot change the characteristics of a field after it is created. The field must be deleted and re-created using the appropriate information.

Geographic Information Systems: A Primer

Page 71

4.8 Calculating values for a field


In order to calculate values for a field, get the table into edit mode, perform the ca lculation, save the edits an d then end the edit se ssio n. There are a variety of situations that a calculated field may be desirable. For example, you may have a soils database containing various soils characteristics which can be used to model the potential for soil erosion using an equation. A soil erosivity field could be added and values for the records in th is field can be calcu lated using information in the other fields. Another use of calculated fields can arise when you wish to combine two databases but the data tables dont have a common key field (used to link the tables). To combine the attributes of both files, produce a common key field first, the n join the tables to gether. Use the following steps to calculate values for a field added to an active table. 1 Get the table in edit mode. 2 Add the desired field, specifying the field typ e, its w idth and num eric precision if applicable. 2 Click on the new field to make it active. 3 Click on the Calculate button, , to launch the Field Ca lculator.

4 Click on OK when you are done calculating values for the new field: 5 Select Table|Stop Editing and specify if you want to save or abandon your edits.

The field calculator is shown in Figure 4.8. Figure 4.8 Field Calculator Dialogue Box

Geographic Information Systems: A Primer

Page 72

The field calcula tor allows you to create exp ression s inte ractively using the values in the data fields, other numeric or string values, a variety of data types and many different requests. You can build a simple expression, such as adding a single value to a field, or more complex ones such as assigning a new classification scheme to existing data. Detailed information on the field calculator can be found in the help menus. Consider the table s how n in Figure 4.9. This tab le contains earthqua ke m agn itude d ata for a variety of dates. The date field is a string field and, in its current form, it isn't very useful for obtaining data summ aries. The following demonstrates how to add a new field to the table so that the date information can be readily used. Figure 4.9 Sample d ata

The procedure for adding fields to a table, outlined previously was used. A numeric field, with a column width of 5 and 0 decimal places was added to the table. The field was named Year. Values for this field were calculated using the following expression:

[Date].Left(4).AsNumber
In this example, the string field called Date was queried. The left-most 4 ch aracters w ere strippe d from the data in the field and converted to a num ber. The re sults are shown in Figure 4.10. Figure 4.10 Values for a new field

Geographic Information Systems: A Primer

Page 73

Other requests that operate on string fields can be obtained from the Help files. In our exam ple, the beginning 4 characters w ere stripp ed from the string . This is fine if the date information has a consistent format. What if some of the records were in the form 92/05/19? Stripping the first 4 characters using the above exp ression wo uld result in a string of 92/0 which would produce an error message "can't convert string to num ber: 92/0". This error message arises because the string contains text which the .asNumber request ca n't pro cess. A more generic expression can be used since the year, month and day are all separated by the / separator. The AsToken request subdivides a string, based upon a specified separator, and returns a list of values derived from the original string. The expression

[Date].AsTokens("/").Get(0).AsNumber
subdivides the date string into 3 separate entities, for example 1992/05/01 becomes a list containing { 1992, 05, 01 }. The Get(0) request indicates that the first value in the list is to be obtained (lists are indexed beginning at position 0 and ending at position N1 w here N is the list size). The AsNum ber request converts the extracted string to a number if it is possible. A num ber of useful strin g requests are shown in the follow ing table. For a more exte nsive list, consult the Help files under the Index tab for the String(Class) entry. Other requests will be presented in subsequent sections.

String Requests
Request AsNumber AsT okens(sepa rator) Extract(position) Purpose converts a string representation of a number to a number produces a list of values using a separator to denote separate list entities. extra cts a wo rd from a string wh ere each wo rd w ithin th e string is separated by one or more blank spaces (ie. "my string" has two wo rds, the wo rd at position 0 is "my" and the wo rd at position 1 is "string") extract the left-most characters specified by aNumber extracts aNumber of characters from a string beginning at the offSet position extract the right-most characters specified by aNumber

Left(aNumb er) Middle(offSet, aN um ber) Righ t(aNum ber)

4.9 Data reclassification


Geographic Information Systems: A Primer Page 74

Reclassification of a data field into a new field is a practical use of the field calculator. To reclassify a fields values in a new field, use the following syntax. [Source Field].Substitute("original class","new c lass") where [Source Fie ld] "original class" "new class" the field containing the original reclassification the original class value the new class value

For example, assume that you have a theme showing landuse classes. The field that we wish to transform is called Description and we want to create a new field called DescNum ber. To change a WETLAND clas s to a num eric value of 1. Create the a numeric field called DescNum ber. Ge t the table into edit mo de, make the new field a ctive, laun ch the field calcula tor and enter the following exp ression . [Description].Substitute("WETLA ND","1") All the WETLAND entries in the Description field will be reclassed to a value of 1 in the DescNum ber field.

If you have many classes to change, then you can use a small Avenue script to make the change s. As an e xam ple, as sum e that you w ant to add a field to th e table shown in Figure 4.10. We want the m onth to be expressed a s text and n ot as a nu mb er. The pro cedure requires a bit of work so use the following procedure. 1 Get the table into edit mode. 2 Add a new field to the table called [Month] and make it a string field with a suitable width. Use the following exp ression to ca lcula te va lues for it: [Date].AsTokens("/").Get(1) This will return string value as shown in Figure 4.11. 3 Load, compile and run the script below from the active [Month] field.

Geographic Information Systems: A Primer

Page 75

'Re clas sField theTable=av.GetActiveDoc theVtab=theTable.GetVtab theField=theTable.GetA ctive Field 'format: change the fromLists and toLists to match your desired output ' fromL ist={"a","b","c"} ' toList={"m yA","m yB","m yC"} fromL ist={"01","02","03","04","05","06","07","08","09","10","11","12"} toList ={"Jan","F eb","M ar","Apr","M ay","Jun","Jul","Aug","S ep","O ct","Nov","Dec"} for each rec in theVtab theVal=theVtab.ReturnValue(theField,Rec) theIndex=fro mList.FindB yValue(theV al) theVtab .SetV alue(theF ield,Rec ,toList.Get(theIndex)) end theT able.Ge tWin.Inva lidate

The script does not check for errors, so m ake sure that it run from the field th at yo u w ant to reclassify in a table in edit mode. The two operative lines fromList and toList can be changed to suit any reclassification needs, with the caveat, that the two lists need to be the same size. 4 If you are satisfied with the results, save the edits. The resultant table is show n in Figure 4.12. Figure 4.11 Initial classification Figure 4.12 Final reclassification

Geographic Information Systems: A Primer

Page 76

4.10 Combining tables


In order to combine data from one file to another, you need have two *.dbf files which contain a common column of data. For example, if you wish to join census data, each file must have a census division (CD), census tract (CT) or enumeration area (EA) code which contains the same keys in both files. In order to join the data from one file with another, use the following steps. The contents of the Source table will be added to the D estination table during the join operation 1 Open both tables and arrange on-screen. 2 Make the Source table active, then click on the common fieldname. 3 Make the Destination table active, then click on the common fieldname. 4 Select Table|Join menu item. Joins are not permanent and can be removed by selecting Table|Remove A ll Joins menu item .Join's can be made perm anent, the procedure depends upon the nature of the tables in question. For example, if you join a table to the table of a shapefile, then: 1 Select the Theme in the View which has a table joined to its table. 2 Select the Theme|Convert to Shapefile menu item . 3 Specify a new shapefile name and a saving location. If a table is joined to another table and shape information doesn't exist or isn't needed, then use the following procedure: 1 Select th e Table docum ent which h as information joined to it. 2 Select the File|Exp ort menu item. 3 Specify the table e xport format (usually dBase). 4 Specify a new name and saving location. 5 You can add the new table to the project by selecting the Table|Add from the project window. The flow chart, Editing Existing Tables, shows some of the considerations in graphical form as they rela te to table editing . The flow chart, Joining Tables: Appending Attributes to a Theme Table, summarizes the procedure for combining tables from different sources.

Geographic Information Systems: A Primer

Page 77

Geographic Information Systems: A Primer

Page 78

Geographic Information Systems: A Primer

Page 79

4.11 The spatial join


A Sp atial Join is a special type of table join that uses the Shape field as the joining (co mm on) field. T his is the type of join to use wh en spatial proxim ity is of interest. Spatial joins can be made using the tables of point, line or polygon themes. Table 4.1 lists the types of spatial joins that can be performed.

Table 4.1

Spatial Join Relationships Between Feature Themes Destination Table

Point

Line

Polygon

So urc e Table Point Line Polygon nearest nearest N/A nearest part of N/A inside inside inside

Nearest
When the So urc e Table is a point theme and the De stination Table is either a point or a line theme, then the attributes for the nearest feature in the destination table will be appended to the appropriate record in the source table. Also, a dista nce field is ad ded to the destina tion table and the crow-flies distance is calculated, in the view distance units, for each feature. Consider the example where you have a point theme show ing fire hydrant locations (source table) and a point theme of houses (destination table). If the spatial join is performed, then the attributes for the fire hydrant closest to each house will be appended to the house theme.

Inside
You can also perform point-in-polygon or line-in-polygon or polygon-in-polygon queries when the source is either a point, line or a polygon theme and the destination theme is a polyg on them e. For examp le, all the roads (line theme ) within a particu lar municipality (a polygon within a polygon theme) can be identified and extracted.

Part of
If both the source and destination themes are lines, then the spatial joins determine which line features in the source theme are part of the line features in the destination theme. This type of operation could be used to compare two incarnations of road theme originating from different sources.

To perform a Spatial Join in ArcView,

Geographic Information Systems: A Primer

Page 80

1 open the attribute tables for the themes to use in the spatial join, 2 activate the Source table (e .g., the one you w ant to join to the other table), 3 click on its Shape field heading, 4 activate the De stina tion table (i.e., th e table wh ich w ill be re ceiving the join), c lick on its Shape field heading and 5 select the Table|Join menu or click the join b utton, . On ce completed, the source table will be joined to the destination table. The source table automatically closes upon completion.

Geographic Information Systems: A Primer

Page 81

Chapter 5 Working with feature themes


5.1 Create new themes or edit existing themes
ArcView provides a simple approach to create a new theme from scratch, or to edit an existing one. Proceed to either the Create a New Theme or Edit an Existing Theme section then follow the Add Features to the Theme.

Create a new theme


The following steps describe the procedure. 1 Make a View document active or open a new one. 2 Select the View|New Theme menu item. 3 Choose the feature type (point, line or polygon) and click OK. Remem ber, you can only have one feature type in a theme. 4 Specify the path and filename for the new theme that you are creating.

Once the theme information is obtained, the theme is automatically placed in edit mode.

Edit an existing theme


To edit an existing theme, use the following procedure. 1 Make a View document active. 2 Select the theme to edit by clicking on it in the Views table of contents. 3 Select the Theme|Start Editing menu item . A dashed line will appear around the them es check box in the View's table of contents. This indicates that the theme is in edit mode.

Geographic Information Systems: A Primer

Page 82

Add features to a theme


Once you have created a new theme or opened an existing theme in edit mode, you are now ready to add features to the theme. To add features to a theme, you need to select the Draw tool, which displays a point by default, as shown in Figure 5.1. Figure 5.1 Tools For Creating Themes

If you click and hold the mouse on this to ol, a d rop-down list of available drawing tools w ill appear. Figure 5.2 shows the available options describing the function of the various tools. Some of the tools will be disabled depending upon whether the theme is a polygon, line or point theme. To add features to the theme: 1 Select the Draw tool from the button bar and choose the appropriate drawing tool. Select the point tool to draw point locations, the line tool to draw linear features and the polygon too draw areal features (see Figures 5.1 and 5.2). Squares and circles can also be drawn with the appropriate tools.

Geographic Information Systems: A Primer

Page 83

Figure 5.2 Draw Tool Drop-down Menu

2 Click the left mouse button to add to the theme. Single-click to add a point to a point theme or a vertex to a line or a polygon theme. Doubleclick to add the end node to a line or to complete a polygon. 3 Select the Theme|Stop Editing menu item wh en you are done editing o r creating the them e. Save your changes if you are satisified. There are editing to ols to split lines or polygons to create separate entities. T he user should note that the append polygon to existing polygon tool should be used when making polygon themes to ensure that adjoining polygons are closed and do not overlap or form slivers at polygon boundaries. The next sections describe how to add attribute information to themes and how to edit existing themes.

Geographic Information Systems: A Primer

Page 84

5.2 Editing feature position or appearance


Sometimes feature locations need to be altered or deleted. To edit features, use the following steps. 1 Select a theme in an active view by clicking on it in the views table of contents. 2 Choose the Theme | Start Editing menu item to begin an edit session.

Move or delete features


To move or delete a feature in a theme, select the Pointer tool, , and select the entity that you wish to edit. To select more than one feature at a time, hold the Shift key do wn wh ile selecting. To move a feature, hold down the left mouse button and drag the point to its new location. To delete a feature, press the Delete key. To undo edits, select the Ed it|Un do Ed it menu item. When you are done editing, select the Theme|Stop Editing menu item . You have the option to save or discard your edits.

Modifying the shape of line and polygon features


Line and polygon features can be edited further in that their shape can be modified. For example, you may have done some on-screen digitizing and the appearance of a line segment or a polygons shape isnt quite correct. When you are in edit mode, you can change the feature position and/or geometry using the following procedure: Reposition features 1 Use the pointer tool, to ch oose the feature to edit.

2 Move the selected feature to its new location by dragging it with the mouse. Resize or reshape features On ly line or polygon themes can be resize d or reshaped. 1 Select th e feature to edit with the verte x edit tool, vertices defining the selected feature. . Square handles will appear on the

2 To change the selected feature shape, drag existing vertices to new locations or click on the line segments to add new vertices to the feature. To delete a vertex from a feature, position the cursor over the desired vertex and hit the delete key.

Geographic Information Systems: A Primer

Page 85

Combine, merge or union features in a theme


The terms combine, merge or union in this usage, refers to creating a larger feature from smaller ones. There are parameters which need to be specified when deciding how the attributes are to be dealt with du ring the union procedure. These will be discu sse d later. You can also create multi-part features by unioning features which do not share a common boundary. For example, if you union polygons of the same type which dont touch, you create a multi-part polygon which occupies one record in the feature table. To combine features together, get into edit mode, then select the Theme|Union Features menu item for line or polygon themes or the Theme|Com bine Features choice for polygon features.

Geographic Information Systems: A Primer

Page 86

5.3 Adding attributes to a theme


When yo u add points, lines or polygons to a them e, ArcView adds a record to the themes attribute table which has only one field called Shape. This field cannot be edited and stores the feature type. Undoubtedly other information needs to be added to the theme to describe the attributes of the entities. You can create other fields in the theme table to include such characteristics as the number, type and/or other descriptors. To include this information, use the following steps. 1 Select the Theme|Start Editing menu item (A dashed line around the themes check box indicates tha t the the me is in edit mod e). 2 Click on the Op en|Them e Table button. 3 Select the Ed it|Ad d Field menu item . Specify the field n am e, the field type and the field width. Click on OK to add the field to the attribute table. Repeat this p rocess for each field that you wish to add. Entering values in the field(s) that you have created involves the following steps. 1 Make the View active by clicking on it then select the Pointer tool, feature that you wish to describe. , and select the

2 Make the Table active by clicking on it. The record for the selected feature will be highlighted in the table. 3 Click on the Edit tool, , and click on the record in the field that you wish to add information to, then add in the necessary data. 4 When you are done, select the Edit|Stop Editing menu item and choose Yes to save your edits or No to discard changes.

Geographic Information Systems: A Primer

Page 87

5.4 Maintenance operations involving single feature themes


Many routine data operations become difficult because individuals dont know the correct buzz word. They spend countless hours looking for menu items or scripts to perform the desired task. This section lists many of the maintenance operations that can be performed on a theme.

Copy a feature theme


Copy means to produce a duplicate version of an existing shapefile. Copying can of course be performed within Windows Explorer but you can also copy within ArcView. The filename can be maintained or changed and a new save location can be specified. To perform a copy, use the following procedure: 1 Make the theme to copy active in a view. 2 Select Them e|Convert to S hapefile from the menu. 3 Specify the new files save location, then, specify the filename to use. If you have the Spatial Analyst extension loaded, you can copy a file by selecting File | Manage Data Sources | Copy from the menu of the Project document. The theme you wish to copy, however, cannot be active in the project. D elete the them e from the view and delete any ta bles from the Table document before using this option.

Deleting a feature theme


You cannot directly delete a shapefile from disk from within ArcView (unless you use Avenue scripts). Use Windows Explorer to perform this task but do not attempt this if you have ArcView running and the theme is being used in the current project. If you have the Spatial Analyst extension loaded, then select File | M ana ge D ata S ources | Delete from the m ain m enu . The sam e conditions as specified unde r Copy apply.

Renaming a feature theme


A shapefile cannot be renamed directly from within ArcView, however, you can create a new shapefile w ith a differe nt name following the procedu re specified und er Copy. The original file can be deleted using Window s Explorer (once it ha s been remove d from the active project). If you have the Spatial Analyst extension loaded, select File | Manage Data Sources | Rename from the m ain m enu to renam e. The conditions specified und er Copy apply.

Geographic Information Systems: A Primer

Page 88

Saving a feature theme


The term Save usually applies to keeping the chan ges/additions to a shapefile that you are editing. To save a file that you are editing, use the following procedure. 1 Select the theme you are editing in the view, if it is not already active. 2 Select Them e|Sa ve E dits, from the main menu to save the file with its existing name or Select Theme|Save Edits As to save the feature theme you are editing with a different filename.

Geographic Information Systems: A Primer

Page 89

5.5 Create feature themes from tabular data Create dBase (*.dbf) files
You can create dBase (*.dbf) files directly within ArcView, however, if you are creating a large database and/or need to do extensive editing on an existing one, it is preferable to use a standalone program to perform the tasks of creating and editing the table. It is beyond the limits of this introduction to cover all possible programs to do this, however, some general guidelines for the creation of *.dbf form atted data are given below. You can create *.dbf files using database programs (dBase, Access, Paradox etc) and spreadsheets (Quattro Pro, Excel). Spreadsheets are more readily available to users than database program s, so here are som e general rules for creating *.dbf files w ithin a spreadsheet. 1 The first row in the spreadsheet m ust contain the field n am es for each va riable. The field names must be 10 or fewer characters in length and they cannot contain any special punctuation c hara cters, spaces or other sym bols. (Limit yourself to the 26 letters of the alphabet, the underscore, _, or num bers and you will have no problems.) 2 Format the fields explicitly, this includes, the data type, the field width and the number of decim al place s if ap propriate. Do not rely upon a field 's appearance to dicta te how it will appear in the dBase file since some spreadsheets don't handle export very well. (see step 7) 3 Subseque nt row s (records) contain the attribute inform ation you w ish to store for a loca tion. There should be no blank rows between records or between the first row (the field names) and the second (the first record in the database). 4 Your data must reside on one page in the spreadsheet. This can limit the number of records than you can process at once. (Note Quattro Pro V9 and above handles about 1,000,000 records per page while earlier versions handle about 8,000 records.) 5 Complete the data entry and editing in your choice of program

Geographic Information Systems: A Primer

Page 90

Figure 5.3 show s a sample spreadsheet. Figure 5.3 Sample S preads hee t Contain ing E ven t Them e Data

This spreadsheet simply contains the X, Y coordinates (longitude-latitude) for bird nesting sites with two attribute fields defining the type of bird and the number of eggs found. Simply add the records to the table then proceed to step 6. 6 Access th e column properties for the spreadsheet. Generally you can right-click on the column letter to access the column properties (see Figure 5.4).

Geographic Information Systems: A Primer

Page 91

Figure 5.4 Accessing the Column Properties

7 Form at the column width explicitly as shown in Figure 5.5 (Q uattro Pro V9 sam ple). Figure 5.5 Accessing Column Properties

Geographic Information Systems: A Primer

Page 92

Specify a column w idth so that there is no truncation of data. Do not assume that automatic formatting of the spreadsheet will translate to the exported *.dbf file. 7 Specify the numeric form at of fields that contain num eric data. You should specify the number of decima l places exp licitly, since some spreadsheets handle *.dbf export better than others.

If you need a specific num ber of decima l places for num eric data, sp ecify it. In this spreadsheet, yo u select Numb er then choose the value to place in the Enter number of decimal places (other spreadsheets have a Fixed option which allows similar functionality).

Geographic Information Systems: A Primer

Page 93

8 When yo u are done creating/editing/fo rmatting the spreadsheet, co nve rt it to a *.dbf file using the following procedure (see Figure 5.7). a Select File | Save As from the main menu in the spreadsheet. b Select a *.DBF output form at (dB ASE IV). c Specify a file name and the *.dbf exte nsion will be added.

Figure 5.7 Exporting to *.dbf Format

At this stage, some programs open a dialogue box allowing you to confirm the output format for each field o f data (see Figure 5.8. Qu attro Pro V9 sample). Figure 5.8 Specifying *.dbf Field Format

Geographic Information Systems: A Primer

Page 94

It is highly re commended that yo u confirm the form at. The dBase file form at can now b e used as an even t theme or as a table for joining /linking to another feature table.

Other options
You can also export your spreadsheet data files to comm a separated values (CSV) files as well by selecting the CSV option in step 8 in the previous section. A comma-separated values file will look like the following if view ed in a te xt ed itor. Longitude,Latitude,BirdType,NumEggs -75.6723,45.1215,sparrow,3 -75.6738,45.1319,robin,4 Each entry for a field is separated by a comma and each record is a row in the table. You should note that most programs will save the file with a *.CSV extension. This extension must be changed to *.TXT before it can be used within ArcView. Use your system's operating system (e.g. via Windows Explorer) to change the file extension.

Geographic Information Systems: A Primer

Page 95

Adding event themes


Event themes are dBase, INFO or delimited text files which contain positional and associated attribute information for a series of points. In the previous section, a file containing information about bird nesting sites was created which contained an X field (e .g. an easting or longitude), a Y field (e .g. a northing or latitud e) and associate d field s for the attributes found at the sites. This table can be added to an ArcView project and shown in a view window. Use the following procedure: 1 Make the Project document active. 2 Select Pro ject|Ad d Table from the menu. 3 Specify the table type to add (dBase (*.dbf), INFO, delimited text (*.txt)) and locate the table in the appropriate folder, as shown in Figure 5.9. Click on OK when you have located the table. Figure 5.9 Ad ding an E vent T heme Table

Geographic Information Systems: A Primer

Page 96

The table should appear, as shown in figure 5.10. Figure 5.10 Event Th em e Table

4 Create a new View window or open an existing one. 5 Select View | Add Event Theme and select the table you added in step 3. 6 Specify the X field and Y field, field names as shown below. Figure 5.11 Add Event Theme Window

These fields contain the numeric coordinate information. In this example, X is longitude and Y is latitude. By default, ArcView looks for certain key words such as Easting, Northing, X, Y,

Geographic Information Systems: A Primer

Page 97

Latitude or Longitude. You can select a ny field nam e but use conve ntional names if pos sible to avoid confusion. 7 Select Them e | Convert to S hapefile from the main menu. Even though the point information will appear on screen after step 6 is completed, it is a good idea to conve rt you r tabular eve nt them e to a conventional sh apefile. A shapefile a nd its tab le are dynamically linked so that records selected in the table will appear highlighted in a view or records se lecte d in a view w ill be highlighte d in the table. Even t themes do not have a dyn am ic link.

Geographic Information Systems: A Primer

Page 98

5.6 Using ARC/INFO interchange (*.E00) data


The Import71 utility allows you to impo rt ARC/INFO interchange format files. These files have a *.E0 0 extension (the y may have an e 01, e02 e tc if they are pa rt of a zipped com pilation list). The procedure for getting these files into shapefiles is a two stage process. First, use the Import71 utility to convert the *.E00 files to ARC/INFO coverages then second, convert the coverag e to a shapefile. The p rocedure s are fairly straigh tforwa rd 1 Launch the Import71 utility from the ESRI program group (from Start in current Windows operating systems, follow the menu tree Program | ESRI | ArView GIS 3.2 | Import71. 2 Specify the export filenam e or use the Browse bu tton to locate it interactively. 3 Specify the location and name for the coverage to be created (Note: Do not specify an extension. The module will create an info and coverage subdirectory containing all the necessary information. Figure 5.12 Imp ort71 Utility

4 Click on OK when you are done. For example, consider the conversion of a file called Arcinfo.e00 to a shapefile. When Import71 was run the following was specified: Export filename: c:\junk\arcinfo.e00

Output Data Source: c:\junk\arcinfo The utility creates two subdirectories in c:\junk path, one called arcin fo and the other called info. The cove rage data can be used directly in A rcView, howe ver, you may w ish to keep all the data sets in a p roject in a shapefile fo rmat. To finish the conversion from .e00 files to shapefiles use the following procedure.

Geographic Information Systems: A Primer

Page 99

Adding the coverage to a view


Add the coverage(s) to a view by selecting View | Add Theme from the main menu or the add theme button, .

Figure 5.14 shows the results of our previous conversion. In the c:\junk directory is an ARC/INFO coverag e which is den oted by a folder. Figure 5.14 ARC/INFO Coverage

If you click on the folde r, the ava ilable feature themes are show n as in th e Figure 5.15. In this case, a polygon, annotation and a labelpoint theme (a labelpoint is a point used by ARC/INFO used to identify each polygon) are available. Figure 5.15 Co vera ge C ontents

Hold the shift key down and select the three listed themes. The resultant view shows that the point theme has been made visible.

Geographic Information Systems: A Primer

Page 100

Figure 5.16

A Point Theme from an ARC/INFO Coverage

Converting a coverage to a shapefile


To c onvert a coverage to a shap efile, use the following procedu re 1 Click on the theme in the view legend that you wish to convert to a shapefile. 2 Select Them e|Convert to S hapefile from the menu. Specify a location and filename as requested. 3 Click in the check box to make the shapefile visible.

Clean-up following conversion


If you intend to work exclusively with shapefiles, it is a good idea to clean-up after the conversion procedure. The procedure first requires that you delete all coverages in the view using the following procedure. Select a coverage by clicking on it in the view legend. Delete the coverage by selecting Edit | Delete Theme from the main menu.

Repeat this process until all coverages are removed from the view The second step requires that you use Windows Explorer to navigate to the location where the .e00 files and coverages reside. Delete the .e00 files and the info and coverage subdirectories (in our examp le, this would be a n arcinfo su bdirectory).

Geographic Information Systems: A Primer

Page 101

5.7 Revisiting systems of units, datums and projections


As if all too often the case, you obtain data sets with no accompanying metadata. The system of spatial referencing, the datum a nd/or the file extent (i.e. the bou nding rectangle) are completely unknown. As a preliminary step in creating any ArcView project you need to add the themes to a view, to determine the system of spatial referencing used when the data set was created. Problems arise when different themes are in different systems of spatial referencing, for example, you may have a theme which was created using geographic coordinates and another using UTM coordinates. How many of you have added two such themes to a view, toggled them on and only seen one? Your next move was, logically, to select the zoom to full extent button. What happened then...right...everything vanishes, or at best you have squiggles in one area of the view and squiggles in another. You must step back and determine the system of spatial referencing and the extent of the feature themes. Once these are established these, you can proceed on with processing the ava ilable data to suit the n eeds of yo ur study are a.

Determining the system of spatial referencing


The system o f spatial referen cing can be e stima ted by exa mining the middle righ t side o f Figure 5.17. Figure 5.17 Determining the Coordinate System

The X axis position of the cursor in a View is de noted to the left of the horizontal ind icato r, :. Values in the range of -180 / to +180/ will generally indicate longitude wh ile pro jecte d data (e.g. Universal Transverse Mercator projection (UTM)) will give rise to 6-figure easting num ber (xxx,xxx excluding decimal points). The Y axis position of the cursor is denoted to the left of the ve rtical indicator, ;. Latitude will of course be in the range +90 / to -90 / while data in a UTM projection will show a 7-figure northing num ber (x,xxx,xxx excluding decimal points). There are other issues associated with these examples which may not be obvious. Foreign data sets which use geographic coordinates may employ a different prime meridian. For

Geographic Information Systems: A Primer

Page 102

examp le, ma ps exist for Italy w here the prime me ridian (0 / longitude) is Rome-centred rather than the more universal Greenwich-centred location. Data sets created using a UTM projection need an associated UTM zone in order to locate the data on a wo rld grid. (There are 60, 6 / wide longitudinal zones which will have the same easting and northing number.) In most cases, the location on the world should be obvious but check for this in the metadata of the source map. Other data sets are less obvious. For example, the Regional Municipality of Ottawa-Carleton and Quebec, use the Modified Transverse Mercator projection which is based upon a 3/ longitudinal band rather than the UTM s 6/ band. The num bers look UT Mish b ut they a re not. The false easting for the central meridian differs as does the scale factor, hence, a UTM to MTM or MTM to UTM conversion cannot be accomplished by simply shifting the easting and northing values but rather a reprojection of the longitude-latitude data is necessary. What is not obvious in any of the above cases is the datum used (e.g. NAD27, NAD83, WGS84 etc.). A location will have different geographic coordinates depending upon the datum used, hen ce, projecte d da ta will also differ.

Determining file extent


A sample View Properties dialog is shown in Figure 5.18. You will note in the comments section that the data are in geographic coordinates (Map Units: decimal degrees), no projection has been specified a nd the datum is NAD 83. This information w as obtained from source m etafile file. Good GIS practice would dictate that you document this information yourself and include a metafile do cument with you r data. A text file (e.g. created in No tepad or W ordpad), a wo rdprocessor document or som e other form of widely accessib le text-based file (e .g. Adobes *.pdf format or web-based html files) will suffice.

Geographic Information Systems: A Primer

Page 103

Figure 5.18

View Properties Window With Map and Distance Units Specified and No Projection is Chosen

To determine the extent (bounding rectangle) of a file, use the following procedure. 1 Make a View document active. 2 Select View|Properties from the menu 3 Specify the Ma p Units, the Distanc e Units and the Projection of the data source. 4 Select the Area of Interest button in the View Properties dialog. 5 Specify the Set AOI to: option to Theme. 6 Specify the Theme: for which the extents are needed by choosing it from the drop-down list. 7 Read the file extents beside Left:, Right:, Bottom: and Top: portions of the window. 8 Select a nother theme to determ ine its file exten t or select Cancel to leave without changing the area of inte rest.

Other methods of specifying the area of interest can be selected using the Set AOI to: options. Select OK if you wish to set to a specific are a of interest. Examples of Area of Interest parameters are shown for the Wc&kan.shp and Aoi.shp feature

Geographic Information Systems: A Primer

Page 104

themes. Setting th e AOI to a particular theme allows you to determ ine the bound rectangle which completely encloses the specified theme.

You w ill notice that these two them es differ in the ir areal exten t. If the view properties are changed so that the longitude-latitude data are projected to a UTM projection, then the area of interest information will reflect the system of units. Figure 5.19 shows the view properties window with these projection changes.

Geographic Information Systems: A Primer

Page 105

Figure 5.19

View Properties Window Contents When the Projection is Set to UTM

The projection change from geographic NAD83 to UTM NAD 83 results in a different representation of the file e xten ts even though the underlying data for the shapefile are still in longitude-latitude (geographic) coordinates. The new information for the Wc&kan.shp and Aoi.shp shapefiles are as follows:

Geographic Information Systems: A Primer

Page 106

If the wrong datum is chosen, then the file extents will be erroneous as is illustrated in the following window for the Aoi.shp shapefile.

The shift in the positions of the bounds between the correct (NAD83) and incorrect (NAD27) datums can be summarized in the following table. This table shows that the positional shift of each boundary ca n be quite large (i.e. difference in Top = a 217.615 m S shift)

Bound ary

Shift

Left Right Bottom Top

3.259 m W 1.861 m W 217.309 m S 217.615 m S

Geographic Information Systems: A Primer

Page 107

5.8 Projecting shapefiles to other systems of spatial referencing


A large proportion of readily availab le fea ture data for use in ArcView u se geographic coordinates to encode spatial location. These data sets can be projected to other projections, such as UTM or Lambert Conformal Conic, on-the-fly by setting the View | Properties | Projection to the desired projection. Many data sets, however, are already projected. For example, in the province of Ontario, the Ontario Basic Mapping programs 1:10,000 map sheets store feature information using a UTM projection and features locations are given as eastings and northings (in meters) for a given UTM zone. The Regional Municipality of Ottawa-Carleton, on the other hand, uses a Modified Transverse Mercator (MTM ) projection to store their feature data. The federal gove rnm ents Na tional Topographic D atabase 1:50,000 map sheets are stored in geographic c oordinates. These va ried data sets will necessitate that you be fam iliar with projecting and unprojecting data sets. Since ArcView does not allow you to directly unproject projected data, this must be accomplished through the use of the Geoprocessor exte nsion wh ich c om es with ArcView. It can be accessed using the following procedure: 1 Make the project window active. 2 Select File | Extensions from the main menu. 3 Toggle the Geoprocessing extension on. There is an added complication in that geographic data is collected using either a NAD27 or NAD 83 (WG S84 or GRS 80) datum. The Geoprocessing Extension does not convert datums so it ma y be necessa ry to u se addition al co nve rsion software (e.g., FM E, C orspcon or TransNad). Be aware of the datum of your data sets.

Projecting a feature theme


To project a theme in ArcView, use the following procedure: 1 Select a View d ocum ent that contains th e feature them e yo u w ish to project. 2 Select View|Properties from the main menu. Specify the map u nits of the source feature theme. For exa mple, if your source them e has longitude-latitud e coordinates, se lect Decimal degrees for the map units as shown in Figure 5.20.

Geographic Information Systems: A Primer

Page 108

Figure 5.20

Specifying the Coordinate System for the Source Theme

3 Make the theme active in the View by selecting it in the Views table of contents. 4 Select th e Projector! button on the ArcView b utton bar. 5 Specify the output units as shown in Figure 5.21. Figure 5.21 Output Units Window

The standard ArcView projection dialog box will appear as shown in Figure 5.22.

Geographic Information Systems: A Primer

Page 109

Figure 5.22

Projection Properties Dialog Window

6 Select the projection you wish to project your data to, then click on OK. Figure 5.22 shows the case where a UTM projection was chosen. 7 Specify whether you wish to recalcu late the area, perim eter, and length field s (if present) for the new shapefile as shown in Figure 5.23. Figure 5.23 Recalculation Window

8 You will be given the option to add the projected shapefile to a view as show n in Figure 5.24.

Geographic Information Systems: A Primer

Page 110

Figure 5.24

Add Shapefile Option

9 Save the file with an appropriate name in an appropriate location as shown in Figure 5.25. Figure 5.25 File and Location Specification Window

Decimal degree to UTM or MTM


When you wish to project decimal degree data to a UTM data set, specify decimal degrees for the map units and do not specify a projection for the view. ArcView assumes that decimal degree data has a NAD83 datum (GRS80 spheroid also used by WGS84). When the projection properties window appears, select a Standard projection and the Category type as UTM. If you are projecting to UT M, then the program will determine the appropriate projection , spheroid (hence datum), central me ridian, reference latitude , sca le fac tor and false easting and northing.

If your decimal degree data have a NAD27 or other datum, you must select a Custom projection and specify these parameters as shown in Figure 5.26. In this figure, a Clarke 1866 spheroid wa s ch osen wh ich is used by th e N AD 27 datum . The other param eters w ould need to be specified directly so make sure that you have all the necessary information prior to projecting your data.

Geographic Information Systems: A Primer

Page 111

Figure 5.26

Custom Specification Window

Geographic Information Systems: A Primer

Page 112

Chapter 6 Working With Vector Data


6.1 Working with Shapefiles
The discu ssio n in this section will be confined to vector data as represented by E SR Is shapefile. There are a va riety o f simple geographic q uestion s which can be answe red once one has a basic knowledge of the parameters of shapefiles. The next few sections deal with the Avenue programming language and how to use it to find out info rmation about spatial da ta represented in shapefile fo rmat.

Basic object oriented definitions


A great deal of information about object oriented programming principle s ca n be gleaned from the help files specifically under references dealing w ith Aven ue. Also of interest, for the m ore advan ced user, is the book ArcView GIS/Avenue Programme rs Reference by A .H. R azavi and V. W arw ick (2 000). This introduction here w ill be kept brief and serves only to provide the reader with basic inform ation and to set the tone for spatial analysis in vector and raster GIS.

Class
A class describes a common set of attributes or operations. A class is in essence a template for creating an object of that class. For example, the Shape class describes the attributes for native vector data used by ArcView.

Request
A request is basically a procedure used to create, control the properties of, or obtain information about, classes or objects. A Class Request generally creates new objects of the class or returns information about the class itself. Requests generally start with Add, As, Can, Find, Get, Has, Is, Make, Re turn or Set since they control the properties of the class as a whole. For example, the request Point.Make ( anX, aY ) creates a point from the X,Y coordinates specified by anX and aY. Other class requests exist for particular objects and can be found by searching the help files for the object u nder conside ration. Instance Requests generally modify an existing object or retrieve an existing object. For example, aPoint.G etX will return the X coordinate of the point object specified by a Point.

Argument
An Argument is what needs to be passed to a request in order for it to function. An argument can be a number, a string, a list or an enumeration list (which is a possible choice from a series of options). These argum ents are enclose d in round bracke ts, ( ), with strin g objects e nclose d in double quotes, , list objects in curly brackets, { }, and enumerations begin with the pound sign, #.

Geographic Information Systems: A Primer

Page 113

The shape object model


The shape object model, in Figure 6.1, shows how the various geometric features relate to the Shape class. Remember, you can have graphic shapes and shapes which relate to a feature theme. The trian gle represents inheritance. The shape clas s forms the top of a hierarchy an d the geometric features listed below it (i.e. the point, ellipse, rectangle, geocurve, line , circle, ova l and m ultipo int) inherit properties from the shape class. If we view this from the other perspective, it can be said that the listed features are a type, or an instance, of the shape clas s. These concepts m ay seem a bit fuzzy now but we will be using these concepts to determine the properties of features in a view (i.e. the shapes). Figure 6.1 The shape object model (ArcView Help files)

Geographic Information Systems: A Primer

Page 114

6.2 Geometric properties of vector data


A shapefile's table (*.dbf file) contains a Shape field which can be queried using Avenue programs or by using Avenue requests from within the Field|Calculator. Shapes and their properties are as follows: Shape Class The Shape class defines the parameters for the object. Figure 7.1 shows the shape object model and the various types of shapes that exist. For example, the point, ellipse, rectangle, geocurve, line, circle, oval and multipoint are types of shapes and they are called instances of the shape class. Property The attributes of an object are referred to as its properties. For example, for geometric shapes such as polygons, lines and points, you can have properties such as area For polygonal features only. centre The centre of the bounding rectangle or mathematical centre of the shape. dimension A point sh ape has zero dimension (point), lines are one-d imensional and p olygo ns are two-dimensional (polygon). extent The exten t of a shape is th e smalles t rectangle that will enclose it. leng th This is the length, perim eter or circumference of the shape (depending upon the shape type ). Points have no length since they have no dimension.

More detailed information on shapefile requests can be found in the help files. Reme mber, a request is going to return something which may be a Numb er, Boolean (Y or N), a List (e.g. a list of points), a Point, or a Rect ( a rectangle). The latter two, the point and rect, refer to the point and rectangular shape and these also have requests associated with them. In fact, in the Shape field of the accompanying table you can see the follow ing shape class es: point, line, p olygon, mu ltipoint, polyline. Requests ca n be m ade to these clas ses and other requests ca n be appended to them. A partial list of instance requests follows and exam ples of their use is given in subsequent sections.

Geographic Information Systems: A Primer

Page 115

Using Avenue requests in the field calculator


Using the field calculator (Field|Calculate) is sometimes a suitable substitute for a full-fledged Avenue program particularly if you need quick answers to simple questions. For example, the Calcapl.ave script allows you to determine area, length or perimeter for shapefiles. Locating, loading, compiling and running the script ca n take as much tim e it would to o btain the information using the field calculator. In order to use the field calculator to obtain information about shapefiles, use the following steps. 1 Add the theme to query to a view and open its table. 2 Make the table active and start edit mode (Table|Start Editing). 3 Add the necessary fields to the table (see e xam ple below ). 4 Activate one of the new fields a nd select Field|Calculate from the menu. 5 Type the request in the field calculator to obtain your answers. As an exa mple, lets a ssu me that yo u have a project which contains s eve ral shape files as sh ow n in Figure 6.2. Figure 6.2 Feature themes

Add two field s to the themes ta bles to store string and num eric information. Using the previously defined procedure, specify the following: First new field Name: NumAns Type: Numb er Width: 20 Decimals: 4 Second new field Name: StringAns Type: String Width: 20 The NumAns field is the field that you will use to get answers for numeric calculations and the StringAns field is the field to use for string (text) related answe rs. These, of co urse, can have a ny field name that you choose but it is convenient to give them these names if the results of the queries are not going to be saved with the shapefile. If the Polygon shapefile, from Figure 6.2 is used, your table should look like Figure 6.3.

Geographic Information Systems: A Primer

Page 116

Figure 6.3 Table for Shape1.shp

If you wish to calculate the area for this table, then make sure the table is active, you are in edit mode and the appropriate field is selecte d. To calcu late values for this field, sele ct Field | Calc ulate from the me nu to bring up the Field Ca lculator.

6.2.1 Determine polygon area


Follow the procedures outlined previously to get a table ready to accept calculated va lues. Figure 6.4 shows the Field Calculator dialog when it is ready to accept a calculation expression for an active field, called Area, in a table. Figure 6.4 Field Calculator Window

You will notice that the field to you wish to calculate values for is already indicated above the request box ( [Area] = ). To calcula te the area you wo uld type in the request:

[Shape].ReturnArea
as shown in Figure 6.5 (You can double-click on [Shape] in the Fields listbox to add it to the expression if you w ish).

Geographic Information Systems: A Primer

Page 117

Figure 6.5 Ca lculating A rea for a Field

The area is returned in native units which means if the shapefile coordinates are in decimal degrees, area will be given in de grees squared regardless of the projection set in the view . If the shapefile is already projected (e.g. the native coordinates are in UTM, MTM or Lambert conformal conic etc) then this re quest will return the correct area. If shapefile's coordinates are geographic (longtitude/latitude) and you want area calculated in projected units, then the expression becomes somewhat more complicated. Let us assume your theme is in a View document called View1 and it has some projection set (e.g. a UTM, MTM or Lambert conformal conic etc). Use the following syntax to calculate area in projected units:

[Shape].ReturnProjected(av.FindDoc("View1").GetProjection).ReturnArea

6.2.2 Length or perimeter calculation


The procedure for determining length (for lines and polylines) or perimeter (for polygons and other twodimensional shapes) is the same as that used for calculating area, however, the ReturnLen gth request is used. To return length in geographic coordinates, or to determine length for data which are already projected, use the following syntax in the Field Calculator:

[Shape].ReturnLength
This request returns the length for line ar features or the perim eter for polygonal fea tures. If the shapefile has geographic coordinates and a projection is set for the View, the length/perimeter can be calculated in projected units, using the following expression:

[Shape].ReturnProjected(av.FindDoc("View1").GetProjection).ReturnLength

Geographic Information Systems: A Primer

Page 118

6.2.3 Locate the centre of a feature


The ReturnCenter requests determines the X, Y coordinates of a point or the center of the bounding rectangle for lines and polygons. If you want the coordinates in their native units, then use the following requests in an appropriately labeled numeric field. For example, to get the X position (easting, longitude or X) use:

[Shape].ReturnCenter.GetX
and for the Y position (northing, latitude or Y), use:

[Shape].ReturnCenter.GetY
If you have d ecimal degree data in a V iew with a projection and yo u w ish to obtain the coordinates in projected units, use the following expressions:

[Shape].ReturnProjected(av.FindDoc("View1").GetProjection).ReturnCenter.GetX [Shape].ReturnProjected(av.FindDoc("View1").GetProjection).ReturnCenter.GetY
These of course assume that the View is called View1, hence, change to match your View's name.

6.2.4 Parameters for the bounding rectangle of features


The Aven ue request ReturnExtent, returns the bounding rectangle of a feature. Subsequent requests can be m ade to determ ine other parameters as listed below. A gain, the se requests w ill return values in their native map units. [Shape].ReturnExtent.GetBottom The lower Y coordinate. [Shape].ReturnExtent.GetTop The top Y coordinate. [Shape ].ReturnExtent.G etLe ft The left X coordinate. [Shape].ReturnExtent.GetRight The right X coordinate. [Shape].ReturnExtent.GetHeight Difference between top and bottom coordinate. [Shape ].ReturnExtent.G etW idth Difference between left and right coordinate. As in previous examples, you need to insert the request ReturnProjected(av.FindDoc("View1").GetProjection) between [Shape] and the request listed above (assuming the feature theme is in View1), for example, [Shape].ReturnProjected(av.FindDoc("View1").GetProjection).ReturnExtent.GetTop

Geographic Information Systems: A Primer

Page 119

6.3

Combining features in a theme

Sample data sets


Figure 6.6 shows a View document which contains a theme (Shape123.shp) which 3 features that overlap in space as the result of various merge operations. Figure 6.6 A Polygon Feature Theme

The Shape123.dbf is shown below: Shape Polygon Polygon Polygon Label Poly1 Poly2 Poly3 Number 1 2 3 Area 10000.0000 10000.0000 10000.0000

These files and their tables will be referred in the following sections.

Establishing editing parameters


If your intent is to combine features within a theme then you need to familiarize yourself with the editing rules associated with unioning (and splitting) features. The available options depend upon the type of feature theme you are working and the fields in the associated theme tables. These rules need to be established prior to any editing. 1 Select the theme to edit in the View. 2 Select Theme|Properties from the menu. 3 Select the Editing icon as shown in Figure 6.7.

Geographic Information Systems: A Primer

Page 120

Figure 6.7 Establishing Union and Split Rules

4 For each field in the table, specify the Union rule and the Split rule. The available options for string data are Blank and Copy. For num eric fields (single type fields), you have th e options of: Blank Resulting record will be blank. Copy Value from the first record in the table will be chosen. Proportion Value assign ed w ill be proportion al to the me rged length (lines) or merge d are a (po lygon s). Add Values from origina l record s will be added together. Average Original records will be averaged. Shape Area The area of the new polygon (default for Area fields) Shape Perimeter The perimeter of the new line (default for Perimeter fields)

Available operations based upon feature type


The terms combine, dissolve, merge, subtract, union and intersect often appear in GIS terminology lists. Semantics aside, it is more important to remember what you are trying to do that is the key. The type of operation available will depend upon the feature type.

Geographic Information Systems: A Primer

Page 121

Polygon themes
Polygons in a theme can take one of the following forms. Adjacent Polygons wh ich a re adjacent share a common edge. When the edge is re move d, the attributes in the table are combined, based u pon which fea ture w as selected first, an d what editing rules w ere established prior to performing the operations. There are many real-world cases where adjacent shapes can have the same attribute va lue. For exa mple, it is possib le for two adjace nt parcels o f a land to have the same land use class. If desired, you can remove the boundary between these adjace nt features and obtain the combined areal exten t. Disjunct Disjunct polygons are polygons which do not intersect (overlap) or share a common boundary. When these po lygon s are com bined into o ne shap e, they resu lt in a multipart sh ape . A m ultipart shape can have several pieces but it is represented by one record in the shapefile table. For exa mple, polygons of a particular wetland clas s will each occu py o ne record in the feature table. You might wish to consolidate all individual records into one entry within the table. You should note, howe ver, that information on the num ber of areas asso ciate d w ith tha t record will be lost. Overlapping Polygons which completely or partially overlap can occur as the result of bad digitizing and/or when data from different shapefiles are merged together into a new shapefile.

Geographic Information Systems: A Primer

Page 122

The following table tries to show how the various operations work with the different polygon cases.

Polygon Type Merge Operation


Adjacent Disjunct Overlapping Creates a ne w feature representing the overlap between selected overlapping polygon features. The common edge between adjacent polygons is removed. The shapes remain intact but the records are consolidated (a mu ltipart polygon ). The area of overlap is removed from the resulting polygon leaving a hole. This allow s you to create donut polygons The boundaries of overlapping polygons are removed and one complete polygon is created. Given one feature on top of another feature, a subtract, will remove the area of overlap from the shape of the bottom feature and the top feature remains unchanged. To reverse the direction of the subtract (i.e. subtract bottom from top) hold the Shift key while you select Subtract | Po lygons in the Edit menu

Intersect

Combine

Union

The common edge between adjacent polygons is removed.

The shapes remain intact but the records are consolidated (a mu ltipart polygon ).

Subtract

Geographic Information Systems: A Primer

Page 123

Examples of combining features within a theme


Figure 6.8 shows the results of a union operation when shapes overlap in the feature theme (see Figure 6.6). Note that the boundary between Poly1 and Poly2 (see Figure 6.6) has been dissolved and a new outline encompassing both features has resulted. Figure 6.8 Un ion Features Exam ple

The dbase file for this theme is as follows: Union.dbf Shape Polygon Polygon Label Poly3 Poly1 Number 3 1 Area 10000.0000 17500.0000

The Area column had to be recalculated and you will notice that Poly2 has completely vanished from the Label and Numb er fields because Poly1 was selected first prior to the union operation. The area of overlap is not double-counted, hence the combined area is 17,500 e ven though the area of Poly1 and Poly2 were both 10,000.

Geographic Information Systems: A Primer

Page 124

Figure 6.9 shows the results of a combine operation. This figure shows that the area of overlap has been removed from the combined polygon. Figure 6.9 Co mbine Example

The dbase file for this theme is as follows: Combine.dbf Shape Polygon Polygon Label Poly3 Number 3 0 Area 10000.0000 15000.0000

Note that the Label field is blank for the resultant combined polygon and the Area field needed to be recalculated to reflect the new combined area which excludes the initial area of overlap.

Geographic Information Systems: A Primer

Page 125

Figure 6.10 shows the results o f an intersect operation. It is obvious that the area of ove rlap is the only thing that remains of the 2 initial overlapping features from Figure 6.6. Figure 6.10 Intersect Example

The table for this theme is as follows: Intersect.dbf Shape Polygon Polygon LABEL Poly3 NUMBER 3 0 AREA 10000.0000 2500.0000

As in the combine operation, the intersect operation leaves a blank label field and the number of the new polygon is assigned a value of 0. The area field was recalculated and truly reflects the area of overlap of the two initial features in the theme. In the case of subtraction between polygon 1 and polygon 2, the Area field reflects the fact that polygon 1 has had the area of overlap removed. The area for polygon 2 and 3 remain intact and it should be noted that overlap still exists between two polygons. Su btra ct Example LABEL Poly1 Poly2 Poly3 NUMBER 1. 2. 3. AREA 7500.0000 10000.0000 10000.0000

Geographic Information Systems: A Primer

Page 126

Figure 6.11

Su btra ct Example

Geographic Information Systems: A Primer

Page 127

Line Features
The following table su mmarize va rious operations and the typ es of line s that can exist.

Line Type Operation


Disjunct Intersecting/ Overlapping Creates a ne w feature representing the overlap between selected overlapping line features. The shapes remain intact but the records are consolidated (a mu ltipart polyline). If the lines are separate or cross (but not at a common node or vertex), the records are consolidated and a m ultipa rt polyline is created. The lines or polylines are combined into one feature. If the lines meet at a point, a continuous line is made from the segments and one record is made in the table. If line features have an overlap, the overlapping segment is not removed from the shape description.

Intersect

Merge

Union

Geographic Information Systems: A Primer

Page 128

6.4 Combining two or more feature themes


The GeoProcessing extension or the mrgthems.ave script (View.MergeThemes) script ca n be used to merge feature themes together. The extension can be selected from the Project document under File|Exte nsions and toggling on the Ge oprocessing exte nsion. The m rgthem s.ave script is located in the drive :\ESRI\Av_g is30\Arcview \sam ples \scripts folde r (assuming a norm al installation). Both options allow you to co mbine features of the sam e typ e (e.g. point to point; line to line; p olygon to polygon).

Considerations
The order of precedence is important in the merge operation since only the field names from the first selected theme will be retained in the output shapefile. If you wish to retain attributes from other feature themes that dont exist in the first th em e, yo u m ust edit the firs t theme and add the m issing field names.

Sample data sets


Figure 6.12 shows a view entitled the Original Themes. This view contains 3 polygon themes, 1 point and one line theme. Figure 6.12 Sample shapefiles

The tables for these themes are listed as follows Shape1.dbf Shape Polygon Label Poly1 Number 1 Shape2.dbf Shape Polygon Label Poly2 Number 2 Shape3.dbf Var_2 unique Area 10000.0000 Var_1 unique Area 10000.0000

Geographic Information Systems: A Primer

Page 129

Shape Polygon

Label Poly3

Number 3 Line.dbf

Var_3 unique

Area 10000.0000

Shape Polyline

Label Line Point.dbf

Number 5

Shape Point

Label Point

Number 4

These files and their tables will be referred in the following sections.

Merging themes with no spatial overlap


The view entitles Merged themes shows several incarnations of the merge operations. These themes may be selected one at a time to show the resultant combinations. The theme Shape1&3 shows the result when two feature themes (Shape1.shp and Shape2.shp) for adjacent areas are combined together to produce a theme which is the combined extent of both files.

Merging themes w hen spatial overlap exists


Consider the case where we wish to combine 2 feature themes which have overlapping areas. If the feature themes are merged, features in th ese them es can still occupy the same space. For exa mple the merging of Shape1.shp with Shape2.shp results in a new shapefile called Shape1&2.shp as shown in the view . The two features in the view have o verlaps in space! This ca n be useful or dangerous if you arent familiar with what the merge operation does. After the merge operation you need to get the theme back into edit mode then SUBTRAC T the selected features. Recalculate any area, perimeter and/or length fields in the tables.

Geographic Information Systems: A Primer

Page 130

6.5 Queries involving two or more themes


Consider Figures 6.13 and 6.14 which show polygonal data for the same area but for two different variables (both classed from 1 to 5). These constructed data sets will be used to demonstrate spatial query for vector (feature) data. Figure 6.13 The First S hapefile Figure 6.14 The Second S hapefile

Note that for the first shapefile (1.shp) the numeric values increase from 1 to 5 as you move from West to East (see Figure 6.13). The values for the second shapefile (2.shp) increase from 1 to 5 as you move from North to South. Tw o other view s were created to show the data together. Figure 6.15 m akes judiciou s use of fill palettes and transparent colours and Figure 6.16 uses transparent polygons with theme-specific labeling. Figure 6.15 Both Themes Show n Together Figure 6.16 Bo th T hemes as Nu meric Values

In Figure 6.16, the upper left number represents the value from the first shapefile (1.shp) while the lower right number is the value from the second shapefile (2.shp). Visually we can start to answer some questions. For example, we can see that the centre area shows the intersection of class 3 from 1.shp and class 3 from 2.shp. To give our question, which w e w ish to develop and answer, som e pseudo-real world meaning, lets assume the following information applies to the shapefiles:

Geographic Information Systems: A Primer

Page 131

Sh apefile Class Value 1.shp 2.shp 3 3

Physical representation

Privately-owned land 200-300 m buffer zone from Southern road.

We can visually answer the question Where is the privately owned land which falls within the 200-300 m buffer zone from Southern Road? the answer, of course, is where polygons from the first and second shapefile both contain a class value of 3. Now we are ready to explore spatial query for vector data.

Spatial query for two or more polygon feature themes


By this time you should be fairly familiar with spatial and attribute queries using the The me | Query (which is run from an active theme in a view) or the Tab le | Que ry (wh ich is run from an active table). To answer our previous question, Where is the privately owned land which falls within the 200-300 m buffer zone from Southern Road? we begin by querying the first theme (1.shp in Figure 6.15) using the syntax shown in the query window shown in Figure 6.17 which results in Figure 6.18. Figure 6.17 Finding all the Privately-Owned Land Figure 6.18 Location of Privately-Owned Land

Remem ber from the previous definitions, class 3 in 1.shp represents privately-owned land. Note that all the other classes in Figure 6.18 were symbolized as transparent to facilitate viewing the selected data. The second stage entails perform ing the query on the second shapefile (2 .shp). The query and its results are shown in Figures 6 .19 and 6.20 resp ectively.

Geographic Information Systems: A Primer

Page 132

Figure 6.19

Finding the 200-300m Buffer Zone Figure 6.20 Land

Buffer Zone Land Identified

At this stage, I am sure that you are ready to do a Theme | Select by Theme analysis...righ t? To refresh your memory, use the following procedure. 1 Select the first shapefile (1.shp) in the View to make it active. 2 Select Theme | Select by Theme from the menu. 3 Use the select-by-theme query as shown in Figure 6.21 Figure 6.21 Performing an Intersect Select By The me Query

In this case an intersect query with the selected features of 2.shp is to be performed. 4 Select Select from Set in the window to complete the query. The results are shown in Figure 6.22.

Geographic Information Systems: A Primer

Page 133

Figure 6.22

Results from Select from Set Operation

Wha t happened? Only the centre polygon should have been highlighted, however, since the intersect option wa s used, the com mon vertices for the upper and lower polygon we re also s elected. This means that we now have highlighted two polygons which dont meet the specified conditions. The same results were obtained when the are within a distance of 0m option was chosen. To solve this Figure 6.23 shows condition being met when the are completely w ithin, completely con tain, have their c ente r in, co ntain the c ente r of options were chosen.

Figure 6.23

Polygon al Location o f PrivatelyOwned Land Within the 200-300 m Buffer Zone

The question then remains as to wh ether our initial question needs further refinem ent.

Geographic Information Systems: A Primer

Page 134

Other options
The Intrsect.ave script allows you to perform the intersect option of polygon themes. The script runs from an active theme in a view and produces a new polygon theme showing the area of intersection of the two themes. Use the following procedure: 1 Complete the queries on the individual themes if only selected features (classes) are to be used. In our previous examples, we queried each theme separately for the condition where class 3. 2 Load and com pile th e script. 3 Select the them e in the view that you want to interse ct (e.g. 1.shp). 4 Select the script window and press the run button. The following dialog window will appear. Select the intersect theme and press OK.

5 Specify the overlay theme in the d ialog w indow w hich follows (e.g. 2.shp ).

6 Specify a file name and location for the intersect file, as shown below:

7 You can then add the resultant shapefile to a view by fo llowing the rem aining dialog windows.

Geographic Information Systems: A Primer

Page 135

The results of the intersect are shown in Figure 6.24. This has simply taken the 1.shp file and clipped the 2.shp file. It is the table that we are after, however, and not the shapefile.

Figure 6.24

Results of the Intrsect.ave Script

The table is shown below: Shape Polygon Polygon Polygon Polygon Polygon Label_1 A3 B3 C3 D3 E3 Value_1 1 2 3 4 5 Label_2 A3 B3 C3 D3 E3 Value_2 3 3 3 3 3

This table c ontains the selected records from the inters ect the me (1.shp) an d ap pen ded to it are attributes from the overlay them e (2.shp). This tab le can then be queried to find the loc ations where both values are equal to 3 using the syntax shown in Figure 6.25. Figure 6.25 Querying the Intersect Theme

Geographic Information Systems: A Primer

Page 136

The results are shown in Figure 6.26. Figure 6.26 Spatial Loca tion W here Both Conditions are Met

If you need a separate shapefile showing solely the areas meeting the conditions, simply use Theme | Co nvert to Sh apefile to save the selected features. Figure 6.27 shows the query syntax for our previous question. Figure 6.27 Qu ery Syntax Example

6 The ap propriate record will now b e highlighted in the table and in the view. If you wish to save this as a separate theme, use Them e | Convert to S hapefile from the main menu.

Geographic Information Systems: A Primer

Page 137

6.6 Determining feature-to-feature distances


There are a variety of situations where you need to determine point-to-point distances, for example: 1 Determ ine th e loc ation of the clos est fire hyd rant. In the case w e need to find th e distan ce from a source loca tion to all fire hydrants. Strictly speaking, this is probably better suited for network ana lysis if one is required to follow roadways to get to the hyd rant. 2 What is the average (straight-line) distance that our customers travel to reach our resta urant? To answer this question requires that you determine the distance from a point in one theme (restauran t) to all points in an other them e (custom ers). 3 Produce an origin-destination matrix of shortest distance routes for cities in Canada. This task is an expansion of the previous, in that you are required to find the distance from each point in a theme (cities) to all other points in the theme. 4 Is the pattern of house break-ins random or clustered? Many questions of point-pattern analysis, such as nearest neighbor analysis, require point-topoint distance information. To answer m any of these que stions, you can use the sp atial join as outlined previously.

Using the spatial join on point themes


Co nsider the case wh ere we have a point so urce location and 5 possib le point destina tions as sh ow n in Figure 6.28. We cou ld use the measure tool to determine roughly the distances between the source and all possible destinations but this isnt appropriate if accurate measures are needed. To perform the spatial join use the following procedure:

1 Open b oth them e tables (so urce and destination). 2 Ma ke the Shap e field active in the source table (e.g. sou rce). 3 Ma ke the Shap e field active in the de stination table (e .g. destination ). 4 Select th e join button or select Table | Join from the menu. The tables sh ould now be joine d. Rem em ber joins are not permanent.

Geographic Information Systems: A Primer

Page 138

Figure 6.28

Source an d Destination Points

Prior to the spatial join, the source.dbf file showed the following information

and the destination.dbf file contained this information.

Geographic Information Systems: A Primer

Page 139

After the spatial join, the destination table contained the following information.

The new field Distance lists the distance from the source point to each destination point. This field can be sorted to determine the shortest, or for more information, you can use the Field | Statistics menu choice to obtain a summary as shown in Figure 6.29.

Figure 6.29

A Field Statistics Sum mary

Producing a distance matrix


The spatial join is suitable for determ ining the one-point to m any-point relationships b ut it is not suitable for answe ring many-point to m any-point relationships. In this case w e need to rely o n a script an d a bit of a trick. If you wish to obtain the distances from many points in one theme to many points in the same theme, use the following procedure: 1 Load the point shapefile containing your locations. 2 Open the theme table and use Theme | Properties to hide any fields that yo u dont want to appear in the final p roduct. 3 Select th e them e in the view and select Them e | Convert to S hapefile from the main menu. This is the trick. You now have a duplicate of the theme which maintains the integrity of the original data while at the same time affords you a theme to calculate distances to. Figure 6.30 shows the result (one theme has been symbolized with large markers, but the themes are indeed identica l.

Geographic Information Systems: A Primer

Page 140

Figure 6.30

Two Identical Point Themes

In Figure 6.30, the Destinations theme is the original point file and Du plicate is, of course, the duplicate. 4 Make the original point file in the theme active (e.g. Destinations) and select the points that you wish to include in the analysis. This ca n be acco mplish ed using the select fe ature tool or by u sing a query. If you w ant all po ints in the theme selected, then you must select them all otherwise the script will not work. 5 Load and compile the calcdist.ave script which comes with an ArcView installation. 6 Make the view a ctive, make the script active then select Script | Run from the main menu or use the Run button from the button bar. 7 Select the original point file in the dialog window shown in Figure 6.31.

Figure 6.31

Selecting the Source Theme

In this exam ple, we wish to select Destinations as our source theme. 8 Select the duplicate point theme in the dialog window shown in Figure 6.32.

Geographic Information Systems: A Primer

Page 141

Figure 6.32

Selecting the Duplicate Theme

In this exam ple, select Du plicate as the appropriate theme. 9 Specify an unique identifier field which can be used to identify the points in the theme. In Figure 6.33, the unique identifier field is the Site field. Figure 6.33 Selecting a Unique Identifier Field

10 Open the duplicate themes table and view the results as shown in Figure 6.34. Figure 6.34 Distanc e M atrix R esu lts

In this case, new fields DistTo1 through to DistTo5 have been added. Each row in the table then contains th e original site number and the distan ce results to all succe ssive selected points in original file. The diagonal in the matrix has values of 0.0000 as you would expect since the distance from a point to itself is 0. The distance from Site 1 to Site 2 can be found by reading the value in the Site 1 row and the DistTo2 column, giving a value of 84.8528 units. Other distances can be read in a similar fashion.

Geographic Information Systems: A Primer

Page 142

Distance measures involving lines


Figure 6.35 shows a polyline constructed from a series of points w ith coo rdinates {(0,0), (0.5,1), (1.5,2), (2.5,1)}. Figure 6.35 A linea r feature

There are a variety of questions which could be asked when dealing with linear features. For example:

Q What is the total distance of the line? A Add a numeric field to the theme's table and use the [Shape ].ReturnLen gth request in the Field Calculator. The length for the sample line is 3.9465. Note:If the view (e.g. call it View1) contains unprojected decim al degree data then yo u will have to set a projection and use this expression: [Shape ].ReturnProjected(av .Find Do c("V iew 1").G etProjec tion).R eturnLeng th Q What is the d istance fro m the s tart po int to the en d point? A Add a numeric field to the theme's table and use the: Line .ma ke( [S hap e].Along (0), [Sh ape ].Alon g(10 0) ).Re turnLen gth request in the Field Calculator. The Along(aPercentage) request uses 0% for the start and 100% for the end of a line. T he Line.M ake request will m ake a line b etw een the start and end points and the R eturnLength request will return the dista nce (length) betw een them . The length returned in this case is 2.6926. A Make a copy of the source shapefile (Theme|Convert to Shapefile) under a different name. Get this shapefile into edit mode and open its table. Make the Shape field active and use the following expression in the F ield Calculator. [Shape].AsLine.AsPolyline This will produce an approximation of the original polyline as shown in Figure 6.36 then you can determine the length as outlined in the first question.

Geographic Information Systems: A Primer

Page 143

Figure 6.36

Origin-Destination distance

Q What is the average distance between the points on a polyline? A Since a polyline is formed by a series of connecting points, we simply need to get the length of the polyline, the number of points forming the polyline and hence, the number of line segm ents. This is accom plished using the following expression in the field calculator: [Shape].ReturnLength/(([Shape].AsMultiPoint.Count)-1) The AsMultiPoint request will return a list of points forming the polyline and the Count request gives the number with 1 being subtracted from the total (i.e. 4 points are needed to form 3 segme nts).

Geographic Information Systems: A Primer

Page 144

Determining the shortest route


Consider the following figure which shows two linear features.

In euclidea n space (i.e. as-the-crow -flies d istan ce), we can visually estima te where the shortest route wo uld be. The Aven ue request, ReturnDistance allows you to determine the shortest distance between any two features (shapes). This request, nor any other however, allow you to determine the intersection points formed by the shortest route. A partial solution is to buffer each of the features and determine the intersection points of the buffers with their feature counterpart. This is shown in the following figure:

In theory, if you know the shortest distance between two features and you use this distance to buffer each feature, then the buffers will intersect with the points that form the line representing the shortest dista nce.

Geographic Information Systems: A Primer

Page 145

The following feature show s this in m ore detail.

In practice, however, there are some limitations. These have been addressed in the Shape2ShapePath.ave script listed in the scripts section. This script will allow you to determine the shortest distance between any two features either within a theme or between two different themes. The script also draws the path that you need to follow.

Geographic Information Systems: A Primer

Page 146

6.7 Delineating space using buffers


A buffer is a p olygonal zo ne wh ich is a fixed distan ce from some feature. Buffers are used to delinea te zones of inclusion/exclusion in planning exercises. For example, you may wish to restrict building within 100 m of a stream. Alternately, if a zoning change or a building variance is requested by an individual, then normal practice dictates that other owners within a fixed distance from the property be notified of the proposed changes. These two examples can of course be

You can create buffers around point, line of polygon themes using the following procedure. 1 Make sure that the map and distance units are specified for the view. 2 Select features in the theme you wish to buffer unless you want all features buffered. 3 Select the The me | Crea te Bu ffers menu item. This will bring up the following window.

You have the option to buffer around graphics if there are any in your view or a theme with all or selecte d features being buffered. 4 Choose the buffer type from one of the options shown in the window below. There are three ways to specify the buffer distance. (a) A fixed distance can be specified manua lly. In this case, all features are buffered by a like amount Buffer distan ces ca n specified using values in a fie ld co ntained w ithin the them e table. Variable buffer sizes can be created using this option. For example, you may wish to buffer major roads by o ne am ount and secondary roads by a nother. The roads them e w ould contain a field which contains the buffer amount for each feature class. Multiple ring buffers can be created. This option is similar to the first, in that the buffer size for each feature is fixed, however, multiple buffer zones can be created. This option may be useful if you need to sa mple features within a certain dista nce of a co re feature.

(b)

(c)

Geographic Information Systems: A Primer

Page 147

5 Specify whether you want continuous buffer zones (dissolve) or overlapping ones. If the barriers between the buffers are dissolved, then a multipart polygon is created and all buffer features will be represented as one record in the buffer theme's FTab. If the barriers are not dissolved, then each buffer zone will appear as a separate record in the FTab. 6 Determine whether the buffers are to created as graphics, placed in an existing theme or in a new theme. For the latter two options, see the comments in step 5 above.

7 If you are buffering a polygon theme, extra options appear since it is possible to buffer inside and /or outside the feature borde r.

Geographic Information Systems: A Primer

Page 148

The following figures show som e samp le buffers. Th e first figure shows disso lved g raph ic buffers around a point theme. The second figure shows ring buffers around a point theme with the results of the buffer save d to a new shapefile.

The following figures buffers around a polygon theme. The first figure shows a graphic buffer the inside/outside option selected. Note that the feature in the top right portion of the view has no interior buffer since the feature width was less than the specified buffer size. The second figure shows an outside buffer. The original polygon theme has been made transparent to demonstrate that the buffer includes the original polygon area.

If you just wish to obtain the outside buffer exclusive of the original feature area, specify as multiple

Geographic Information Systems: A Primer

Page 149

rings in step 4 with 1 ring of the specified size . The following figure shows the result.

Geographic Information Systems: A Primer

Page 150

Chapter 7 Customizing ArcView


7.1 Introduction
ArcViews appearance and functionality can be fully customized. Menus, buttons and tools can be added and rem ove d to deliver a completely user-friendly w orking environ ment. This ab ility to customize allows the user to create a kiosk or interactive atlas style program. For exa mple, a city may wan t an interactive atlas of tourist sites for their tourist bureau. In this scenario, you cannot expect the tourist bureau staff or the tourist to be able to launch ArcView, add a bunch of themes, symbolize them, query the database for their desired information and print out the map. You must create the interface for them and it m ust follow the principle s of: 1 keep it sim ple The interface must be attractive (to initiate first contact), it must be useful (it must provide answers to questions) and it must be simple to use (minimize the number of instructions the user has to follow ). 2 expect the unexpected If something is going to go wrong, the novice will soon discover it. This could simply cause the interface to fail leaving a grumbling tourist bemoaning the futility of high tech solutions to low tech problems.

Figure 6.1 shows a customized interface for ArcView which allows the user to select views of different parts of the world. Many of the default menu, button and tool choices have been removed from the interface and several new ones have been added.

Geographic Information Systems: A Primer

Page 151

Figure 7.1 A Customized ArcView Interface

In this particular application, each menu choice or button runs an associated script which opens a specific view document which contains selected themes centred on an area of the world. This section will show you how this interface w as created.

Geographic Information Systems: A Primer

Page 152

7.2 Steps to customizing the interface Initial steps


As a first s tep, create any views, tables, layou ts, ch arts or scripts tha t you wish to have in the project. For example, the view shown in Figure 7.1 shows the world with the continents identified by text and symbolized using a unique values classification scheme. The projection properties were specified and the View document was maximized. The View was titled The W orld so that this document could be referred to in a script. It is important that each document in the project have a unique name, in other wo rds, you cannot have a layout or a script ca lled T he World as we ll. Several other views were created and the project was saved once the view properties, symbols, projection properties and the like were finalized. Make sure every view or other document is the way you wa nt it to a ppear before you proceed to cu stomizing the interface. As a fina l note, AL WAY S W OR K O N A BA CK UP CO PY OF YO UR PR OJ EC TS *.AP R F ILE !!!

Creating scripts
ArcView can be programm ed using ESRIs Avenue object-oriented scripting language. Only the briefest of explanations will be given, when needed, since program ming is a w hole new wo rld. Sam ple scripts are included which provide a basic framework for you to create your own application. For example, a script is used to open The W orld view document when the appropriate button or menu choice is made. The script is as follows: theDoc = av.GetProject.FindDoc("The Wo rld") theDoc.GetWin.Open The first line of this script finds the document titled The W orld . The actual syntax is worth noting: theDoc av GetProject FindDoc this variable is assigned the result of the requests on the left side of the equals sign this is the root object, th e ArcView applica tion itself this request gets the active project this request searches the project for a document called The W orld wh ich h appens to be a view document

The second line of the script take s the object theDoc obtained in the first line, gets the window (Ge tW in) and opens the window (Open). To create this script, the following procedure was used: 1 Open a script document from the project window. 2 Select Script | Properties from the main menu and give the script a name as shown in Figure 7.2.

Geographic Information Systems: A Primer

Page 153

Figure 7.2 Script Properties Window

3 Write and compile the script for use later on. It is also a good idea to save the script to disk by select Script | W rite T ext File option from the menus. Specify a saving location and a file name to use. 4 Repeat steps 1 through 3 to create scripts that load other view documents. Another sample script is shown below. The original script was modified so that it would load a view document called Africa.

theDoc = av.GetProject.FindDoc("Africa") theDoc.GetWin.open

Geographic Information Systems: A Primer

Page 154

7.3 Applying the scripts to menu choices


The next step is to apply the script to a menu choice using the following procedure. 1 Select the Project window to make it active. 2 Select Project | Customize from the main menu. 3 Select the Project element to customize (See Figure 7.3) Figure 7.3 Customize Window

4 Select the Type and Category to cu stomize fro m the drop-dow n lists. In Type, you can select which project d ocum ents to c ustom ize (i.e. Project, View, Table, Chart, Layout, Script or A pplication). In Category, you can select the Menus, Buttons, Tools and/or Popups to customize for the various project documents.

Geographic Information Systems: A Primer

Page 155

5 If you wish to hide a menu, button or tool from the user, double click in the box beside the Invisible property to change it from False to True.

Note:
You can remove a menu, button or tool completely from a project by selecting the Delete button when an item is selected, however, if should you make a mistake and need to recover a deleted option, you will have to select the Reset button and start the customizing process again. It is far wiser to test your customized project by making unnecessary items invisible first, then you may remove them completely once testing is complete. Figure 6.4 shows how the interface was customized to present menu choices when a View wa s active. Several new menu choices were added using the following procedure: 1 Specify the Type and Category to customize as indicated before. In this case, we wish to customize the interface when a View document is active and customize the Menu category. 2 Locate the position where you want the menu to appear using the horizontal scroll bar or the left/right arrow keys. 3 Add the main menu tree by selecting the New Menu button. 4 Add sub-menus to the menu tree created in step 3 by selecting the New Item button. 5 Double click in the box beside Label in the lower half of the window and type in the label that you wish to appear in the menu. Figure 6.4 show s that Africa is the assign ed label and it app ears as an item under the World Menu. 6 Assign the script to run when the menu choice is made by specifying the script name in the box beside the Click option. In Figure 7.4, if Africa is chosen from the World Menu, the AfricaLink script is run which will open the Africa view d ocum ent.

Geographic Information Systems: A Primer

Page 156

Figure 7.4 A Sample Customization

7 Click on the x to close the customize window when you are done with the changes to be made. The final result of adding menu choices is shown in Figure 7.5. Figure 7.5 Menu Choices Added to ArcView

Geographic Information Systems: A Primer

Page 157

In this figure, the World Menu has several items, all of which have scripts attached to them that open particular views.

Geographic Information Systems: A Primer

Page 158

7.4 Applying scripts to buttons


Applying scripts to buttons follow much of the same procedure as was used to apply a script to a menu choice. Figure 7.6 below shows that buttons have been added to the project interface. These buttons run scripts. The placement of the buttons has been made so that they fall under menu options. The items were placed there so that a user may interpret the placement as opening the associated view, wh ich is indeed the case. If the user selects the menu instead of the button, then the menu choice w ill activate the same script. Figure 7.6 Buttons Added to the ArcView Interface

To create buttons and assign apply scripts to them, use the following procedure: 1 Select the Project window to make it active. 2 Select Project | Customize from the main menu. 3 Select the Project eleme nt to cu stom ize (See F igure 7.7). Figure 6.7 shows that the active document to be customized is the View document and that the category to create or modify is Buttons.

Geographic Information Systems: A Primer

Page 159

Figure 7.7 Customizing Buttons

4 Hide any buttons that you dont want to appear in the project by toggling the Invisible property by double-clicking in the box to the right. By default, this will say False, which m ean s that they are available to the user. 5 Add a button by clicking on the New button in the window. 6 Add a space between buttons as needed by clicking on the Separator button. You may have to fiddle with the number and placement of the buttons by adding separators or deleting them (use the Delete button to remo ve unwanted space). 7 Assign the Click property by double-clicking in the box beside Click and type in the script to run. 8 Assign He lp options by doub le clicking in the box. The Help contents will show the phrase Return to the World View when the cursor is placed over the button and on the status line on the bottom left of the ArcView window. 9 Close the customize window by selecting the x when you are done adding buttons and assigning scripts to them.

Geographic Information Systems: A Primer

Page 160

7.5 Getting real fancy


With the examples so far, you should be able to create a fairly bare bones application. It is often a good idea to ke ep your custom ized projects clear and simple so as to provide users with an intuitive understanding of the purpose of the application. There are instances, however, where projects may benefit from additional features, functions, or visual characteristics.

Applying picture images to buttons


A useful feature in ArcView is the ability to fully customize the buttons and tools with images w hich suggest their functionality. For example, a tourist using an interactive restaurant atlas at the tourist bureau, could click on a hamburger button to find the nearest ham burger joint. You can create your own images in CorelDRAW ! or Adobe Photoshop. The supported formats include .gif, .tif., and .bmp. The image size formats, in pixels, are as follows: Width Height 20 17 18 15

buttons tools

If the image is too large, it will be cropped. Images can be resampled in any image editing program. It is assumed that you have followed the procedures outlines in sections 7.2 to 7.4 to create the buttons and scripts in your project customization. To add icons to the buttons, use the following procedure: 1 Select the Project document to make it active. 2 Select Project | Custom ize from the menu. 3 Select the Project element to customize (View document & Buttons) (See Figure 7.7). 4 Select the button you wish an icon to be placed on. 5 Double-click the Icon property box to call the Icon Manager (See Figure 7.8). Select the icon you want to use and click on OK.

Figure 7.8 Icon Manager Dialog Box

The Icon Ma nag er dialog box show s the default icons available for selection. Many of these icons are

Geographic Information Systems: A Primer

Page 161

already in use by ArcView for such things as zooming, selecting, and measuring features, querying tables, and creating layouts. If the default icons do not suit your purposes, you can import icons by selecting the Load button. The Load Icon dialog box (see Figure 7.9), allows you to select the location and type of icon to use.

Figure 7.9 Load Icon Dialog Box

Geographic Information Systems: A Primer

Page 162

7.6 Startup customization


Another feature of ArcView is that it allow s users to setup a Startup script which w ill run e ach tim e their project is opened. This script can range from being very simple to being very complex, depending on the project being opened. Simple things that are often included in startup scripts involve opening particu lar view s, chang ing the nam e of A rcView, and m inimizing the project window so that users cannot tamper with the settings of the project. (**Note: the online help system for ArcView details the syntax required to perform any of the abo ve m ention ed a ctions within a script. Please refer to the se help files for further details)

To create a startup script, use the following procedure: 1 Select the Project document to make it active. 2 Select Project | Prope rties... from the m ain m enu (See Figure 7 .10). 3 In the StartUp input field type in the name of the script you wish to use. Alternatively you may select the system script button located beside the input field to bring up the System script dialog box, allowing yo u to visually select the script you w ish to load.

The ne xt time yo u load the project, the StartUp script will be instantiated and the actions you have coded will be performed.

Geographic Information Systems: A Primer

Page 163

7.7 Hotlinking
A hotlink lets you access virtually any document or application directly from a view. For example, if you had a view show ing the wo rlds continents, you could click on a continent using the hotlink tool, , to open a new view which shows a demographic map or a table document could be opened showing the underlying attributes of the active theme. Hotlinks can be created which run other applications, such as mpeg players. In order to create a hotlink, you need to create a field in the theme table which contains the hotlink information. The themes hotlink properties need to be specified as well, since this controls what type of action is performed with the information contained within the field. The following set of instructions is divided into two parts, the first being guidelines for the creation of hotlink themes and the second being guidelines for the creation of hotlinked views.

Creating a hotlink field


To create a hotlink theme, use the following procedure: 1 Make a theme active in a view. 2 Select Them e | Table from the main menu. 3 Select Table | Start Editing to get into edit mode. 4 Select Ed it | Ad d Field to add a new field to the table. 5 Specify the field name (e.g. Hotlink). Specify the field type as string and set the width to an appropriate value. It is rec om mended that yo u use a va lue no less than 25 characters particularly if the field is to contain subdirectory path information. See Figure 7.10 for an example.

Figure 7.10

Ad d N ew Field

6 Input the hotlink parameters in the new field for each record that you wish to have a hotlink. For example, a theme showing the countries of the world could have a hotlink parameter specified which allows a new view centred about the country to be opened. In this case, you would enter the name of the view to asso ciate with each continent.

Geographic Information Systems: A Primer

Page 164

7 When yo u are done, select Table | Stop Editing and save your edits if they are appropriate. Figure 7.11 shows a sample table where a view document called France is specified in the hotlink field. This view docum ent would have to be created before the hotlink would work. Figure 7.11 Po pulate Ho tlink Field

Specifying the hotlink type


Once the hotlink field is created and populated with information, you can create a hotlinked view, use the following procedure: 1 Select the theme containing the hotlink information in a view. 2 Select Theme|Properties from the m ain m enu and locate the hotlink icon as show n in Figure 7.12.

Geographic Information Systems: A Primer

Page 165

Figure 7.12

Defining Hotlink Properties

3 In the Field input box, type in (or select) the appropriate Hotlink field th at yo u have created. In the Predefined Action input box, select the appropriate action to take when the Hotlink tool clicks a particular feature in the theme. There are several options as shown in Figure 7.13. Figure 7.13 Hotlink Action Options

To hotlink to an ArcView T able, View, Chart or other docum ent, sele ct Link to Document. 5 Click OK to save the definitions.

Geographic Information Systems: A Primer

Page 166

Testing the hotlinks


To test you r hotlinks, make sure that all ap propriate elem ents are available for the hotlink operation. In other words, if you plan to hotlink to other views, images, tables and the link, make sure that all of these are created and/or available. Use the following procedure to test the links: 1 Select the theme containing the hotlink information in the view 2 Select th e hotlink tool. 3 Click on a feature in the view that contains hotlink information. If the hotlink works then the predefined action will occur. If you hear a beep, ArcView cannot find the applica tion, file or d ocum ent needed to co mplete the hotlink operation. NOTE Hotlinks do not have to link to an ArcView document. You can play a movie or go to an internet site when a particular feature is selected in a view. Creating Hotlinks for these instances involves writing scripts which find and open the necessary Windows application, find the appropriate files on the hard drive, loading them into m em ory, and running them. It is suffice to say, that the whole process can become quite complicated while at the same time very powerful. Hotlink users are advised to see if the default ArcView actions reasonably suit their purposes before attempting to create customized hotlinks.

Geographic Information Systems: A Primer

Page 167

References
Defence Mapping Agency (DMA), 1989. The Universal Grids: Universal Transverse Mercator (UTM) and Universal Polar Stereographic (UPS), DMATM 8358.2, available at http://ww .nim a.m il/GandG/pb.html. Ebdon, D. 1985. Statistics in Geography, 2 nd Edition, Basil Blackwell Ltd, New York, NY. USA, 232 pp. Ordnance Survey, 2001. A guide to coordinate systems in Great Britain: An introduction to mapping coordinate systems and the use of GPS datasets with Ordnance Survey mapping, available at http://www.gps.gov.uk/guidecontents.asp. Pearson, F. 1982. M ap Projections: Theory an d Applications, CR C P ress, Boca R aton, Florida, U.S.A., 372 pp. (MPR GA 110 P425) Snyder, J.P. 1987 Map Projections-A Working Manual, U.S. Geological Survey Professional Paper 1395, U.S. Government Print Office, Washington, D.C. Schwarz, C.R. 1989. North American Datum of 1983, NOAA Professional Paper NOS 2, Article 22, downloaded from http://ww w.m entosoftware.inc.com /resource/Na d83.htm Welch, R. And A. Homsey, 1997. Datum Shifts for UTM Coordinates, Photogrammetric Engineering & Remote Sensing, Vol. 63, No. 4, April 1997, pp. 371-375.

Geographic Information Systems: A Primer

Page 168

Appendix A Maintenance Operations for Feature and Grids Themes


A.1 Operations on single themes or grids
The maintenance operations for single themes or grids are summ arized as follows.

Copy
Them e | Convert to S hapefile Select a theme, choose this menu option, then specify a new file location. File | Manage Data Sources | Copy Availab le with the Spatial Analyst exte nsion. The them e or grid cannot be active in the project, delete the theme or grid from the view and delete any tables from the Table document before using this option.

Delete
File | M ana ge D ata S ources | Dele te Available with the Spatial Analyst extension. See Copy.

Rename
Them e | Convert to S hapefile Select a theme, choose this menu option, then specify a new filename. File | Manage Data Sources | Copy Available with the Spatial Analyst extension. See Copy.

Save
Them e | Convert to S hapefile or Them e | Convert to G rid to save an existing feature or grid theme to the same or different format with a new name. Them e | Sa ve E dits or Theme | Save Edits As to save an edited file to the same filename or to a different filename Save | Data Set To save a temporary grid data set to a permanent one and provide a name.

Convert
Them e | Convert to S hapefile or Them e | Convert to G rid to sa ve a n existing feature or grid theme to the same or different format with a new name.

Geographic Information Systems: A Primer

Page 169

A.2 Clipping feature and grid themes


Files ca n be created in a variety of w ays . File c reation is used in the sense that a new feature or grid is created from scratch. People who get hung up on semantics, m ay fe el tha t form at conversion , in essence create files, so cross-reference yourself there. Clipping or cookie-cutting allows you to create a new feature or grid theme by selecting features from existing files. For example, assume that you want to create a series of maps for a township. Assume as we ll, that you have m aps sh eets which contain data for a larger geographical exten t. In this example, you need to clip the map sheets to the bounds of the township.

Creating a clip theme


There are three basic approaches to produce a clip theme to use in clipping feature or grid data from other themes. 1 Using Existing Features If the geographic bounds exist in a file, then select the feature or features in the theme and select Them e | Convert to S hapefile from the main menu. For example, select a township from a map show ing township boundaries then convert it to a shapefile. 2 Geographic Area is Rectangular The Grdmkr.ave or Basemap.ave scripts can be used to create a bounding rectangle which can be used for clipping. These options are particularly useful if you wish to clip feature data based upon known coordinates for the bounding rectangle. If you are using ArcView 3.2, use the following procedure. 1 Draw a rectangle on the view as a graphic. 2 Right-click on the graphic to bring up a popup m enu and select, Shape Properties. The follow ing window w ill appear wh ich w ill allow you to edit the graphic's bounding rectangle exactly.

Once you are done editing the vertices, click on OK. 3 Select Ed it | Co py G rap hic from the main menu. 4 Select View | New Theme from the main menu, specify a polygon theme type and a filename for the new file to be created. 5 Select Edit | Paste from the main menu and the graphic will be pasted into the new theme.

Geographic Information Systems: A Primer

Page 170

6 Save the edits to the shapefile. 3 Geographic Area is Another Geometric Shape This approach is a bit trickier since you have to create a graphic first of the desired shape and size, then convert it to a shapefile if you intend to clip feature data. The approach is a follows: 1 2 3 4 Make the view active which contains the feature/grid data to clip. Select the desired graph ic tool (triangle, rectangle, irregular polygon ). Draw the graphic area which will be used in clipping. Proceed with steps 3-7 in the instructions for a rectangular clip area.

Once you have created your clipping theme, the features in your target theme can be clipped using the clipthm.ave script or by loading the Geoprocessing exte nsion wh ich is ava ilable in ArcView 3.2. This extension is available under the View | Geoprocessing W izard menu choice as shown below.

Geographic Information Systems: A Primer

Page 171

Clipping a grid
The clipthme.ave script does not work on grid themes so you have to create a gra phic to use as the clipp ing boundary. 1 Create a rectangle graphic on screen To c reate a graphical recta ngle select the re ctangle graph ic tool and d raw a rectangle anywh ere on the view window. D ont worry too m uch w here it is located or w hat it looks like, you will fix it up in the next step. 2 Select the graphic on screen and choose Graphic | Size and Position from the main menu or right-click on the graphic and select graphic properties from the pop-up menu. 3 If you are using the first option, then specify the size and position of the grid. The Graphic Size and Position window w ill appear on screen. M ake sure that Maintain Aspect Ra tio is no t checked. Specify the w idth in the X and Y directions first. S pecify the left or right X value and top or bottom Y value. The other values will be calculated. Below is an example of a bounding rectangle which has the same extent as a file called carpaoi.shp.

If you are using option 2, then edit the vertices of the graphic as previously described. 4 Load and compile the Grextrct.ave script in the ...Sam ples \Scrip ts subdirectory. Select the graphic in the view to use as the clipping graphic. Select the grid theme you wish to subsample by clicking on its legend name in your view. 5 Run the Grextrct.ave script. You should now have a grid in the view called Extract from ... follow ed by th e nam e of the grid that was sampled. This grid is temporary unless the project is saved or you proceed to step 6. 6 Co nve rt to a permanent data set. If the sampled grid is fine, m ake the view w indow active and select Theme | Save Data Set. Give the grid a name and in Theme | Properties you can rename it to m atch the source name. You w ill also notice th at the status has been changed to permanent.

Geographic Information Systems: A Primer

Page 172

Geographic Information Systems: A Primer

Page 173

A.3 Importing and exporting data


Many non-native data sources can be imported by simply using View | Add Theme in an active view and then specify the source feature or grid themes. ArcView reads data directly from a variety of nonnative formats.

Feature data
Feature data can be imported using the standalone program Import71 to bring in ARC/INFO interchange files (*.E00) and the MifShape program or the mif2shp.ave script ca n be used to bring in MapInfo files.

Grid data
Raster data can be imported if you have the Spatial Analyst exte nsion and yo u select File | Import Data Source from an active view windo w. This option will allow you to import raster ASCII, binary, USGS D EM or US DM A DTED data.

Tabular data
There is a myriad of ways to import alphanumeric information. The simplest by far is not to do it but rather convert you r tabular data to a dBase file form at (*.dbf) initially (see below). There is ho we ver, a xls2tbl.ave script which will allow you to co nve rt Excel spreadsheet data to dBase form at.

Export
The re arent that m any option s for exporting feature informa tion to non-n ative forma ts. You can export grid information if you have the Spatial Analyst extension using File | Export Data Source from an active view window.

Other approaches
Digitizing, whether tablet or on-screen, is a useful option for creating feature data. Feature themes can be converted to a grid after digitizing. Tabular data which contains positional information (UTM or long/lat) can be used to create point the mes by a dding the table to th e project (Pro ject | Ad d Table) then selecting Theme | Add Event Theme from an active view window.

Geographic Information Systems: A Primer

Page 174

Appendix B Computer basics


B.1 Introduction
The basics of co mputer use, specifically th ose involving file managem ent, are generally poorly understood by the average person. Most people concentrate their efforts on using applications such as wordprocessors and spreadsheets while ignoring, for the most part, the Windows-based applications themselves. My experience has yielded the following observations: 1 Most users dont understand the concepts of drives, directories, subdirectories and the menu tree of where files are stored. 2 Most users dont really know where an application stores files when their work is saved. Applications programs generally define (or allow you to define) a default sub directory where all saved wo rk w ill go. 3 Most people dont know how to find a file. 4 Most people dont know the difference between copying and moving a file. The previous four points normally lead to frequent discussions along this vein. Student Dan Student Dan Student Dan Student Dan Student Dan Student Dan Student Dan Student Da n, I ca nt find my file, the com puter lost it an d all my wo rk from yesterday is there!!!! Are you sure yo u save d it? Yes!! Where did you save them? Over on that com puter. (P ointing across the room .) Which computer are you sitting at now? This on e!!! (Pointing down and looking at m e, question ing the big salary I a m paid.) What did you call the file? What do you mean? Did you give the file you were saving a name? It had one!?!? Do you happen to know what it was called? (Fumbles with pa pers, hoping desperately that the com puter w rote it dow n in his/h er notes.) Ok. What subdirectory were the files being saved to? The one that the program uses!?!?

Geographic Information Systems: A Primer

Page 175

Dan Student Dan Student Dan

Which one would that be? (Pu lls binder out of backpack trying to get more papers out to fum ble with.) Do you have a backup o n a floppy disk? The com puter store wa snt ope n. (W hen in doubt, pass th e blam e on to someone else .) He re is my summary of what you did. You w orked diligently on a computer, w hich .. congratulations to you.. you have identified. You saved your work with some unknown name in some unknown location and you have no backup.

Lets avoid this type of discussion. Remember the following rules of computing: 1 Co mputers are not sentient. They dont do anything, you do. 2 Save your work frequently using known and documented filenames in known locations on the hard drive. 3 Backu p your work onto floppy disks or burn it to a CD regularly. 4 Problems with the software and/or hardware increase exponentially as the deadline for an assignment is approached. 5 Should the softwa re or hardw are fail (and it will, particularly given p oint 4), the am oun t of wo rk lost will be directly proportional to the elapsed time between saves and backups (e.g. the longer the tim e, the mo re work los t). The tasks described here will be used innumerable times. Make sure that you can do these in your sleep. These house-keeping operations are the types of things that will frustrate you.

Geographic Information Systems: A Primer

Page 176

B.2 Creating a work folder


There are a variety of ways to create and maintain folders within the Windows environment. Only one way will be presented here in an effort to standardize explanation to you the student. The Explorer program wh ich c om es with Window 95/98/NT /XP will be used since it allow s for full dire ctory an d file maintenance operations. If you are using a standalone version of ArcView, it is a good idea to create a shortcut to the Explorer program on the Window s desktop to allow for quick access to the program. In this exam ple, we will assume that you are working in a shared work environment where every student must keep there files in a ST UD EN T subdirectory. If a shortcut to Explorer already e xists, use the following steps to create your working sub directory. 1 Launch Explorer from the deskto p (double-click on the icon ). The Explorer W indow is show n in Figure B.1. Figure B.1 Windows E xplorer Program

2 Click on the Student subdirectory in the left window pane underneath the All Folders title. (You may u se the scroll ba r to locate the folders.) If you look at the right window pane in Figure B1, you will notice that three students have created folders within the student directory. 3 To create you r ow n folder, select File | New, from the main menu, then select Folder. 4 Specify a subdirectory na me w hich is un ique! It is recommended that you dont use spaces in subdirectory names or one that is too long. Perhaps you can use your name but remem ber there m ay b e seve ral Bobs using the lab. You now h ave a working folder. This is where you will store all your files during your work sessions.

Geographic Information Systems: A Primer

Page 177

B.3 Copying and moving files Explorer basics


Copying and moving files can be a dangerous operation for the novice. It is important that you know exactly what you are doing. If in doubt, dont do anything! You are going to copy files to the folder that you just created as a demonstration. To copy or move a file or files, use the following procedure: 1 Launch Explorer if it is not already active. 2 Locate the source directory. This is the directory or subdirectory that contains the files you wish to copy. In our case, locate the c:\esri\av_g is30\avtutor\arcview\qstart subdirectory in the left-hand window of Explorer as shown in Figure B.2. You will notice that the folder beside qstart appears open. Figure B.2 Locating Files Using Windows Explorer

Geographic Information Systems: A Primer

Page 178

Copying files
Perform steps 1 and 2 in the Explorer Basics section, if you have not already done so. 3 Select the files to copy. The files in the source directory will be show n in the right-ha nd w indow of Explorer. Th ere a re several ways to select files. The first step in copying is to select your files. To do this, hold down the ctrl key and click on the files you wish to copy. A continuous list can be selected by holding the shift key and clicking on the 1st file then the last file in the list, every file between them will be selected. There are three preferred methods for copying files. Select Edit | Copy from the m ain m enu (see Figure A.3). Right-click the m ouse button on the selecte d files and select Copy from the pop-up menu (not available in this lab for security reasons). Use the key combination Ctrl+C once the files are selected (see shortcut beside Copy in Figu re B.3). Do Not use the drop-and-drag method in a shared lab facility! Drop-and-drag performs a move operation between folders and can cause problems for other students if you move lab files from an exercise directory to your own folder rather than copying them. Figure B.3 Selec ting Files to Copy from the Source Su bdirec tory

Figure B.3 show s a selection of World 94.* files have been selected for copying. (ArcView stores data files with a com mon prefix and a differing suffix depending upon the file type. M ore will be said about this later.) 4 Locate the destination directory.

Geographic Information Systems: A Primer

Page 179

Select th e destination directory by clicking on it in the left-hand w indow of Explorer (see Figure B.4). To copy th e selected files to this su bdirectory, s elect Edit | Paste from the main menu. Figure B.4 Pas ting Files to the D estination Su bdirec tory

Moving Files
The procedu re for moving files is similar to copying them except you replace step 3 in the Copying Files section with Edit | Cut (or Ctrl+X) from the main menu in place of Edit | Copy. Once you have cut the files from the source folder, proceed to step 4 as before.

Geographic Information Systems: A Primer

Page 180

B.4 File sharing on a network


File sharing amongst networked computers in a teaching lab enables you to gain access to files on one com puter from ano ther. This is the case he re at C arleton University. The G IS lab has com puters netwo rked together to facilitate file sharing even though ArcView is installed loca lly. When will file sharing become necessary? Consider the scenario where you were working on machine 7 and saved all your work there. You return to the lab the next day and a surly individual is occupying your machine. Rather than disturb this person, simply use a different computer and access your files from the previously used computer. In order to enable file sharing use the following procedure.

Login procedure
Networks generally require a Login procedure to permit you to gain access to the networked computers. Check with the course instructor or netw ork administra tor to determ ine you r exa ct log in requirements.

Geographic Information Systems: A Primer

Page 181

B.5 Zipping files


Zipping is a term used to describe the process whereby a file is compressed in size and/or a series of files are compressed and combined into one file called a zip file. These files will have a *.ZIP extension. Zipping can be accomplished using a variety of utilities, however, the Winzip utility is the most common. Winzip assembles and compresses your working files into a single file (which you name). You will be zipping files as part of the everyday procedure in this lab. There are two circumstances where you will routinely zip your files. 1 In a shared facility, only zipped files should be left in your work folder (e.g. d:\stu dent\yo urnam e). All unzipp ed files should be deleted before yo u leave to co nserve space on the loca l hard drive. In other words, at the end of each session, you will zip the files you were using and delete the unzipped ones. 2 You may wish to create a backup of your files onto floppies and the number of files exceeds the storage capacity of a disk (1.44 Mb). This operation is called zipping with disk spanning.

Create the archive


To zip files, use the following procedure. 1 Launch WinZip. (It is a good idea to have the shortcut to the program placed on the Windows deskto p.) 2 Select File | New Archive from the main menu or select the New icon (the archive is the zip file itself). 3 In the New A rchive window, specify a location in the Create in box where you want to create the archive. Do this explicitly by selecting the ? toggle and navigating the menu tree to the desired location (This co uld be c:\studen t\yournam e to zip to the hard drive o r a:\ to zip to a flopp y). While you are still in the New A rchive window, specify the filename for the archive in the Filename box. This is what the file will be called and it will automatically be given a *.ZIP extension. Click on OK. You will now be returned to the main Winzip window. 4 From the main menu, select Actions | Add or click on the Add button. In this window you mu st specify the location of the files in the Add From box. Again, this should done explicitly by selecting the ? toggle and navigating the menu tree to the location containing your files. At this stage, you should see the files you wish to zip. Select the files to include in the archive by holding the Ctrl key down and clicking on the files to include (as before, all files can be selected in a subdirecto ry by u sing the shift-click co mb ination). Once all the files are selected, click Add and the archive will be created.

Opening an archive
To unzip files, use the following procedure.

Geographic Information Systems: A Primer

Page 182

1 Launch WinZip from the Windows desktop. 2 Select File | Open Archive from the main menu or select the Open button. 3 In the Open Archive window specify the location of the file in the Look in box by navigating the menu tree as before. Select the zip file to open, then click on OK . You w ill be re turned to the m ain Winzip screen and a list of files contained in the zip file will appear 4 Select File | Open from the main menu or select the Extract button. The Extract window w ill appear, specify the location where you wish to extract the files to doing this explicitly by selecting from the menu tree as before. You can also selectively open files by selecting individual files in step 3 prior to selecting File | Open.

Geographic Information Systems: A Primer

Page 183

Вам также может понравиться