Академический Документы
Профессиональный Документы
Культура Документы
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
Page 1
Page 2
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).
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.
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
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
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.
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.
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.
Page 6
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.
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.
Page 8
Level
Basic operations
Example
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
Ra tio
mass, or precipitation
Page 10
Geocode Determine the coordinates of a feature given its add ress (e.g. street, landma rk). Georeference
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
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.
Page 13
Page 14
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.
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
Page 16
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.
Page 17
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.
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.
Page 19
Page 20
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
Page 21
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.
Page 22
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
Page 23
Page 24
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.
Page 25
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.
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.
Page 28
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.
Page 29
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
Page 31
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.
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.
Page 33
Page 34
Page 35
The next sections discuss some of the options available to symbolize the views in a variety of wa ys.
Page 36
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.
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
Page 38
Figure 3.10
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.
Page 39
Figure 3.11
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
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
Page 42
Page 43
Figure 3.14
Reclassified Legend
The reclassified map is shown in Figure 3.15. Figure 3.15 Reclassified Map
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.
Page 45
Page 46
Page 47
Figure 3.16
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.
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.
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
Page 50
Figure 3.20
Page 51
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
Page 52
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.
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.
Page 54
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.
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.
Page 56
Page 57
Page 58
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.
Page 59
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.
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.
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.
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
Page 61
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
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.
Page 63
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.
Page 64
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.
? 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* )
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.
Page 66
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.
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.
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
Page 69
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
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.
Page 71
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
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
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
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.
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
Page 76
Page 77
Page 78
Page 79
Table 4.1
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.
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.
Page 81
Once the theme information is obtained, the theme is automatically placed in edit mode.
Page 82
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.
Page 83
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.
Page 84
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.
Page 85
Page 86
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.
Page 87
Page 88
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
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).
Page 91
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
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).
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.
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
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.
Page 95
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,
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.
Page 98
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.
Page 99
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.
Page 100
Figure 5.16
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).
Page 101
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
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.
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
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.
Page 105
Figure 5.19
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:
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
Page 107
Page 108
Figure 5.20
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.
Page 109
Figure 5.22
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.
Page 110
Figure 5.24
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
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.
Page 111
Figure 5.26
Page 112
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, #.
Page 113
Page 114
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.
Page 115
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.
Page 116
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.
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).
Page 117
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
[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
Page 118
[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.
Page 119
6.3
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.
Page 120
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)
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.
Page 122
The following table tries to show how the various operations work with the different polygon cases.
Intersect
Combine
Union
The shapes remain intact but the records are consolidated (a mu ltipart polygon ).
Subtract
Page 123
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.
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.
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
Page 126
Figure 6.11
Su btra ct Example
Page 127
Line Features
The following table su mmarize va rious operations and the typ es of line s that can exist.
Intersect
Merge
Union
Page 128
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.
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
Page 129
Shape Polygon
Label Poly3
Number 3 Line.dbf
Var_3 unique
Area 10000.0000
Shape Polyline
Number 5
Shape Point
Label Point
Number 4
These files and their tables will be referred in the following sections.
Page 130
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:
Page 131
Physical representation
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.
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.
Page 132
Figure 6.19
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.
Page 133
Figure 6.22
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
The question then remains as to wh ether our initial question needs further refinem ent.
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.
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
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
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.
Page 137
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.
Page 138
Figure 6.28
Prior to the spatial join, the source.dbf file showed the following information
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
Page 140
Figure 6.30
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
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.
Page 141
Figure 6.32
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.
Page 142
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.
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).
Page 144
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.
Page 145
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.
Page 146
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)
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.
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
Page 149
rings in step 4 with 1 ring of the specified size . The following figure shows the result.
Page 150
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.
Page 151
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.
Page 152
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.
Page 153
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.
Page 154
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.
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.
Page 156
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
Page 157
In this figure, the World Menu has several items, all of which have scripts attached to them that open particular views.
Page 158
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.
Page 159
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.
Page 160
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.
The Icon Ma nag er dialog box show s the default icons available for selection. Many of these icons are
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.
Page 162
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.
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.
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.
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
Page 165
Figure 7.12
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.
Page 166
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.
Page 168
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.
Page 169
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.
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.
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.
Page 172
Page 173
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.
Page 174
Page 175
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.
Page 176
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.
Page 177
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.
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.
Page 180
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.
Page 181
Opening an archive
To unzip files, use the following procedure.
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.
Page 183