geoprocessing in arcgis: arcgis 9

370
ArcGIS ® 9 Geoprocessing in ArcGIS ®

Upload: editors-of-esri-press

Post on 22-Dec-2016

253 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: Geoprocessing in ArcGIS: ArcGIS 9

ArcGIS®

9Geoprocessing in ArcGIS®

Page 2: Geoprocessing in ArcGIS: ArcGIS 9

Copyright © 2001–2004 ESRIAll rights reserved.Printed in the United States of America.

The information contained in this document is the exclusive property of ESRI. This work is protected under United States copyright law and otherinternational copyright treaties and conventions. No part of this work may be reproduced or transmitted in any form or by any means, electronic ormechanical, including photocopying and recording, or by any information storage or retrieval system, except as expressly permitted in writing by ESRI.All requests should be sent to Attention: Contracts Manager, ESRI, 380 New York Street, Redlands, CA 92373-8100, USA.

The information contained in this document is subject to change without notice.

DATA CREDITS

Geographic data used in the quick-start tutorial provided courtesy of San Diego Association of Governments (SANDAG) and is used herein withpermission.

Some of the illustrations in this work were made from data supplied by Collins Bartholomew Ltd.; IHS Energy; Riley County, Kansas, GIS; andSANDAG. They are used herein with permission.

AUTHOR

Jill McCoy

U.S. GOVERNMENT RESTRICTED/LIMITED RIGHTS

Any software, documentation, and/or data delivered hereunder is subject to the terms of the License Agreement. In no event shall the U.S. Governmentacquire greater than RESTRICTED/LIMITED RIGHTS. At a minimum, use, duplication, or disclosure by the U.S. Government is subject to restrictionsas set forth in FAR §52.227-14 Alternates I, II, and III (JUN 1987); FAR §52.227-19 (JUN 1987) and/or FAR §12.211/12.212 (Commercial TechnicalData/Computer Software); and DFARS §252.227-7015 (NOV 1995) (Technical Data) and/or DFARS §227.7202 (Computer Software), as applicable.Contractor/Manufacturer is ESRI, 380 New York Street, Redlands, CA 92373-8100, USA.

3D Analyst, AML, ArcCatalog, ArcEditor, ArcGIS, ArcGlobe, ArcIMS, ArcInfo, ArcMap, ArcReader, ArcScene, ArcSDE, ArcToolbox, ArcView,BusinessMAP, ModelBuilder, RouteMAP, StreetMap, ESRI, the ESRI globe logo, the ESRI Press logo, GIS by ESRI, and www.esri.com are trademarks,registered trademarks, or service marks of ESRI in the United States, the European Community, or certain other jurisdictions.

Other companies and products mentioned herein are trademarks or registered trademarks of their respective trademark owners.

Attribution.pmd 2004.02.09, 12:401

Page 3: Geoprocessing in ArcGIS: ArcGIS 9

iii

Contents 1 Introduction 1Running tools via their dialog boxes 2Running tools at a command line 3Building models of your work flow 4Adding scripts to toolboxes 5Tips on learning how to perform geoprocessing in ArcGIS 6

2 Quick-start tutorial 9Exercise 1: Finding coastal sage scrub near proposed roads 12Exercise 2: Joining fields to the vegetation data 21Exercise 3: Clipping data to the study area 29Exercise 4: Finding high-quality habitat patches 39Exercise 5: Finding habitat patches impacted by proposed roads 60

3 Geoprocessing basics 67Geoprocessing: The big picture 68Introducing geoprocessing methods 69Working with data 77Results from running tools 88Geoprocessing settings 90Saving and loading geoprocessing settings 92Keeping track of geoprocessing operations 94Sharing your geoprocessing work 96

4 Working with toolboxes 99Opening and docking the ArcToolbox window 100Locating the system toolboxes 101Creating new toolboxes 102Managing toolboxes 104Adding documentation to toolboxes 112Viewing documentation for toolboxes 123Rules for working with toolboxes 125

TOC.pmd 2004.02.09, 12:403

Page 4: Geoprocessing in ArcGIS: ArcGIS 9

iv GEOPROCESSING IN ARCGIS

125 Working with toolsets and tools 127

Managing toolsets 128Working with tools 130Creating models and adding scripts 138Setting parameters 143Changing tool properties 148Adding documentation to tools 157Viewing documentation for tools 167Finding tools 171Understanding tool licensing 173

6 Specifying environment settings 175About environment settings 176Specifying environment settings 179Specifying general settings 183Working with workspaces 184Specifying coverage settings 198About coverage precision 200Setting precision for coverages 202Specifying geodatabase settings 203Specifying raster geodatabase settings 209Specifying raster analysis settings 215

7 Using the Geoprocessing window 219Starting the Geoprocessing window 220Working with the command line 222About variables 231Creating variables 232Managing variables 235

8 Introducing model building 239What is a model? 240

TOC.pmd 2004.02.09, 12:404

Page 5: Geoprocessing in ArcGIS: ArcGIS 9

CONTENTS v

What is the ModelBuilder window? 242Building models 243A model building example 246Creating a new model 250

9 Using the ModelBuilder window 253Building a model 254Element states 260Running a model 261Using nonexistent output data 266Working with variables 268About intermediate data 284Working with intermediate data 286Controlling the flow of processing 287Using the Select Data tool 295Working with model elements 297Working with diagram properties 302Changing diagram properties 308Navigating in the model 314Validating a model 317Repairing a model 318Print setup 320Setting up and printing a model 323Generating a report 325Documenting a process 327Importing a model from ArcView GIS 3 329Exporting a model 331

Appendix 333

Glossary 345

Index 355

TOC.pmd 2004.02.09, 12:405

Page 6: Geoprocessing in ArcGIS: ArcGIS 9

TOC.pmd 2004.02.09, 12:406

Page 7: Geoprocessing in ArcGIS: ArcGIS 9

IN THIS CHAPTER

1

Introduction 1• Running tools via their dialog

boxes

• Running tools at a command line

• Building models of your work flow

• Adding scripts to toolboxes

• Tips on learning how to performgeoprocessing in ArcGIS

Geoprocessing is the processing of geographic information, one of the basicfunctions of a geographic information system (GIS). It provides a way tocreate new information by applying an operation to existing data. Anyalteration or information extraction you perform on your data involves ageoprocessing task. It can be a task such as converting geographic data to adifferent format, or it can involve multiple tasks performed in sequence, suchas those that clip, select, then intersect datasets.

Within ArcGIS® you can perform geoprocessing tasks in a number of ways.

Run a tool using its dialog box. Open a tool’s dialog box, fill in parametervalues, and click OK to run the tool.

Run tools at a command line. Type the tool name and its parameter valuesat a command line, then press Enter to run the tool.

Build and run a model that runs a sequence of geoprocessing tools.Create a model that runs the sequence of geoprocessing tools in your workflow. Alter parameter values, then rerun the model with a single click.

Create and run a script that runs geoprocessing tools. Use system batchprocessing scripts for repetitive tasks, such as those that run the same tool onmultiple inputs, or create your own scripts that run geoprocessing tools.

The next few pages show you some of the geoprocessing tasks that can beperformed within ArcGIS, and the quick-start tutorial in Chapter 2 will helpyou become familiar with the environment. As you start to use ArcGIS toperform your own geoprocessing tasks, you will discover even more.

Page 8: Geoprocessing in ArcGIS: ArcGIS 9

2 GEOPROCESSING IN ARCGIS

Run tools using a dialog box to supply parameter values. In the gas prospecting example, the Kernel Density system toolcalculates the density of producing wells. The result from this tool shows areas that have a high density of producing wells, andthis is the first step in finding areas similar to an existing gas field.

Running tools via their dialog boxesYour geoprocessing tasks can easily be performed by running the dialog box of a system tool—a tool installed with ArcGIS—or acustom tool—a model or a script you have created. Inside a tool’s dialog box, simply enter parameter values and click OK to run thetool. Use the help available within the tool’s dialog box to help you supply parameter values.

Page 9: Geoprocessing in ArcGIS: ArcGIS 9

INTRODUCTION 3

Run tools at a command line by typing the tool name and its parameter values. In the gas prospecting example, the Near tool isrun to assess if the distance to a fault line is significant in the production of gas in the existing field.

Running tools at a command lineTools can be run at a command line. The tool name and its parameter values are typed as a string, and the tool executes when you pressEnter. Usage is displayed as you type, helping you supply appropriate parameter values. You can edit the parameter values for a tool runat the command line in a dialog box, then reexecute the tool. Messages tell you the status of the processing.

Page 10: Geoprocessing in ArcGIS: ArcGIS 9

4 GEOPROCESSING IN ARCGIS

Building models of your work flowCreate a model of your geoprocessing work flow by stringing processes together, then run the model with a single click. By settingmodel parameters, the user of your model can supply values for these parameters when your model is run via its dialog box or thecommand line.

Build a model by adding tools to a ModelBuilder™ window, setting parameter values for each tool, and stringing processestogether. The Arbuckle Prospecting model above locates areas with features similar to those within an existing gas field. Thelocated areas (in red in the display) could have a high probability of being gas-producing areas.

Page 11: Geoprocessing in ArcGIS: ArcGIS 9

INTRODUCTION 5

Add scripts to toolboxes and run them by supplying values for parameters. The profile AML tool determines the five shallowestgas-producing formations above the existing gas field.

Adding scripts to toolboxesScripts can be run from within their scripting application, or they can be added to a toolbox and run like any other tool from a dialog box,the command line, another model, or a script. Scripts can be written in any Component Object Model (COM)-compliant scriptinglanguage, such as Python, JScript, or VBScript, or they can be ARC Macro Language (AMLTM) scripts or executable files.

Page 12: Geoprocessing in ArcGIS: ArcGIS 9

6 GEOPROCESSING IN ARCGIS

If you’re new to the concept of GIS, remember that you don’tneed to know everything about geoprocessing to get immediateresults. Begin learning how to approach geoprocessing byreading Chapter 2, ‘Quick-start tutorial’. This chapter introducesyou to the methods available to perform geoprocessing taskswith ArcGIS and provides an excellent starting point as you beginto think about how to tackle your own particular geoprocessingtasks. ArcGIS comes with the data used in this tutorial, so youcan follow along step by step at your computer.

If you prefer to jump right in and experiment on your own, flip tothe appropriate chapter when you come across a task for whichyou need help. Use the index, the table of contents, and the‘About this book’ section that follows to help you find theinformation you are looking for.

Finding answers to questions

Like most people, your goal is to complete your tasks whileinvesting a minimum amount of time and effort in learning how touse the software. You want intuitive, easy-to-use software thatgives you immediate results without having to read pages ofdocumentation. However, when you do have a question, youwant the answer quickly so you can complete your task. That’swhat this book is all about—helping you get the answers youneed, when you need them.

This book describes the framework and methods for performinggeoprocessing tasks in ArcGIS. Although you can read this bookfrom start to finish, you’ll likely use it more as a reference. Youmay also refer to the glossary in this book if you come across anyunfamiliar GIS terms or need to refresh your memory.

About this book

This book is designed to help you use ArcGIS to perform yourgeoprocessing tasks. Topics covered in Chapter 2, ‘Quick-start

Tips on learning how to perform geoprocessing in ArcGIS

tutorial’, assume you are familiar with the fundamentals of GISand have a basic knowledge of ArcGIS. If you are new to GIS, youare encouraged to take some time to read the relevant ArcGISdocumentation that you received in your ArcGIS package, suchas Getting Started With ArcGIS, and other books that coincidewith the ArcGIS applications you will be using, such as UsingArcMap and Using ArcCatalog. To learn more about writingscripts, Writing Geoprocessing Scripts With ArcGIS providesuseful information. It is not necessary to read suchdocumentation to continue with this book; simply use it as areference.

Chapter 3, ‘Geoprocessing basics’, explains how geoprocessingfits within a GIS, explains the methods you can use to geoprocessyour data, and describes the workspaces and data sources thatcan be geoprocessed. It also explains information you’ll need toknow when running tools, setting geoprocessing options, andsharing your tools. Chapter 4, ‘Working with toolboxes’, explainshow to create and manage toolboxes, how to add and viewdocumentation for toolboxes, and the rules for accessingtoolboxes. Chapter 5, ‘Working with toolsets and tools’, explainshow to manage toolsets and how to work with tools. It describeshow to create your own model inside a toolbox and how to add ascript to a toolbox. It also explains how to set parameters so theuser of your model or script can supply values for parameterswithin the dialog box of your model or script, how to adddocumentation to your tools, and how to find the tools you arelooking for. Chapter 6, ‘Specifying environment settings’, explainsthe hierarchy of environment settings that you can set andprovides information for each environment setting that can beapplied to your results from running tools. Chapter 7, ‘Using theCommand Line window’, explains how to run commands at thecommand line and explains how to work with the message sectionof the Command Line window. Chapter 8, ‘Introducing modelbuilding’, gives conceptual information on building models, gives

Page 13: Geoprocessing in ArcGIS: ArcGIS 9

INTRODUCTION 7

an overview of the ModelBuilder window, and explains theprocess of creating and building a new model. Chapter 9, ‘Usingthe ModelBuilder window’, gives more detailed information forusing the ModelBuilder window to build models. The Appendixexplains how the default stylesheets applied to tool dialog boxescan be altered to change the appearance of your dialog boxes.

Getting help on your computer

In addition to this book, you can use the online Help system tolearn more about geoprocessing. See Chapter 4, ‘Viewingdocumentation for toolboxes’, and Chapter 5, ‘Viewingdocumentation for tools’, for information on getting help fortoolboxes and tools.

For a list of the tools available with each product of ArcGIS(ArcView®, ArcEditor™ and ArcInfo™), type “Quick ReferenceGuide” in the Search tab of the online Help system and double-click the link to the Geoprocessing Commands Quick ReferenceGuide.

Contacting ESRI

If you need to contact ESRI for technical support, refer to‘Contacting Technical Support’ in the ‘Getting more help’ sectionof the ArcGIS Desktop Help system. You can also visit ESRI onthe Web at www.esri.com and support.esri.com for moreinformation on geoprocessing and ArcGIS.

ESRI education solutions

ESRI provides educational opportunities related to geographicinformation science, GIS applications, and technology. You canchoose among instructor-led courses, Web-based courses, andself-study workbooks to find education solutions that fit yourlearning style. For more information, go to www.esri.com/education.

Page 14: Geoprocessing in ArcGIS: ArcGIS 9
Page 15: Geoprocessing in ArcGIS: ArcGIS 9

IN THIS CHAPTER

9

This tutorial will take you on a tour of the geoprocessing functionality withinArcGIS as you find areas in San Diego County with the best potential tosupport the California gnatcatcher (Polioptila californica).

The California gnatcatcher is a small nonmigratory songbird that residespredominantly in southwestern California and northwestern Baja. Thegnatcatcher population has been in decline over several decades because ofextensive habitat loss due predominantly to urbanization. Most habitats arefragmented by roads; building tracts; and other barriers insurmountable to thesmall, weak-flying bird. The species is listed as threatened and is dependentupon certain vegetation types for its survival.

The goal of this tutorial is to find patches of potentially high-quality habitat—patches that contain features essential to the conservation of the species—then to identify which patches would be impacted by proposed roads. Newroads will only serve to further fragment these fragile regions, so those high-quality habitat patches that will be impacted need to be identified.

In achieving the above goal, you will learn how to:

• Run geoprocessing tools through dialog boxes and the command line.

• Create models inside, and add scripts to, toolboxes.

By following the tutorial, you’ll quickly learn how to perform your owngeoprocessing tasks with ArcGIS. Included is an estimate of the time it willtake to complete each exercise. You can work through the entire tutorial orcomplete each exercise one at a time. Although recommended, you don’thave to complete the exercises in sequence.

Quick-start tutorial 2• Exercise 1: Finding coastal sage

scrub near proposed roads

• Exercise 2: Joining fields to thevegetation data

• Exercise 3: Clipping data to thestudy area

• Exercise 4: Finding high-qualityhabitat patches

• Exercise 5: Finding habitatpatches impacted by proposedroads

Page 16: Geoprocessing in ArcGIS: ArcGIS 9

10 GEOPROCESSING IN ARCGIS

Tutorial requirements

• It is assumed that you have installed ArcGIS Desktop beforebeginning this tutorial.

• You can perform Exercise 1 with an ArcView, ArcEditor, orArcInfo license. The rest of the exercises require an ArcInfolicense.

• The data required is included on the ArcGIS Desktop CD.After running the ArcGIS setup, on the Additional InstallationComponents dialog box, check to install the ArcGIS TutorialData. In the ArcGIS Tutorial Data Setup wizard, select toinstall the Geoprocessing data (the default installation path isarcgis\ArcTutor\Geoprocessing) on the drive where thetutorial data is installed.

Climate.shp, futrds, majorrds.shp, study_quads.shp, vegtype,and vegtable.dbf were provided courtesy of the San DiegoAssociation of Governments (SANDAG) for educationalpurposes only. The data has been manipulated for thepurpose of the tutorial. Assumptions applied and actualoutcomes may vary. ESRI is not inviting reliance on this dataor the methodologies followed. You should always verifyactual data and exercise your own professional judgmentwhen interpreting any outcomes.

Data Description

climate.shp General climate zones.

elevlt250.shp Areas where the elevation is less than250 m. This shapefile was derived froma United States Geological Survey(USGS) digital elevation model (DEM).

futrds A geodatabase feature class of allproposed freeways and roads.

habitat_analysis.mdb A personal geodatabase containingthe feature classes futrds and vegtype.

majorrds.shp All major roads and freeways.

multi_clip.py A Python script used to clip multiplefeature classes and place them into apersonal geodatabase.

query.txt Includes an expression that can becopied and pasted into the expressionbox on the Select tool’s dialog boxused in Exercise 4. It can be used as analternative to the Query Builder ortyping the expression.

slopelt40.shp Areas where the slope of the landis less than 40 percent. This shapefilewas derived from a USGS DEM.

study_quads.shp The study area. USGS 7.5 quadboundaries covering the towns ofLa Jolla and La Mesa in San DiegoCounty.

vegtype A geodatabase feature class ofvegetation type information.

Page 17: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 11

vegtable.dbf A table containing fields that will bejoined to a layer you’ll create fromvegtype. The fields include avegetation description field and afield indicating whether the vegetationtype is suitable for habitation by thegnatcatcher.

The ArcCatalog™ tree provides access to datasets stored ondisk. In the ArcCatalog tree, click a dataset, then click theMetadata tab to explore the metadata (information) of eachdataset in detail. Explore metadata for the tutorial folder to gain anoverview of the data contained in the folder and how it wascreated.

Page 18: Geoprocessing in ArcGIS: ArcGIS 9

12 GEOPROCESSING IN ARCGIS

Exercise 1: Finding coastal sage scrub near proposed roads

The above diagram shows the model you’ll run to identify vegetation typesnear proposed roads.

When working with ArcGIS you’ll likely need to performgeoprocessing tasks at some stage in your work flow. InArcGIS geoprocessing tasks are performed by runningtools. Many times your work flow takes multiple steps toproduce the desired result. You can perform eachgeoprocessing task individually by running a system tool viaits dialog box or the command line, or you can string taskstogether to build a model or a script.

In this exercise you’ll copy the tutorial data locally usingArcCatalog, then in ArcMap™ you’ll review and run anexisting model that runs a sequence of system tools. Themodel identifies the vegetation types near proposed roads.

The interface you use to build and edit models is theModelBuilder window. By adding a tool to a ModelBuilderwindow and supplying values for the tool’s parameters, youconstruct a process. A model is built by connecting pro-cesses together. The model can be run with a single click. Amodel increases your efficiency because you can easilyalter input data or other parameter values, then reexecutethe model to produce different results.

The diagram that follows shows the model you’ll run. In themodel, the roads are first buffered using values from theDistance field in the roads attribute table. The value for theDistance field of each road segment depends on the widthof the road. The wider the road, the farther the distance(buffer), due to the impact on the surrounding area. Theoutput from the Buffer tool (Buffer Zones) is used to clipthe vegetation data (Vegetation Types) to identify thevegetation types within the buffer zones (Vegetation NearRoads).

After running the model, you’ll select all features in the finaloutput data that represent coastal sage scrub vegetation toidentify the patches of this vegetation type that would beimpacted by the addition of the proposed roads.

This exercise will take approximately 15 minutes tocomplete.

Page 19: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 13

2. Type the path or navigate to the location where youinstalled the tutorial data. For example, if you installedArcGIS on your C:\ drive, type“C:\arcgis\ArcTutor\Geoprocessing”, then click OK toestablish a folder connection.

Your new folder connection to the tutorial data is listed inthe ArcCatalog tree.

Organizing your data

Before working with geoprocessing tools you’ll first orga-nize your tutorial data using ArcCatalog.

Starting ArcCatalog

1. Start ArcCatalog by either double-clicking a shortcutinstalled on your desktop or using the Programs list inyour Start menu.

Locating the tutorial data

By connecting to a folder in ArcCatalog you can quicklysee the folders and data sources it contains. You’ll nowbegin organizing your tutorial data by establishing a folderconnection to its location.

1. Click the Connect to Folder button.

1

2

1

Page 20: Geoprocessing in ArcGIS: ArcGIS 9

14 GEOPROCESSING IN ARCGIS

Creating a working copy of the tutorial data

You’ll now copy the tutorial data into a folder on a local diskto maintain the integrity of the original data. Once it hasbeen copied, you will then create a connection to the foldercontaining the data.

1. Click the connection to the tutorial data and click theSan_Diego folder in the Contents tab.

2. Click the Copy button on the Standard toolbar.

3. Click the C:\ (or an alternative drive) folder connectionin the ArcCatalog tree, then click the Paste button.

A new folder called San_Diego will appear in theContents list.

4. Click the new San_Diego folder in the Contents tab toselect it, then click again to rename the folder.

5. Type “GP_Tutorial” and press Enter.

6. Click the Connect to Folder button again, create aconnection to your GP_Tutorial folder, and click OK.

Your new folder connection, for example,C:\GP_Tutorial, is now listed in the ArcCatalog tree. Youwill access this connection many times during thistutorial.

Reviewing an existing model

Models can be run within any ArcGIS Desktop application.In this exercise you’ll work within ArcMap to identifyvegetation types near proposed roads.

1

2

3

5

Page 21: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 15

Toolboxes can contain system tools—tools installed bydefault—or they can contain custom tools that you havecreated, such as models or scripts, that might run a numberof tools at one time. You’ll now review a model that hasalready been built using two system tools.

2. Right-click the ArcToolbox folder in the ArcToolboxwindow and click Add Toolbox. Click the Look indropdown arrow and click the connection to your localcopy of the tutorial data—for example, C:\GP_Tutorial.Double-click Habitat_Analysis.mdb, then click thetoolbox My_Analysis_Tools and click Open.

3. Expand the My_Analysis_Tools toolbox.

4. Right-click the model Find Vegetation Near Roads andclick Edit.

Opening the Vegetation Analysis.mxd

1. Click the connection to your GP_Tutorial folder in theArcCatalog tree, click the Contents tab, then double-click the map document Vegetation Analysis to open it.

As you have finished using ArcCatalog in this exercise,close your ArcCatalog session.

2. Click ArcCatalog on the desktop taskbar to maximize it.

3. Click File, then Exit to exit the ArcCatalog session.

Opening the ArcToolbox window

The ArcToolbox™ window is dockable in any ArcGISDesktop application. It provides access to tools you havestored on disk.

1. Click the Show/Hide ArcToolbox Window button on theStandard toolbar to open the ArcToolbox window.

1

1

4

3

Page 22: Geoprocessing in ArcGIS: ArcGIS 9

16 GEOPROCESSING IN ARCGIS

6

5

This opens a previously created model in itsModelBuilder window so you can review it.

Input data elements that represent existing data appear asblue ovals in the model. Tool elements that represent toolsstored on disk appear as yellow rectangles. Derived dataelements, which represent data that will be created whenthe model is run, appear as green ovals.

5. Click the Search tab on the ArcToolbox window.

6. Type “Buffer”, then click Search to locate the Buffertool in the ArcToolbox window.

If you have the Analysis Tools toolbox and the CoverageTools toolbox added to the ArcToolbox window, you’ll seetwo Buffer tools in the list of found tools. The Buffer tool inthe Coverage Tools toolbox only works with coverages asinputs. The tool in the Analysis Tools toolbox works withfeature classes as inputs.

7. Click the Analysis Tools Buffer and click Locate.

The tool is located in the ArcToolbox window.

Rather than opening the Buffer tool’s dialog box from theArcToolbox window, you’ll open it within the ModelBuilderwindow to view the parameter values set for the tool.

7

Page 23: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 17

8

8. Right-click the Buffer tool element in the model andclick Open to open the tool’s dialog box.

A description for the tool is displayed in the Help panelby default.

9. Click each parameter in the dialog box to view help inthe Help panel for each.

10. Click Help to get more detailed help for the tool ifdesired.

11. Click Cancel on the Buffer dialog box.

12. Right-click the Clip tool element and click Open to openthe tool’s dialog box.

13. Examine the parameter values set for the tool and viewthe help for each parameter as you did with the Buffertool, then click Cancel.

In this model there are two processes, each consisting of atool and its parameter values—one using the Buffer tooland the other using the Clip tool. The two processes areconnected together to build the model.

Q

W

Page 24: Geoprocessing in ArcGIS: ArcGIS 9

18 GEOPROCESSING IN ARCGIS

Running the model

The model is colored in, meaning it is in a ready-to-runstate, as all necessary parameter values have been suppliedin each tool’s dialog box.

1. Click Model, then Run.

When the model runs, the tool of the process that is cur-rently executing is highlighted in red. When each processhas executed, a dropshadow appears behind the tool and itsderived data element, indicating that the process has runand the derived data has been created on disk.

2. Click Close on the progress dialog box.

The final result is added to the ArcMap display by default,because the option to add derived data to the display ischecked on the context menu of the derived data elementVegetation Near Roads.

3. Right-click the Vegetation Near Roads derived dataelement in the model to see that Add To Display ischecked.

4. Click Model, then Close, then click Yes to save thechanges you have made to the model.

1

3

4

Page 25: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 19

5. Examine the final result (vegtype_clip) in the ArcMapdisplay. In the graphic below, the color used to symbolizevegtype_clip is purple. The color is randomly generatedfor the output feature class, so the color used in symbol-izing your feature class might be different.

All vegetation types near proposed roads have beenidentified.

Selecting areas of coastal sage scrub

You’ll now select areas where the vegetation type is SanDiego coastal sage scrub to see how much of this particularvegetation type would be impacted by the proposed roads.

1. Click Selection on the Main menu and click Select ByAttributes.

2. Click the Layer dropdown arrow and click vegtype_clip.

3. Double-click the field [HOLLAND95] to add it to theexpression box.

4. Click = to add the equals operator to the expression box.

5. Click Get Unique Values then double-click the uniquevalue ‘32500’ to add it to the expression box.

HOLLAND95 is a code for vegetation type. The value32500 corresponds to San Diego coastal sage scrub.

6. Click Verify to check the syntax of the expression.

7. Click Apply to select the features.

8. Click Close.

1

6

3

8

4 5

7

2

Page 26: Geoprocessing in ArcGIS: ArcGIS 9

20 GEOPROCESSING IN ARCGIS

9. Examine the selection in the ArcMap display. All areasnear proposed roads where the vegetation is San Diegocoastal sage scrub are identified.

This brings you to the end of Exercise 1. This exercise hasgiven a brief introduction to running models. The rest of thistutorial goes into more detail about geoprocessing inArcGIS. You’ll use more of the system tools, run a script tobatch process multiple inputs, and build more complexmodels. You can continue on to Exercise 2 or stop andcomplete the tutorial at a later time. If you do not move onto Exercise 2 now, do not delete your working copy of thetutorial data, which is your GP_Tutorial folder, and do notremove the folder connection that accesses it fromArcCatalog.

10. Click File on the Main menu of ArcMap and click Exit.Click Yes to save your changes.

Page 27: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 21

ArcInfo

There are multiple system tools that you can access, suchas dissolve or union, through system toolboxes that areinstalled with ArcGIS.

In ArcCatalog you can choose whether to access systemtools via the ArcCatalog tree or the ArcToolbox window. Ifyour toolboxes are located in different locations on disk, it isrecommended that you use the ArcToolbox window tocentralize the location of the toolboxes you use mostfrequently. In applications in which the ArcCatalog tree isnot accessible, such as in ArcMap, you’ll always work withtools using the ArcToolbox window.

Some manipulations you make to your data should be doneas preparation steps, so you can avoid the repetition ofunnecessary steps in your main work flow. In this exerciseyou’ll first locate the system toolboxes on disk, then you’llopen the ArcToolbox window. Once you have specifiedappropriate environment settings, you’ll join two fields to alayer you’ll create from the vegetation data (vegtype). Thisexercise will take approximately 20 minutes to complete.

Setting up

1. Start ArcCatalog by using the Programs list in your Startmenu.

If you did the previous exercise, skip the next step and go tothe next section (‘Locating the system toolboxes’).

2. Copy the GP_Tutorial folder fromarcgis\ArcTutor\Geoprocessing\Results\Ex1 on the drivewhere you installed ArcGIS to a local drive, such asyour C:\ drive.

Exercise 2: Joining fields to the vegetation data

Locating the system toolboxes

The Toolboxes folder in the ArcCatalog tree contains twofolders: a My Toolboxes folder and a System Toolboxesfolder. The My Toolboxes folder points to a location ondisk that can be changed in the Geoprocessing tab of theOptions dialog box. It is the location used for new toolboxescreated inside the ArcToolbox window. The My Toolboxesfolder also contains a History toolbox within which historymodels are created automatically for each session, record-ing the tools and parameter values used. For more informa-tion on the My Toolboxes folder, see ‘Changing the defaultlocation of the My Toolboxes folder’ in Chapter 4. For moreinformation on history tools, see ‘Keeping track ofgeoprocessing operations’ in Chapter 3.

The System Toolboxes folder contains the toolboxes thatcome with ArcGIS. The Toolboxes folder is not added tothe ArcCatalog tree by default.

1. Click the Tools menu and click Options.

1

Page 28: Geoprocessing in ArcGIS: ArcGIS 9

22 GEOPROCESSING IN ARCGIS

2. Click the General tab and check Toolboxes if it is notalready checked.

3. Click OK on the Options dialog box.

4. Expand the Toolboxes folder, then expand the SystemToolboxes folder to view the toolboxes that areavailable.

Each toolbox contains a set of system tools that can beused to geoprocess your data.

Working with the ArcToolbox window

The ArcToolbox window provides a way to centralize thelocation of the tools you use most frequently. You canremove toolboxes you don’t use often from the ArcToolbox

window and add them back at any time. The ArcToolboxwindow is dockable inside any ArcGIS Desktop application.

1. Click the Show/Hide ArcToolbox Window button on theStandard toolbar of ArcCatalog to open the ArcToolboxwindow.

The window is placed within the application. Its positionmay vary depending on the windows you have open.

Docking the ArcToolbox window

The ArcToolbox window can be placed anywhere in theapplication or on the desktop.

1. Click and drag the bar at the top of the ArcToolboxwindow.

2. Place the ArcToolbox window over the ArcCatalog tree,then drop the panel. The outline of the ArcToolboxwindow helps you to place it in the desired position.

1

4

2

2

1

Page 29: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 23

Your ArcToolbox window should now display under theArcCatalog tree, as the following diagram shows.

Note: If you hold down the Ctrl key and drag theArcToolbox window, it will not dock itself to theapplication.

Setting the geoprocessing environment

Before you start to perform geoprocessing tasks on yourdata, you should set up any relevant environment settings.The application Environment Settings dialog box allows youto change the default application settings that are usedwhen you run geoprocessing tools.

Note: You can specify environment settings for the applica-tion that will apply to all tools. Alternatively, you can setenvironment settings for a specific model or for a processwithin a model. Environment settings for the application areused by default unless they are specified for a model or for

a process within a model. Settings for a process willoverride settings for the model and for the application.Settings for a model will override settings for the applica-tion. For more information on environment settings, seeChapter 6, ‘Specifying environment settings’.

1. Right-click the ArcToolbox window and click Environ-ments to open the Environment Settings dialog box forthe application.

1

Page 30: Geoprocessing in ArcGIS: ArcGIS 9

24 GEOPROCESSING IN ARCGIS

2. Click General Settings to expand its contents.

3. Click the Current Workspace parameter and type thepath to your GP_Tutorial folder—for example,“C:\GP_Tutorial”—for its value. Alternatively, click theBrowse button to the right of the parameter and navigateto this location.

4. Click OK.

Now that the current workspace is set, you can simplytype the name for the input and output parameter values.Data will be taken from, and placed in, this location,saving you time typing in or browsing to the location ofdata each time you run a tool.

Adding fields to the vegetation data

If you performed Exercise 1, you selected areas where thevegetation type was San Diego coastal sage scrub—polygons with a value of 32500 for the HOLLAND95 field

in the attribute table of vegtype.shp. This vegetation type ispreferred by the California gnatcatcher. However, there areother vegetation types that are also suitable. You’ll now jointwo fields from a dBASE® Format (DBF) table(vegtable.dbf) to a layer you’ll create from your vegetationfeature class, vegtype, located insideHabitat_Analysis.mdb. The fields you’ll join to the layer areHABITAT—a Boolean field indicating whether or not thevegetation type is suitable for habitation by thegnatcatcher—and VEG_TYPE—a description for theHOLLAND95 code.

As when joining fields in ArcMap, the Add Join tool onlyaccepts in-memory layers that reference geographic datastored in a data source. You’ll create a layer—vegtypelayer—and join vegtable.dbf to it. Then you’llcreate a new layer from the result of the Add Join tool, soyou can rename the fields to be more meaningful and makevisible those fields that you want to see in the attribute tableof the output layer. You’ll then copy the features in the layerto a new feature class that you’ll save insideHabitat_Analysis.mdb.

2 3

4

Page 31: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 25

Creating a layer

1. Expand your GP_Tutorial connection, then click the plussign next to the Habitat_Analysis.mdb to view itscontents.

2. In the ArcToolbox window, expand the Data Manage-ment Tools toolbox, then expand the Layers and TableViews toolset.

3. Right-click Make Feature Layer and click Open ordouble-click the tool.

4. Drag the feature class vegtype from within theHabitat_Analysis geodatabase into the Input Featurestext box.

5. Type vegtypelayer for the name of the in-memory layerto create.

6. Click OK.

An in-memory layer is created. You cannot see this layerin the ArcCatalog tree, but it can be used as input togeoprocessing tools that support it.

7. Click Details on the progress dialog box to view theexecution messages produced.

8. Check Close this dialog when completed successfully onthe progress dialog box, then click Close.

5

6

4

3

Page 32: Geoprocessing in ArcGIS: ArcGIS 9

26 GEOPROCESSING IN ARCGIS

Joining the DBF table to vegtypelayer

1. In the ArcToolbox window, expand the Data Manage-ment Tools toolbox, then expand the Joins toolset.

2. Right-click Add Join and click Open.

Notice that all required parameters in the Add Join dialogbox—except Keep All, as this is an optional param-eter—need values set for them. There is a green circlenext to these parameters, indicating that a value needs tobe specified.

3. Click the dropdown arrow and click vegtypelayer to usethe created in-memory layer as the value for the LayerName or Table View parameter.

The Add Join tool appends attributes from one table toanother using a common field. Here, the common field isnamed the same in the layer and in the table(HOLLAND95).

4. Click the dropdown arrow for the Input Join Fieldparameter and click HOLLAND95.

5. Type “vegtable.dbf” for the value of the Join Tableparameter.

The path to the current workspace is supplied for youwhen you click another parameter.

6. Click the dropdown arrow for the Output Join Fieldparameter and click HOLLAND95.

7. Leave the default Keep All to retain all records in theresult.

8. Click OK.

Vegtypelayer will now contain two fields: HABITAT andVEG_TYPE.

3

4

5

67

8

1

2

Page 33: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 27

Creating a feature class from the layer

You’ll now copy the features in the layer to a feature classusing the Copy Features tool.

1. In the ArcToolbox window, expand the Features toolsetlocated inside the Data Management Tools toolbox.

2. Right-click Copy Features and click Open.

Renaming and choosing visible fields

You’ll now create an in-memory layer from vegtypelayerwith a subset of fields. You’ll also rename the fields toremove the concatenated text introduced by joining fields.

1. In the ArcToolbox window, expand the Layers and TableViews toolset located inside the Data Management Toolstoolbox.

2. Right-click Make Feature Layer and click Open.

3. Click the Input Features parameter dropdown arrow andclick the in-memory layer vegtypelayer.

4. Type “vegtype_new” for the value of the parameterLayer Name. This is the name of the output layer tocreate. The output layer is an in-memory layer thatreferences the data source of the layer set for the InputFeatures parameter.

5. In the Field Info table, click and widen theNewFieldName column.

6. In the Field Info table, click vegtype.HOLLAND95 inthe NewFieldName column and remove the textvegtype.. Remove the text vegtype. fromvegtype.Shape_Length and vegtype.Shape_Area.Remove the text vegtable. from vegtable.HABITAT andvegtable.VEG_TYPE.

7. Click TRUE in the Visible column for both vegtable.OIDand vegtable.HOLLAND95 and change it to FALSE.You don’t need the OID field, and you have two HOL-LAND95 fields, so one can be removed from view.

8. Click OK.

8

3

4

7

6

5

Page 34: Geoprocessing in ArcGIS: ArcGIS 9

28 GEOPROCESSING IN ARCGIS

3. Click the dropdown arrow for the Input Features param-eter and click the vegtype_new layer you created.

4. Click the Browse button next to the parameter OutputFeature Class.

5. Click the Look in dropdown arrow and click the connec-tion to the tutorial data (C:\GP_Tutorial). Double-clickHabitat_Analysis.mdb, then type “vegtype2” for thename of the output feature class to create inside thegeodatabase.

6. Click Save on the Output Feature Class dialog box, thenclick OK.

You’ll now delete the feature class vegtype from yourHabitat_Analysis geodatabase, as it is no longer needed.

7. In the ArcCatalog tree, right-click vegtype inside theHabitat_Analysis geodatabase and click Delete.

8. Right-click vegtype2 and click Rename. Type “vegtype”and press Enter.

6

3

4

You can continue on to Exercise 3 or stop and completethe tutorial at a later time. If you do not move on toExercise 3 now, do not delete your working copy of thetutorial data or the folder connection that accesses it inArcCatalog.

Page 35: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 29

ArcInfoExercise 3: Clipping data to the study area

You can complete many tasks using the system tools as youhave learned in Exercise 2; however, the process of runningsingle tools can be time-consuming. When you want toperform batch processing (running the same tool onmultiple inputs), such as when converting multiple datasetsto a different format, running the same tool multiple times isnot ideal. To automate your work flow so you can, forinstance, perform a task on multiple inputs in one step, youcan add your own scripts to a toolbox. Scripts you add to atoolbox work as any system tool. They can be run via adialog box, at the command line, inside a model, or insideanother script.

This exercise will take approximately 15 minutes to com-plete. You’ll add a previously created script to a toolbox thatwill clip the tutorial datasets located in your GP_Tutorialfolder and place them inside your Habitat_Analysis per-sonal geodatabase. If you would like to create the scriptfrom scratch before starting this exercise, follow theexample ‘Creating a New Script Module’ in Chapter 2 ofWriting Geoprocessing Scripts With ArcGIS.

Setting up

1. If you don’t have ArcCatalog open, start it by using thePrograms list in your Start menu.

If you did the previous exercise, skip the next step and go tothe next section, ‘Adding a new toolbox toHabitat_Analysis.mdb’.

2. Copy the GP_Tutorial folder fromarcgis\ArcTutor\Geoprocessing\Results\Ex2 on the drive

where you installed ArcGIS to a local drive, for example,your C:\ drive.

Adding a new toolbox to Habitat_Analysis.mdb

You’ll first create a new toolbox to hold the tools you’llcreate in this exercise.

1. Right-click Habitat_Analysis.mdb in your GP_Tutorialfolder, point to New, and click Toolbox.

A new toolbox is created inside the geodatabase.

2. Expand your Habitat_Analysis geodatabase to see thecreated toolbox in the ArcCatalog tree.

3. Right-click the toolbox and click Rename. Type“My_Management_Tools” and press Enter.

1

3

Page 36: Geoprocessing in ArcGIS: ArcGIS 9

30 GEOPROCESSING IN ARCGIS

Creating a shortcut to the toolbox

You’ll create a shortcut to your My_Management_Toolstoolbox in the ArcToolbox window. The toolbox shortcut willpoint to your My_Management_Tools toolbox stored insideyour Habitat_Analysis geodatabase on disk.

1. Right-click your My_Management_Tools toolbox andclick Add to ArcToolbox.

2. If the ArcToolbox window is not displayed, click theShow/Hide ArcToolbox Window button on the Standardtoolbar, then collapse all the toolboxes inside theArcToolbox window so you can see yourMy_Management_Tools toolbox.

Adding a script to your toolbox

1. Right-click your My_Management_Tools toolbox in theArcToolbox window, point to Add, and click Script.

2. Type “Multi_Clip” for the name of the script and type“Clip Feature Classes” for the label.

3. Optionally, add a description to explain what the scriptwill do.

The script’s name can be used when running the scriptinside another script or at the command line. The label isused as the script’s display name in the user interface.

The default stylesheet will be applied to the dialog box ofthe script unless specified otherwise. Here you’ll use thedefault, so leave the Stylesheet text box blank.

4. Check Store relative path names.

All pathnames referenced by the script will be storedrelative to the location of the toolbox containing thescript. Storing relative paths avoids the hassle of repair-ing pathnames to data sources if the toolbox and associ-ated data sources are moved to a new location. Providedthe same directory structure is used at the new location,the tools contained within the toolbox will still be able tofind their data sources by traversing the relative paths.

1

1

2

Page 37: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 31

5. Click Next.

6. Click the Browse button to the right of the Script Filetext box and navigate to your GP_Tutorial folder.

7. Click multi_clip.py and click Open to add the script.

A script is a simple text file that can be created in anytext editor. It holds a loosely typed (meaning variabledeclaration is not required) scripting language, such asJScript, VBScript, or Python. Refer to WritingGeoprocessing Scripts With ArcGIS to learn moreabout writing geoprocessing scripts.

8. Click Next.

Leave the parameters and their properties as they are atthis point.

9. Click Finish.

The script Clip Feature Classes has been added to yourMy_Management_Tools toolbox.

6

2

3

5

4

Page 38: Geoprocessing in ArcGIS: ArcGIS 9

32 GEOPROCESSING IN ARCGIS

Editing a script

1. Right-click the script in the ArcToolbox window andclick Edit.

This opens the Python script in the PythonWin applica-tion so you can view or modify the contents of thescript.

2. Examine the code. Notice that the values set for thevariables gp.workspace, clipFeatures, out_workspace,and clusterTolerance are set as system arguments(sys.argv [ ]). Four parameters need to be defined forthese system arguments in the Properties dialog box ofthe script so the parameters will display on the script’sdialog box.

For more information on the contents of this particularscript, see ‘Creating a New Script Module’ in Chapter 2of Writing Geoprocessing Scripts With ArcGIS.

Note: Instead of using system arguments for the valuesof variables, you could hard code the value. However,hard coding the value means that only the value speci-fied in the script can be used—for example, the path toa workspace containing input data.

3. Close the PythonWin application.

Setting script parameters

1. Right-click your Clip Feature Classes script in theArcToolbox window and click Open to open its dialogbox.

Notice that there are no parameters on the dialog box.This is because they have not been defined for the foursystem arguments (sys.argv [ ]) you saw in the code.

2. Click Cancel.

2

1

1

Page 39: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 33

3. Right-click the Clip Feature Classes script and clickProperties.

4. Click the Parameters tab.

Setting the Input Folder parameter

1. In the Parameters section, click in the first row underthe column heading Display Name.

2. Type “Input Folder” for the name of the parameter.

You must specify the type of data a parameter can store.

3. Click the same row under the column heading Data Typeto specify the data type for the parameter.

4. Scroll through the list of data types and click Folder.

5. Examine the property values set for the Input Folderparameter in the Parameter Properties section of thedialog box.

The values that could be set for the property Type areeither Required or Optional. As it is required to set aninput folder, leave the default value, Required.

The values that can be set for the property Direction areeither Input or Output. As this parameter is an inputparameter—that is, the folder contains the input featureclasses that will be clipped—leave the default value,Input.

If the input parameter accepted multiple values, such asmultiple folders, you would set the MultiValue propertyvalue to Yes. However, here you can only process onefolder at a time, so leave the default value, No.

You can specify a default value that will display for theparameter on the tool’s dialog box. For the input folder,

2

3

4

Page 40: Geoprocessing in ArcGIS: ArcGIS 9

34 GEOPROCESSING IN ARCGIS

you want the default value to be the path to yourGP_Tutorial folder.

6. Type “C:\GP_Tutorial” for the value of the propertyDefault if your GP_Tutorial folder is on your C:\ drive.Alternatively, type the path to your GP_Tutorial folder.

This value will be displayed and used by this parameterby default.

Don’t set a value for the Environment property; instead,accept the default. This property will be explained whenthe cluster tolerance parameter property values aredefined.

Attribute domains are used to constrain the valuesallowed for the parameter. There are two different typesof attribute domains: range domains or coded valuedomains. A range domain specifies a valid range ofvalues, and a coded value domain specifies a valid set ofvalues for a parameter. For this parameter, an attributedomain is not necessary.

Some parameters are dependent on the value of otherparameters for information, such as a parameter thatlists the fields in an input table. The fields can only bedisplayed once the input data parameter has a value. Theinput folder is not dependent on any other parameter, soyou’ll use the default.

The values for the properties of the parameter InputFolder should now be set up as shown in the graphic thatfollows.

Setting the Input Clip Feature Class parameter

1. Click in the second row under the column headingDisplay Name.

2. Type “Input Clip Feature Class”.

3. Click the same row under the column heading DataType to specify the data type for the parameter.

4. Scroll up through the list of data types and click FeatureClass.

5. Leave the defaults for the values of the properties Type,Direction, and MultiValue, then type the location forGP_Tutorial\study_quads.shp, such as“C:\GP_Tutorial\study_quads.shp”, for the value of theproperty Default. This shapefile will be displayed andused as the value for the parameter by default.

Your Properties dialog box should now resemble thegraphic that follows.

Page 41: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 35

The values set for the properties of the parameterOutput Workspace should resemble those in the graphicthat follows.

Setting the Output Workspace parameter

1. Click in the third row under the column heading DisplayName.

2. Type “Output Workspace”.

3. Click the same row under the column heading DataType to specify the data type for the parameter.

4. Scroll through the list of data types and clickWorkspace.

5. As this parameter is an input parameter (an existingworkspace into which the outputs will be placed) acceptthe default value of input for the property Direction.

6. For the value of the property Default, type the locationfor GP_Tutorial\Habitat_Analysis.mdb, such as“C:\GP_Tutorial\Habitat_Analysis.mdb”. This personalgeodatabase will be displayed and used as the value forthe parameter by default. All clipped outputs will, bydefault, be placed in this location.

Page 42: Geoprocessing in ArcGIS: ArcGIS 9

36 GEOPROCESSING IN ARCGIS

Setting the Cluster Tolerance parameter

1. Click in the fourth row under the column heading DisplayName.

2. Type “Cluster Tolerance”.

3. Click the same row under the column heading Data Typeto specify the data type for the parameter.

4. Scroll through the list of data types and click Linear unit.

5. Click the row for the property Type in the Value columnto open the dropdown list of values. Click Optional. It isnot required to specify a value for the cluster toleranceparameter. A default value will be used if there is novalue set.

Leave the defaults for the properties Direction,MultiValue, and Default. You could type a value to useas the default. Instead, you’ll take the value set forcluster tolerance from the Environment Settings dialogbox to mimic the behavior of the system tools.

6. Click the row for the property Environment in the Valuecolumn to open the dropdown list of environment settingvalues. Click Cluster Tolerance. The value set for thecluster tolerance in the Environment Settings dialog boxwill be displayed as the value for the parameter bydefault. If the value set in the Environment Settingsdialog box is changed, the value specified there will beused by the Cluster Tolerance parameter.

Leave the default for the Domain property. If youwanted to limit the range of values that could be set forthe parameter, you could set up a domain. The clustertolerance depends on the input data, so you won’t set adomain for this parameter.

The values set for the properties of the Cluster Toler-ance parameter should resemble those in the graphicthat follows.

7. Click OK.

Page 43: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 37

Running the script

1. Double-click the Clip Feature Classes script in theArcToolbox window to open it. The parameters youdefined are displayed on its dialog box.

Notice how each parameter contains a default value. Forthe Input Folder, Input Clip Feature Class, and OutputWorkspace parameters, these are the values you set upfor the Default property of each parameter.

The cluster tolerance is the distance that determinesthe range in which features are made coincident. You’llleave the default (blank) and the units Unknown for theCluster Tolerance parameter. You set the value for theCluster Tolerance parameter to be taken from theEnvironment Settings dialog box when you set up theproperties for this parameter. As you haven’t specified avalue for this parameter in the Environment Settingsdialog box, a default value will be calculated. The defaultvalue calculated will ensure the precision of the data, asit always integrates the data at the smallest possiblecluster tolerance value.

The units for the Cluster Tolerance parameter are set toUnknown. The units given to the spatial reference of theoutput feature classes will be used by the ClusterTolerance parameter. If you were to set the units to beanything other than Unknown, they would be convertedto the same units as the output. The output featureclasses get their units from the spatial reference set forthe first input, that is, the first shapefile in theGP_Tutorial folder to be clipped, provided you haven’tspecified otherwise in the Spatial Reference section ofthe Environment Settings dialog box.

2. Click OK.

The clipped feature classes are added to yourHabitat_Analysis geodatabase. You will use thesefeature classes in the next exercise to locate potentialhigh-quality habitat areas for the California gnatcatcher.

2

Page 44: Geoprocessing in ArcGIS: ArcGIS 9

38 GEOPROCESSING IN ARCGIS

Deleting unnecessary datasets

You can now delete the shapefiles and the DBF table youcopied locally to your GP_Tutorial folder as they are notneeded for the rest of this tutorial.

1. In the ArcCatalog tree, click the connection to thetutorial data, which is your GP_Tutorial folder. In theContents tab, click each shapefile and the DBF file;press Ctrl to select more than one item.

2. Right-click the selection and click Delete.

Closing ArcCatalog

1. Click the File menu and click Exit to close ArcCatalog.

You can continue on to Exercise 4 or stop and completethe tutorial at a later time. If you do not move on toExercise 4 now, do not delete your GP_Tutorial folder,and do not remove the folder connection that accessesit.

2

Page 45: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 39

ArcInfoExercise 4: Finding high-quality habitat patches

Creating a model provides a way to run a sequence ofgeoprocessing tools by enabling you to string your toolstogether in a visual diagram. A model can be run again andagain, and you can alter parameter values to experimentwith different outcomes.

Your task in this exercise is to locate high-quality habitatpatches—areas that have the best potential to support theCalifornia gnatcatcher. You will add data from yourHabitat_Analysis geodatabase to the table of contents ofyour ArcMap session. You’ll then create a new model tofind potential habitat areas, incorporating the following fivecriteria:

1. Roads form a barrier for the gnatcatcher. The impact ofroads on gnatcatcher habitat increases proportionatelywith the road size.

2. The gnatcatcher prefers to live in areas where thevegetation is of a particular type, most preferably, SanDiego coastal sage scrub, though other vegetation typesare also suitable.

3. Parent gnatcatchers drive fledglings off their territoryonce they are ready. Fragmentation of existing habitathas meant young gnatcatchers cannot move very faraway. For the species to survive long term, they needsizable patches of suitable vegetation, though homeranges tend to be smaller nearer the coast and larger inthe drier, sparser inland areas. Nearer the coast—withinthe Maritime (zone 1) and Coastal (zone 2) climatezones—vegetation patches greater than and equal to25 acres (1,089,000 ft2) will be considered suitable. Inthe inland areas—within the Transitional climate zone

(zone 3)—vegetation patches greater than and equal to50 acres (2,178,000 ft2) will be considered suitable.

4. Gnatcatcher sightings have been highly correlated withelevation. Areas below 250 m in elevation have con-tained the majority of all documented sightings in thepast. Only areas where the elevation is less than 250 mabove sea level will be considered as suitable habitatlocations.

5. The gnatcatcher prefers to nest in areas where the slopeof the terrain is minimal. Habitat on slopes that aresteeper than 40 percent have low potential for nesting.Only areas where the slope of the terrain is less than40 percent will be considered as suitable habitatlocations.

Setting up

If you did the previous exercise, skip the next step and go tothe next section (‘Starting ArcMap and adding data’).

1. Copy the GP_Tutorial folder fromC:\arcgis\ArcTutor\Geoprocessing\Results\Ex3 to yourC:\ drive or an alternative drive.

This exercise will take approximately 40 minutes tocomplete.

Page 46: Geoprocessing in ArcGIS: ArcGIS 9

40 GEOPROCESSING IN ARCGIS

Gnatcatcher Habitat Suitability

Buffer roads usingDistance field.

Erase buffer zonesfrom suitablevegetation.

Select suitablevegetation types.

Intersect datato identifysuitablelocations.

Dissolve polygon boundariesbased on which climate zonethey belong to.

Create single-partpolygons from multipartpolygons.

Select potential locations:Suitable patches in climatezones 1 & 2 are >= 25acres.

Suitable patches in climatezone 3 are >= 50 acres.

The following diagram shows the work flow you’ll go through in this exercise to identify high-quality habitat patches.

Page 47: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 41

Starting ArcMap and adding data

You’ll start by opening ArcMap and adding the featureclasses you created in the Habitat_Analysis geodatabase.

1. Start ArcMap by using the Programs list in your Startmenu.

2. Click OK to open a new, empty map.

3. Click the Add Data button on the Standard toolbar, thendouble-click the folder connection to your local copy ofthe tutorial data, for example, C:\GP_Tutorial.

4. Double-click the Habitat_Analysis geodatabase to openit and select all feature classes except vegtype_clip andfutrds_buf; use the Ctrl key to select multiple featureclasses.

5. Click Add.

The feature classes are added to your ArcMap sessionas layers.

Opening the ArcToolbox window

When working in ArcMap, you access toolboxes throughthe ArcToolbox window. By saving the map document yousave any changes made to the ArcToolbox window. Thisallows you to have different versions of the ArcToolboxwindow with each map document you create, depending onwhich tools you want to use for each project.

1. Click the Show/Hide ArcToolbox Window button on theStandard toolbar to open the ArcToolbox window if it isnot already open.

2. If the ArcToolbox window does not display under theArcMap table of contents, click and drag the bar at thetop of the ArcToolbox window and place it over the tableof contents, then drop the panel.

Creating a personal geodatabase to holdintermediate results

The Command Line window consists of a command lineand a message section. All tools added to the ArcToolboxwindow can be executed from the command line as well asfrom their dialog boxes. The command line provides aquick way to execute tools if you are familiar with theirparameters.

You’ll now create a personal geodatabase(Temp_Results.mdb) by running a tool at the command line.This personal geodatabase will hold intermediate data thatyou’ll create to produce the final result. Results you want to

1

5

Page 48: Geoprocessing in ArcGIS: ArcGIS 9

42 GEOPROCESSING IN ARCGIS

keep will be placed inside the existing geodatabase,Habitat_Analysis.mdb.

1. Click Show/Hide Command Line Window on theStandard toolbar to open the window.

As with the ArcToolbox window, the Command Linewindow can be docked anywhere inside any ArcGISDesktop application.

2. Press and hold the Ctrl key while you click and drag thebar at the top of the Command Line window and positionit at the lower-left corner of your ArcCatalog applica-tion. Holding the Ctrl key prevents the window fromdocking to the application.

3. Release the Ctrl key and drop the panel.

The window will dock at the bottom of your application.If you find that it is not docked in the position shown,click the Command Line title bar to snap the windowinto position. If the Draw toolbar is present, click View,then Toolbars, and uncheck Draw.

The Command Line window contains a prompt (a com-mand line) where you can run tools and a message window,showing all the messages associated with running tools—atthe command line, through a tool’s dialog box, by running amodel from within a ModelBuilder window or any mes-sages returned after running a standalone script.

AutoComplete enables you to type part of the tool nameuntil you see the name of the tool displayed in the dropdownlist. You can then press the Space key to automaticallycomplete the rest of the tool name. Once the tool name isentered, the tool’s usage appears as a ToolTip. It promptsyou for the next parameter value that must be specified byhighlighting the parameter in bold.

4. Type “CreatePersonalGDB”, then press the Space key.

Note: The Data Management Tools toolbox must beadded to the ArcToolbox window to run tools from thistoolbox at the command line. If the toolbox is not added,right-click the ArcToolbox window and click AddToolbox. Navigate to the Toolboxes folder at the rootlevel of the ArcCatalog tree and locate the Data Man-agement Tools toolbox, then add it to the ArcToolboxwindow.

1

Page 49: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 43

5. Type “C:\GP_Tutorial” (or your alternative drive) for thevalue of the <in_folder_path> parameter, then type aspace.

6. Type “Temp_Results.mdb” for the value of the<in_personal_gdb> parameter. This is the personalgeodatabase to create inside your GP_Tutorial folder.

7. Press Enter to run the CreatePersonalGDB tool.

A new personal geodatabase called Temp_Results.mdbis placed in your GP_Tutorial folder.

Setting workspaces

You’ll set the current workspace to point to yourHabitat_Analysis personal geodatabase. You’ll also set up ascratch workspace to point to your Temp_Results personalgeodatabase. When building a model it is useful to set upyour workspaces in this manner. In each tool’s dialog box,you can simply leave the default path provided (to yourscratch workspace) for most outputs. For those outputs youwant to keep separate, such as the final result from runningthe model, you can blank out the default path and type aname for the output from the tool. Such outputs will beplaced in the location set for your current workspace. You’llsee this as you build the model in this exercise.

1. Right-click the ArcToolbox folder and clickEnvironments.

2. Click the General Settings dropdown arrow to expand itscontents. For the value of the Current Workspaceenvironment setting, type“C:\GP_Tutorial\Habitat_Analysis.mdb”, or type youralternative location. Alternatively, click the Browsebutton to navigate to this location.

3. For the value of the Scratch Workspace environmentsetting, type “C:\GP_Tutorial\Temp_Results.mdb”, ortype your alternative location. Alternatively, click theBrowse button to navigate to this location.

4. Click OK.

1

2

3

4

Page 50: Geoprocessing in ArcGIS: ArcGIS 9

44 GEOPROCESSING IN ARCGIS

Saving the map document

Geoprocessing settings include environment settings, thestate of the ArcToolbox window, and variables you havecreated at the command line. These settings are saved inArcMap when you save a map document. There are timeswhen you want to switch between applications, havedifferent settings for different projects, or use the defaultsettings. In these cases you can save the geoprocessingsettings by right-clicking the ArcToolbox window andclicking Save Settings. The default settings or savedsettings in a file can be loaded at any time by right-clickingthe ArcToolbox window and clicking Load Settings.

1. Click File on the Main menu and click Save As.

2. Click the Save in dropdown arrow and navigate to yourGP_Tutorial folder.

3. Type “Habitat_Analysis.mxd” for the filename and clickSave.

Creating a new model

You will now create a model by building processes andconnecting them together to find areas with the bestpotential to support the gnatcatcher.

Adding the My_Analysis_Tools toolbox

You’ll first add your My_Analysis_Tools toolbox to theArcToolbox window within your ArcMap session.

1. Right-click the ArcToolbox window and click AddToolbox.

2. Click the Look in dropdown arrow and navigate toHabitat_Analysis.mdb in your GP_Tutorial folder.

3. Click My_Analysis_Tools and click Open.

The toolbox is added to the ArcToolbox window.

1

2

3

Page 51: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 45

1. Right-click your My_Analysis_Tools toolbox in theArcToolbox window, point to New, and click Model.

An empty ModelBuilder window will open.

Selecting suitable vegetation types

You’ll select from the vegetation feature class (vegtype)those vegetation types preferred by the gnatcatcher. You’lluse the Select tool to select all suitable vegetation types(polygons with a Habitat value of 1).

1. Expand the Extract toolset located inside the AnalysisTools toolbox.

2. Click and drag the Select tool into the display window.

An element that references the Select tool is created inthe display window.

3. Right-click the Select tool element and click Open.

1

u1 2

3

Page 52: Geoprocessing in ArcGIS: ArcGIS 9

46 GEOPROCESSING IN ARCGIS

8. Click Auto Layout then click Full Extent to apply thecurrent diagram properties to the elements and to placethe elements within the display window.

4. Click the Input Features dropdown arrow and click thelayer vegtype.

Notice that layers from the ArcMap table of contentshave a yellow layer icon to the left of them to identifythem as layers.

5. Since the Scratch Workspace was set earlier, the defaultpath given for the Output Feature Class parameter is setto this location. Leave the default location and type“select_output” for the name.

6. Type “[HABITAT] = 1” for the value of the Expressionparameter, or click the Browse button next to theExpression parameter and use the Query Builder to buildthe expression.

When all parameters have valid values, the green circlesto the left of each parameter will be removed, indicatingthat a valid value has been set for each parameter. Ifyou have entered an invalid value for a parameter, a redcross icon will display to the left of the parameter. Byplacing the cursor over such icons, you can obtaininformation to help solve the problem with the currentparameter value that is set.

7. Click OK.

7

4

5

6

FullExtent

AutoLayout

Page 53: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 47

Notice that the process is now colored in, meaning it isready to run.

9. Right-click the select_output derived data element andclick Rename.

10. Type “Suitable Vegetation” and click OK.

11. Right-click the Suitable Vegetation data element andclick Add To Display.

With the Add To Display property checked, the deriveddata referenced by this element will be added to thedisplay each time the model is run.

12. Right-click the Select tool element and click Run to runthe process.

Notice that as the process runs, its progress is docu-mented in the message section of the Command Linewindow, and the tool element that references the tool ishighlighted in red. When the process has finished, thetool and its derived data element become shaded,indicating that the process has run and the derived datahas been created on disk.

13. Check ‘Close this dialog when completed processing’ ifthe Select progress dialog box is present, then clickClose.

14. Examine the layer select_output in your ArcMapdisplay. All vegetation types that are preferable for thegnatcatcher, including areas of San Diego coastal sagescrub, have been selected from the vegetation data.

9

Q

W

E

Page 54: Geoprocessing in ArcGIS: ArcGIS 9

48 GEOPROCESSING IN ARCGIS

Excluding the roads

You’ll now exclude the areas near roads and freeways aspotential habitat locations because roads form a barrier forthe gnatcatcher, and there are impacts on the habitatpatches near roads. You’ll buffer the roads using theDistance field in the majorrds_shp attribute table, thenerase the resultant buffer zones from the suitable vegetationpatches.

Buffering the roads

1. Expand the Proximity toolset located inside the AnalysisTools toolbox.

2. Click and drag the Buffer tool into the display window.

3. Right-click the Buffer tool element that represents theBuffer tool in the model and click Open.

4. Click the Input Features dropdown arrow and click thelayer majorrds_shp.

5. Leave the default location for the Output Feature Classparameter and type “buffer_output” for the name.

6. Click Field, click the Field dropdown arrow, and clickDistance. The values in this field will be used for thewidth of the buffer.

7. Click the Dissolve Type dropdown arrow and click LISTto list the dissolve fields.

8. Check Distance in the Dissolve_Field(s) list. Allpolygons that share the same distance value will bedissolved.

9. Leave the defaults for the rest of the parameter valuesand click OK.

3

4

5

6

7

8

9

2

1u

Page 55: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 49

10. Click Auto Layout then click Full Extent. Right-click thebuffer_output derived data element and click Rename.Type “Roads Buffer” and click OK.

11. Right-click Roads Buffer and click Add To Display.

12. Right-click the Buffer tool element and click Run to runthe process.

13. Examine the layer buffer_output in your ArcMapdisplay.

Erasing the roads

You’ll now erase the buffer zones from the suitable vegeta-tion patches to exclude these areas from the analysis.

1. Expand the Overlay toolset located inside the AnalysisTools toolbox.

2. Click and drag the Erase tool into the display window.

3. Right-click the Erase tool in the model and click Open.

4. Click the Input Features dropdown arrow.

Notice that you now have four variables at the top of thelist of inputs as well as all the layers in the table ofcontents to choose from.

When you drag data into a ModelBuilder window orwhen you set the data referenced by input or deriveddata elements within a tool’s dialog box, the elementscreated in the ModelBuilder window are variables thatcan be shared between processes.

5. Click the variable Suitable Vegetation from the dropdownlist. Note the blue icon indicating that it is a variable.

6. Click the Erase Features dropdown arrow and click thevariable Roads Buffer.

7. Leave the default location for the value of the OutputFeature Class parameter and type “erase_output” forthe name.

Leave the default value (blank) for the Cluster Toler-ance parameter and leave the units as Feet. An appro-priate default value will be calculated using the units ofthe spatial reference set for the output (in this case, infeet, as the input spatial reference units are in feet).

All lines within the default cluster tolerance calculatedwill be considered coincident.

8. Click OK.

E

2 u1

Page 56: Geoprocessing in ArcGIS: ArcGIS 9

50 GEOPROCESSING IN ARCGIS

9. Click Auto Layout then Full Extent to display all modelelements in their default position within the displaywindow.

10. Right-click the erase_output derived data element andclick Rename. Type “Suitable Vegetation (MinusRoads)” and click OK.

11. Click the element Suitable Vegetation (Minus Roads) toselect it, then click the blue handles and drag them toresize the element so all the text is displayed.

12. Right-click the Suitable Vegetation (Minus Roads)derived data element and click Add To Display.

13. Right-click the Erase tool and click Run.

It is good practice to save your changes to the model asyou are building it.

14. Click the Model menu and click Save.

The model is saved with its default name. You’ll renamethe model later.

15. Examine the layer erase_output in your ArcMap display.It shows all vegetation patches that are away fromexisting roads and are suitable for habitation by thegnatcatcher.

Selecting potential habitat locations

You’ll now use four tools to find potential habitat locations,incorporating the data referenced by the Suitable Vegetation(Minus Roads) element you have derived. You want to findlocations where the terrain is less than 40 percent in slopeand less than 250 m in elevation as well as where the areaof the suitable locations is greater than or equal to 25 acresin climate zones 1 and 2 and greater than or equal to 50acres in climate zone 3.

Intersecting feature classes

You’ll first intersect slopelt40_shp, elevlt250_shp,climate_shp, and Suitable Vegetation (Minus Roads) toderive a dataset of suitable patches.

R

T

8

6

5

7

Page 57: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 51

1. Expand the Overlay toolset located inside the AnalysisTools toolbox.

2. Click and drag the Intersect tool into the display window.

3. Right-click the Intersect tool and click Open.

4. Click the Input Features dropdown arrow and click thelayer climate_shp. The layer is added to the features list.

5. Click the Input Features dropdown arrow again and clickthe layer slopelt40_shp.

6. Click the Input Features dropdown arrow again and clickthe layer elevlt250_shp.

7. Click the Input Features dropdown arrow again and clickthe variable Suitable Vegetation (Minus Roads).

You’ll use the default and will not assign any ranks to theinput feature classes. The default takes an average ifthe distance between feature classes is less than thecluster tolerance. You would assign ranks if you knewthat some of your feature classes were more integrallysound than others. Features in the feature classes withlower ranks will snap to features in the feature classeswith higher ranks; the highest rank is 1, and lower ranksgo up in value.

8. Leave the default location for the parameter OutputFeature Class and type “intersect_output” for the name.

Leave the default to join all attributes.

Leave the default for the value of the Cluster Toleranceparameter and the units as Feet. The default (blank)means that an appropriate default value will be calcu-lated, using the units of the spatial reference set for theoutput, in this case, in feet, as the input spatial referenceunits are in feet.

All lines within the default cluster tolerance will beconsidered coincident.

Leave the default for the Output Type so the geometryof the output feature class will be the same as the inputwith the lowest geometry type (polygon in this case).

9. Click OK.

2

u

8

9

4

Page 58: Geoprocessing in ArcGIS: ArcGIS 9

52 GEOPROCESSING IN ARCGIS

10. Click Auto Layout, then Full Extent to display all themodel elements in their default position in the displaywindow.

11. Right-click the intersect_output derived data elementand click Rename. Type “Intersect Output” and clickOK.

Your model should now resemble the following graphic.

12. Right-click the Intersect Output derived data elementand click Add To Display.

13. Right-click the Intersect tool and click Run.

14. Examine the layer intersect_output in your ArcMapdisplay.

15. Click the Model menu and click Save.

Dissolving polygons

You’ll now dissolve the polygons of intersect_output toremove unnecessary boundaries between polygons. In thefinal tool you’ll select polygons based on the climate zonethey belong to. Zones 1 and 2 both have a CLIMATE_IDof 2 as they are both close to the coast, and zone 3 has a

CLIMATE_ID of 3, representing areas farther inland.You’ll dissolve all polygons with the same CLIMATE_ID.

1. Expand the Generalization toolset located inside the DataManagement Tools toolbox.

2. Click and drag the Dissolve tool into the ModelBuilderwindow.

3. Right-click the Dissolve tool and click Open.

u

2

Page 59: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 53

4. Click the Input Features dropdown arrow and click thevariable Intersect Output.

5. Leave the default location for the Output Feature Classparameter and type “dissolve_output” for the name.

6. Check CLIMATE_ID in the Dissolve_Field(s) list to useCLIMATE_ID as the dissolve field.

The Dissolve tool gives you the option to create astatistics field, but you don’t need to create one at thistime, so leave the Statistics Field(s) parameter blank.

7. Click OK.

8. Click Auto Layout, then Full Extent to display all themodel elements in their default position in the displaywindow.

9. Right-click the dissolve_output derived data element andclick Rename. Type “Dissolve Output” and click OK.

10. Right-click the Dissolve Output derived data elementand click Add To Display.

11. Right-click the Dissolve tool and click Run.

12. Examine the layer dissolve_output in your ArcMapdisplay.

13. Right-click this layer in the table of contents of ArcMapand click Open Attribute Table. There are now only tworows in the table. The polygons have been dissolved intotwo groups, those with a CLIMATE_ID of 2 (climatezones 1 and 2) and those with a CLIMATE_ID of 3(which includes climate zone 3).

14. Close the table.

15. Click the Model menu and click Save.

Creating single-part polygons

The Dissolve tool creates multipart polygons—separatepolygons sharing the same attributes. Before selecting therequired information using the Select tool, you’ll firstconvert the multipart polygons to single-part polygons inorder to extract information about each polygon.

4

5

6

7

W

Page 60: Geoprocessing in ArcGIS: ArcGIS 9

54 GEOPROCESSING IN ARCGIS

1. Expand the Features toolset located inside the DataManagement Tools toolbox.

2. Click and drag the Multipart To Singlepart tool into theModelBuilder window.

3. Right-click the Multipart To Singlepart tool and clickOpen.

4. Click the Input Features dropdown arrow and click thevariable Dissolve Output.

5. Leave the default for the location of the Output FeatureClass parameter and type “singlepart_output” for thename.

6. Click OK.

7. Click Auto Layout, then Full Extent to display all themodel elements in their default positions in the displaywindow.

8. Right-click the singlepart_output derived data elementand click Rename. Type “Singlepart Output” and clickOK.

9. Right-click the Singlepart Output derived data elementand click Add To Display.

10. Right-click the Multipart To Singlepart tool and clickRun.

11. Examine the output layer in your ArcMap display andthe layer’s attribute table.

12. Click the Identify tool and click a polygon.

Notice that each polygon now contains its own informa-tion for climate zone, length, and area.

Selecting suitable locations

You’ll now use the Select tool to extract the suitablelocations.

1. Expand the Extract toolset located in the Analysis Toolstoolbox.

2. Click and drag the Select tool into the ModelBuilderwindow.

4

5

6

u

2

u

2

Page 61: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 55

8. Click Auto Layout, then Full Extent to display all themodel elements in their default position in the displaywindow.

9. Right-click the element locations and click Rename.Type “Output Habitat Locations”, then click OK.

10. Right-click the element Output Habitat Locations andclick Add To Display.

11. Right-click the Select (2) tool element and click Run.

Note that the tool added will be called Select (2) as youhave already added a Select tool.

3. Right-click the Select (2) tool element and click Open.

4. Click the Input Features dropdown arrow and click thevariable Singlepart Output.

5. You’ll put the final output inside your Habitat_Analysisgeodatabase. Clear the default path and type “locations”for the value of the Output Feature Class parameter.The path to your current workspace will automaticallybe added when you click the next parameter in thedialog box.

6. Type the following expression for the value of theExpression parameter or click the browse button to theright of the Expression parameter and build the expres-sion using the Query Builder dialog box.

[CLIMATE_ID] = 2 AND [Shape_Area] >= 1089000OR [CLIMATE_ID] = 3 AND [Shape_Area] >=2178000

Alternatively, browse in your operating system toquery.txt located in your GP_Tutorial folder, copy thequery, and paste it into the Expression parameter’s inputbox.

The expression extracts all areas where the climate zoneis 1 or 2 (polygons with a CLIMATE_ID of 2) and thearea of the vegetation patch is greater than or equal to25 acres (1,089,000 ft2), or where the climate zone is3 (polygons with a CLIMATE_ID of 3) and the area ofthe vegetation patch is greater than or equal to 50 acres(2,178,000 ft2).

7. Click OK.

4

5

6

7

Page 62: Geoprocessing in ArcGIS: ArcGIS 9

56 GEOPROCESSING IN ARCGIS

12. Click all results except locations in the table of contents(press the Ctrl key to select more than one layer), right-click, and click Remove.

13. Examine the layer locations in your ArcMap display.

It shows areas capable of supporting the Californiagnatcatcher based on the criteria set. Potential patchescontain suitable vegetation types that are far enoughaway from roads, where the elevation is lower than250 m, and where the slope of the terrain is less than40 percent. The size of the vegetation patch is greaterthan or equal to 25 acres in climate zones 1 and 2 andgreater than or equal to 50 acres in climate zone 3.

Saving and renaming the model

Any new model you create has a default name (Model).You can change the name of the model in the ModelProperties dialog box.

1. Click Model and click Model Properties.

2. Click the General tab.

3. Specify a new name for your model, “Habitat_Analysis”,and a label, “Find Potential Habitat”. You would use thename if you were running the model at the command lineor inside a script. The label is the display name for themodel.

4. Add a description for the model, describing the model’scontents.

This description will appear in the Help panel of themodel’s dialog box. You’ll view it later in this tutorial.

5. Check Store relative path names so that all paths forsources of information referenced by the tool are savedrelative to the location of the toolbox. If the toolbox andits data are moved, paths to data sources will be alteredaccordingly.

6. Click OK.

1E

Page 63: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 57

Setting model parameters

In a similar way to setting variables as parameters for thedialog box of a script, as you did in Exercise 3, you must setthe variables in the model as model parameters that youwant to display in your model’s dialog box.

1. Right-click the Find Potential Habitat tool and click Editto open the model.

2. Right-click the element vegtype and click ModelParameter.

A ‘P’ icon will appear next to the element indicating it isset as a model parameter.

3. Right-click vegtype and click Rename. Type “InputVegetation” and click OK. This is the name that will bedisplayed for the input data parameter in the model’sdialog box.

4. Right-click Output Habitat Locations and click ModelParameter.

5. Click the Model menu and click Save, then click theModel menu again and click Close.

The Properties dialog box provides a way to change thename of the model, set parameters (an alternative way tosetting them within the model), change their order, and setthe tool’s environment settings. You’ll now examine the

2

7. Click Model, Close, and Yes to save your changes.

8. Right-click your Find Potential Habitat model in theArcToolbox window and click Open.

Notice that there are no parameters available in themodel’s dialog box. This is because you have not set anyvariables as model parameters.

9. Click Cancel.

8

3

2

6

4

5

Page 64: Geoprocessing in ArcGIS: ArcGIS 9

58 GEOPROCESSING IN ARCGIS

parameters that are set to display in the dialog box of yournew Find Potential Habitat model.

6. Right-click your Find Potential Habitat model and clickProperties.

7. Click the Parameters tab.

Notice the two variables set as model parameters for theuser to specify values in the model’s dialog box. Theorder of the parameters can be changed by clicking aparameter, then clicking Move Up or Move Down. Theorder for the parameters in the model’s dialog boxmimics the order seen in this list.

8. Click Add to see the variables that could also be set asparameters, then click Cancel on the Add Model Param-eter dialog box.

9. Click Cancel.

Overwriting outputs

By default, results from running tools are not overwrit-ten. You’ll specify to overwrite results from running tools(via their dialog boxes) so the existing locations outputwill be overwritten.

6

7 8

9

Page 65: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 59

5

4 3

1. Click Tools on the Main menu.

2. Click the Geoprocessing tab and check to overwrite theoutputs of geoprocessing operations.

3. Click OK.

Running the model from its dialog box

1. Right-click the Find Potential Habitat model in theArcToolbox window and click Open.

You now have two parameters displayed on the model’sdialog box.

2. Click the Show Help button to see the description for themodel that you wrote earlier.

3. Leave the default value for the Input Vegetation param-eter to use vegtype.

4. Leave the default value for the Output Habitat Locationsparameter to create an output called locations. Thisoutput will replace the output inside your currentworkspace, Habitat_Analysis.mdb.

Although you already executed each individual tool whilebuilding the model, these tools will be executed again,and the results will be overwritten.

Note: When you run a model from its dialog box, unlikewhen running the model within the ModelBuilder win-dow, the intermediate data (data referenced by deriveddata elements that are flagged as intermediate) will bedeleted after the model has executed.

5. Click OK to run the model.

6. Examine the status messages in the message section ofthe Command Line window and examine the result thatis added to your display.

Note: The final result is added to the display by default.This is because the option to add results ofgeoprocessing operations to the display is checked on bydefault in the Geoprocessing tab of the Options dialogbox, accessed via the Tools menu on the Main menu.

1

Page 66: Geoprocessing in ArcGIS: ArcGIS 9

60 GEOPROCESSING IN ARCGIS

Note also that the ‘locations’ result created earlier byrunning the model from within the ModelBuilder windowhas been overwritten because the option to overwrite theoutputs from geoprocessing operations is turned on inthe Options dialog box. Also, the result produced ispermanent, because the option to create temporaryresults from tools is turned off by default in the Optionsdialog box.

7. Click File on the Main menu of ArcMap and click Save.

In this exercise you created a new model that finds poten-tial habitat locations for the California gnatcatcher. In thenext exercise you will find out which of these locations willbe impacted by proposed roads.

You can continue on to Exercise 5 or stop and complete thetutorial at a later time. If you do not move on to Exercise 5now, click File, then Exit to close your ArcMap session, butdo not delete your GP_Tutorial folder.

Page 67: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 61

ArcInfoExercise 5: Finding habitat patches impacted by proposed roads

Once you have created models within, or added scripts to,a toolbox, they can be used just like any of the system tools.They can be added to the ModelBuilder window of anothermodel, run from the command line, or run from anotherscript.

In this exercise you’ll create a new model and add to it theFind Potential Habitat model you created in Exercise 4.You’ll clip the result from the Find Potential Habitat model(locations) by using buffer zones you’ll create around theproposed roads to find potential habitats that may beimpacted by the proposed roads.

This exercise will take approximately 16 minutes tocomplete.

Setting up

If you didn’t do the previous exercises, follow the next eightsteps. If you did Exercise 4, go to the next section,‘Creating a new model’.

1. Open ArcCatalog. In the ArcCatalog tree copy thefolder GP_Tutorial fromC:\arcgis\ArcTutor\Geoprocessing\Results\Ex4 to yourC:\ drive or an alternative drive, then close ArcCatalog.

2. Open ArcMap and open the map documentHabitat_Analysis.mxd from your GP_Tutorial folder.Right-click the ArcToolbox window and click AddToolbox. Navigate to your My_Analysis_Tools toolboxand click Open.

3. Right-click the ArcToolbox window and clickEnvironments.

4. Click the General Settings dropdown arrow to expand itscontents and type“C:\GP_Tutorial\Habitat_Analysis.mdb”, or type youralternative location, for the value of the CurrentWorkspace environment setting. Alternatively, click theBrowse button to navigate to this location.

5. Type “C:\GP_Tutorial\Temp_Results.mdb”, or type youralternative location, for the value of the ScratchWorkspace environment setting. Alternatively, click theBrowse button to navigate to this location, then clickOK.

6. Click Tools on the Main menu and click Options.

7. Click the Geoprocessing tab.

8. Check Overwrite the outputs of geoprocessingoperations. Then click OK on the Options dialog box.

Creating a new model

1. If you have closed ArcMap, open it again and open themap document Habitat_Analysis.mxd from yourGP_Tutorial folder.

2. Right-click your My_Analysis_Tools toolbox in theArcToolbox window, point to New, and click Model.

2

Page 68: Geoprocessing in ArcGIS: ArcGIS 9

62 GEOPROCESSING IN ARCGIS

Adding the Find Potential Habitat model

1. Click the Find Potential Habitat model inside yourMy_Analysis_Tools toolbox and drag it into theModelBuilder window of the new model.

Notice the icon on the Find Potential Habitat tool elementindicates that the tool is another model. You can right-clickthis element and click Edit to open the model inside itsModelBuilder window. You hide the complexity of a largermodel by breaking it down into smaller submodels.

Buffering the proposed roads

1. Expand the Proximity toolset located inside the AnalysisTools toolbox.

2. Click and drag the Buffer tool into the display window.

3. Right-click the Buffer tool element that represents theBuffer tool in the model and click Open.

4. Click the Input Features dropdown arrow and click thelayer futrds.

Leave the default location and name for the OutputFeature Class parameter.

5. Click Field, click the dropdown arrow, and clickDistance. The values in this field will be used for thewidth of the buffer.

6. Click the Dissolve Type dropdown arrow and click LISTto list the dissolve fields. Check Distance in theDissolve_Field(s) list. All polygons that share the samedistance value will be dissolved.

7. Click OK.

8. Click the Full Extent tool to display all elements in thedisplay window.

9. Right-click the derived data element futrds_Buffer andclick Rename.

10. Type “Buffer Zones” and click OK.

4

5

6

7

u

1

Page 69: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 63

Clipping habitat patches using buffer zones

1. Expand the Extract toolset located inside the AnalysisTools toolbox.

2. Click the Clip tool and drag it into the ModelBuilderwindow.

3. Click the Add Connection tool.

4. Click the element Output Habitat Locations, then clickthe Clip tool element.

A connector is drawn between the two elements,connecting the output from the Find Potential Habitattool as input for the Clip tool.

5. Click the element Buffer Zones, then click the Clip tool.

6. Double-click the Clip tool element to view the parametervalues set in the tool’s dialog box.

Notice that by connecting the input data elements to thetool element, the values for the Input Features param-eter and the Clip Features parameter are set inside thetool’s dialog box.

7. As the result from the Clip tool is the final output fromthe model, clear the default path and type“impacted_habitat” for the name of the Output FeatureClass. The path to the current workspace will be sup-plied by default.

8. Leave the default value (blank) for the Cluster Toler-ance parameter and the units as Feet. An appropriatedefault value will be calculated using the units of thespatial reference set for the output, in this case, in feet,as the input data spatial reference units are in feet.

9. Click OK.

2

u

3

Page 70: Geoprocessing in ArcGIS: ArcGIS 9

64 GEOPROCESSING IN ARCGIS

10. Click Auto Layout, then click Full Extent to display allthe model elements in the display window in theirdefault position.

Renaming elements

1. Right-click the element impacted_habitat and clickRename.

2. Type “Output Impacted Habitat” and click OK.

3. Right-click the element vegtype and click Rename.

4. Type “Input Vegetation” and click OK.

5. Right-click the element futrds and click Rename.

6. Type “Input Proposed Roads” and click OK.

Setting model parameters

You want the user of this model to be able to specify thefollowing inputs: Input Vegetation and Input ProposedRoads, as both of these could change over time. You alsowant the user to be able to set the path and name for theOutput Habitat Locations output and the final output, OutputImpacted Habitat.

So the user can specify values for these parameters, you’llmake them model parameters.

1. Right-click the element Output Impacted Habitat andclick Model Parameter.

2. Right-click the element Output Habitat Locations andclick Model Parameter.

3. Right-click the element Input Vegetation and click ModelParameter.

4. Right-click the element Input Proposed Roads and clickModel Parameter.

Your model should resemble the graphic that follows.

5. Click Model and Save, then click Model, then Close.

AutoLayout

FullExtent

7

8

9

Page 71: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 65

Renaming the model

Models can be renamed in the Model Properties dialog boxwithin the ModelBuilder window, as you saw earlier, orfrom the Properties option on the model’s context menu.

1. In the ArcToolbox window, right-click Model inside yourMy_Analysis_Tools toolbox and click Properties.

2. Click the General tab and type “impacted_habitat” forthe name and “Find Impacted Habitat” for the label.

3. For the description of the model, type, “This model findspotential gnatcatcher habitat patches that might beimpacted by proposed roads.”

4. Check Store relative path names to save all paths forsources of information referenced by the tool relative tothe location of the toolbox. If the toolbox and its data aremoved, the model will still work without having to repairthe paths to derived data.

Changing the order of parameters

1. Click the Parameters tab.

2. Click Input Proposed Roads and click the Move Uparrow to place this parameter at the top of the list. Usethe Move Up or Move Down arrows to place InputVegetation after Input Proposed Roads, then OutputHabitat Locations, and Output Impacted Habitat last.

3. Click OK.

1

3

2

2

3

4

Page 72: Geoprocessing in ArcGIS: ArcGIS 9

66 GEOPROCESSING IN ARCGIS

Running the model

1. In the ArcToolbox window, double-click the Find Im-pacted Habitat model to open its dialog box.

2. Click OK to run the model.

Displaying the results

1. Examine the status messages in the Command Linewindow.

2. Turn off all layers in the table of contents exceptimpacted_habitat.

3. Examine the result in the ArcMap display.

2

These polygons represent habitat locations that would beimpacted by the introduction of new roads.

4. Turn on the layers majorrds_shp and futrds in the tableof contents and zoom in on the impacted areas.

5. Change the symbology of the layers if desired.

There is actually only one area of impacted habitat that aproposed road will go directly through. The rest of theimpacted areas are close to new roads, but the roads willnot travel directly through them. These areas fall within acertain distance from the proposed roads (the bufferdistance assigned). They will be impacted by proposedroads, but only by noise and fume pollution.

Page 73: Geoprocessing in ArcGIS: ArcGIS 9

QUICK-START TUTORIAL 67

6. Turn on the locations layer.

7. Change the order of the layers in the table of contents sothey are in the following order from the top of the tableof contents: futrds, majorrds_shp, impacted_habitat, thenlocations. The order of the rest of the layers does notmatter.

8. Zoom to the full extent of the map to see all high-qualityhabitat locations, including those that are impacted byproposed roads.

After an investigation in the field to see if there are indeedgnatcatchers present in the impacted habitat locations, theproposed roads that are planned to be routed through ornear these locations will need to be assessed to see if theycan be rerouted away from areas of high-quality habitat.

Saving the map document

1. Click File on the Main menu of ArcMap and click Save.

2. Click File again and click Exit to close the ArcMapsession.

This brings you to the end of this tutorial. You should nowhave the experience to start using your own data and to getyour geoprocessing tasks done with greater efficiency andease. The rest of this book explains how to use ArcGIS toperform geoprocessing in more depth, so use it as a guideas you begin performing your own specific geoprocessingtasks.

Page 74: Geoprocessing in ArcGIS: ArcGIS 9
Page 75: Geoprocessing in ArcGIS: ArcGIS 9

IN THIS CHAPTER

69

Geoprocessing basics 3• Geoprocessing: The big picture

• Introducing geoprocessingmethods

• Working with data

• Results from running tools

• Geoprocessing settings

• Saving and loading geoprocessingsettings

• Keeping track of geoprocessingoperations

• Sharing your geoprocessing work

A GIS provides a spatial framework to support decisions to help manage thenatural and man-made environment and resources of the earth.Geoprocessing allows you to define, manage, and analyze the informationused to form these decisions.

The concept of geoprocessing is based on a framework of datatransformation. A typical geoprocessing operation takes an input dataset,performs an operation on that input dataset, and returns the result of theoperation as an output dataset. Geoprocessing your data within ArcGISenables you to perform geoprocessing operations using many different datatypes and a number of different methods, and it gives you access tohundreds of geoprocessing tools.

This chapter discusses:

• How geoprocessing is a component of a GIS

• The different methods to perform geoprocessing tasks

• The different workspaces and data sources that are supported

• How to change the default settings that are applied to your results

• About geoprocessing settings and how to load and save them betweensessions

• How to keep track of the geoprocessing tasks you perform

• How to share your geoprocessing work with others

Page 76: Geoprocessing in ArcGIS: ArcGIS 9

70 GEOPROCESSING IN ARCGIS

Geoprocessing: The big picture

Land parcels Soil types Land parcels and soiltypes

Inputs to Union Output from Union

A new dataset of thecounty of GreaterManchester, created byselecting districts thatfall into this county

Map of Great Britainwith the county ofGreater Manchesterhighlighted

Geoprocessing tools manipulate data to produce results thatmodel the real world.

Geoprocessing is one of the most powerful components of a GIS.A GIS is composed of a GIS database and software tools used tomanipulate the data from that GIS database. The results producedby using geoprocessing tools can be powerful aids in real-worlddecision making.

What problems can geoprocessing help solve?

Geoprocessing can help you with an extensive range of tasksfrom preparing datasets, such as extracting a subset from a largerdataset or converting datasets to a different format, to performinganalyses—finding possible answers to multiple spatial questions,such as “Where is the best location?” or “Whom will this affect?”The following examples show typical geoprocessing tasks.

Example 1

From a collection of datasets of Great Britain, you want to dosome analysis in the county of Greater Manchester. You onlyhave district data, but it includes which county each district fallsinto.

Using the Select tool you can select those districts that fall withinthe county. You can then clip the rest of your datasets to theextent of this new dataset. The result is a collection of datasetsfor the county of Greater Manchester.

Example 2

You are performing a study to find areas susceptible to flooding.Part of the study requires that you identify the soil types withineach land parcel in each district. The Union tool combinesinformation from separate datasets into one dataset, enabling youto extract the information you need.

Page 77: Geoprocessing in ArcGIS: ArcGIS 9

GEOPROCESSING BASICS 71

Introducing geoprocessing methods

Geoprocessing forms a vital part of the work many companies dowith a GIS. Countless geoprocessing tasks may be performed ona daily basis. Such tasks include converting data from one formatto another or performing analysis by creating buffers oroverlaying datasets.

Within ArcGIS, there are different methods available forperforming geoprocessing tasks. The method you choosedepends on the method best suited to the particular task andyour personal preference.

You can perform geoprocessing tasks by running a tool via itsdialog box, at the command line, or within a script or a model.

A dialog box is a form on which you supply the parameter valuesfor the tool, then click OK to run the tool. At the command line,you type the tool name and its parameter values, then press Enterto run the tool. Alternatively, you can create your own modelsinside, or add scripts to, toolboxes. Models you create may run achain of tools in sequence, and scripts are useful for batchprocessing multiple inputs, such as when converting multipledatasets to a different format. Scripts can be written in any COM-compliant scripting language, such as Python, JScript, orVBScript, and they do not have to be added to toolboxes. Theycan be run directly from within the appropriate scriptingapplication. Each of these methods used to performgeoprocessing tasks is introduced in the sections following‘About toolboxes’.

For more information on toolboxes, see Chapter 4. For moreinformation on creating a model and adding a script to a toolbox,see Chapter 5. See Chapter 7 for more information on using thecommand line. For more information on building models, seeChapters 8 and 9. For information on creating scripts, see WritingGeoprocessing Scripts With ArcGIS.

About toolboxes

Toolboxes can contain toolsets and tools. Toolsets can alsocontain toolsets and tools. You can access toolboxes from theArcToolbox window or the ArcCatalog tree. There is a collectionof system toolboxes that you can use, or you can create yourown toolboxes to store a collection of system tools (toolsinstalled with ArcGIS) or custom tools (models or scripts) thatyou have created. System tools are organized into systemtoolsets, making it easier to find the tools you are looking for. Bycreating custom toolsets, you can easily organize your tools.

To view system toolboxes in the ArcCatalog tree, click Tools onthe Main menu and click Options. Click the General tab and checkToolboxes in the list of top-level entries.

The collection of system toolboxes are added by default asshortcuts to your ArcToolbox window from the Toolboxes folderin your ArcCatalog tree. The ArcToolbox window provides ashortcut to the toolboxes you have stored in folders orgeodatabases on disk—those that can be seen in the ArcCatalogtree. It provides a way to centralize the location of toolboxes thatmight be spread out in different folders and geodatabases onyour computer’s disk. The ArcToolbox window can be docked toany ArcGIS Desktop application, such as ArcMap, ArcGlobe, orArcCatalog.

System tool

Customtoolbox

Custom toolset

Custom model

Custom script

Page 78: Geoprocessing in ArcGIS: ArcGIS 9

72 GEOPROCESSING IN ARCGIS

Using dialog boxes and the command line

All tools (system tools or custom tools) can be run from a dialogbox or from a command line.

Running tools via dialog boxes

Dialog boxes guide you through the process of running a tool bygiving you a form where you specify the data and othernecessary parameter values.

All tool dialog boxes have a Help panel that can be opened todisplay Help topics for the tool being used. A description of whatthe tool does and a definition of each parameter are just one clickaway. You can also click the Help button at the top of the Helppanel to display more help for the tool including an illustration, asection explaining how the tool works, and examples of how torun the tool at the command line or within a script. Once youunderstand the tool and its parameters, you can close the Helppanel to save space on your desktop.

When should you use a dialog box?

Run a tool via its dialog box to become familiar with the tool andits parameters. The dialog box helps you provide valid parametervalues and provides options where appropriate.

See Chapter 5, ‘Working with toolsets and tools’, for moreinformation on running a tool via its dialog box.

Running tools at the command line

Regardless of the ArcGIS product (ArcInfo, ArcEditor, orArcView) you have installed, you can access a command line inany ArcGIS Desktop application, such as ArcMap, ArcCatalog, orArcScene™. The command line is similar to the ArcInfoWorkstation command line. You type a tool name, set appropriateparameter values, then press Enter to execute the tool.

Tools can be run at the command line, provided that the toolboxcontaining the tool you want to run is added to the ArcToolboxwindow. After typing the tool name, the usage is displayed for thetool. It helps you supply values for the tool’s parameters.

The command line honors the domain set for each parameter, sovalid parameter values will be presented in a dropdown list. Thisincludes any valid layers or keywords.

The Command Line window showing commands typed at the commandline. Layers can be used as input parameter values, and multiplecommands can be entered using Ctrl + Enter after each line.

Page 79: Geoprocessing in ArcGIS: ArcGIS 9

GEOPROCESSING BASICS 73

When should you use the command line?

• If you are familiar with the tool you want to use and theparameter values that need to be supplied, you may find thecommand line quicker and more convenient.

• You can create variables to replace more complex parametervalues, such as a variable for the table that reclassifies araster, to help you to quickly perform your geoprocessingtasks.

See Chapter 7, ‘Using the Command Line window’, for moredetails on using the command line to geoprocess your data.

Building a model

For more complex geoprocessing tasks that involve multipletools, you can create a new model by linking processes togetherin a graphical environment (a ModelBuilder window). Thisenables you to create a visual diagram of the steps needed tocomplete a geoprocessing task. The diagram you build representsa model.

To open a ModelBuilder window, you first create a new modelinside a toolbox or toolset. A ModelBuilder window opensautomatically, so you can start building your model.

In the model diagram, components, called elements, referenceinput data, a tool that operates on the input data, and theresulting output data. Elements are connected together intoprocesses. Connector arrows indicate the sequence ofprocessing. You may have several processes in a model, and theycan be chained together so that the output data from one processbecomes the input data for another process.

To build a model, you can drag tools from toolboxes in theArcToolbox window or the ArcCatalog tree and data from theArcCatalog tree or the table of contents of any other ArcGISDesktop application, such as ArcMap. Alternatively, use the AddData and Tools button in the ModelBuilder window to add toolsand data, which places their representative elements on the modeldiagram. When you fill in necessary parameter values for eachtool and connect processes, your model will become ready to run.

Any parameter within the model can be set as a variable that canbe shared between processes. This means you don’t have tomake updates to every tool that uses a particular parameter value;you can just update the value in one dialog box.

The creation of a model and the ModelBuilder window

The ModelBuilder window with a typical model

Page 80: Geoprocessing in ArcGIS: ArcGIS 9

74 GEOPROCESSING IN ARCGIS

Running a model

When the model is run, the project data is processed in the orderspecified, and output data is created. You can save, modify, andrerun the model. It’s easy to redo the same procedure multipletimes or alter data and other parameter values and rerun themodel.

You can run the model from within the ModelBuilder window orfrom its dialog box. Variables in the model can be set as modelparameters, so values for these parameters can be specifiedwithin your model’s dialog box.

When should you build models?

• Models automate the process of performing a sequence ofgeoprocessing tasks on your data, so build models when youwant to perform multiple geoprocessing tasks, such asclipping your data, unioning the results together, thenselecting areas from the unioned result that meet a criteria.

• You can quickly change parameter values for tools in yourmodel, then rerun the model to experiment with differentoutcomes.

• Build models when you need to present a work flow todecision makers or the public.

See Chapter 8 for more conceptual information on buildingmodels and Chapter 9 for more information on using theModelBuilder window.

Running a script

In many instances, the geoprocessing work that must be done isrepetitive. Whether it involves geoprocessing a large number ofdatasets or large datasets with numerous records, thesegeoprocessing tasks require automation. Any COM-compliantscripting language can be used to write scripts that executeArcGIS geoprocessing tools, providing an efficient and effectiveway to automate your geoprocessing tasks.

If you are new to scripting languages, you do not need to be anexpert programmer to create and use scripts. You can build amodel in a ModelBuilder window and export the model to a scriptthat you can then run or modify.

A model’s dialog box with parameters displayed

Page 81: Geoprocessing in ArcGIS: ArcGIS 9

GEOPROCESSING BASICS 75

A model consisting of one process (a buffer tool with itsparameter values defined). The model can be exported to ascript.

The exported script is shown in the graphic on the followingpage.

Page 82: Geoprocessing in ArcGIS: ArcGIS 9

76 GEOPROCESSING IN ARCGIS

The above script was created by exporting a model containing one buffer process.

Page 83: Geoprocessing in ArcGIS: ArcGIS 9

GEOPROCESSING BASICS 77

By adding lines of code and wrapping the buffer process in a loop, all feature classes inside the specified workspace will be buffered.

Page 84: Geoprocessing in ArcGIS: ArcGIS 9

78 GEOPROCESSING IN ARCGIS

You can run a script as a standalone operation, or you can add ascript to a toolbox and run the script from its dialog box. To dothis you would add the script to a toolbox, then define theparameters, which you set as system arguments within the script,for which the user of the script must specify the values. SeeExercise 3 of the quick-start tutorial or Chapter 5, ‘Working withtoolsets and tools’, for information on adding a script to a toolboxand setting parameters within the Properties dialog box of thescript.

When should you write a script?

• Scripts let you execute simple processes that include singletools, complex processes linked together, or looping toperform batch processing on a set of input datasets.

• Scripts are recyclable, meaning they can be data nonspecificand, therefore, used over and over again. They can increaseefficiency because they can be executed at any time.

See Writing Geoprocessing Scripts With ArcGIS for moreinformation on writing scripts that will perform geoprocessingtasks.

Page 85: Geoprocessing in ArcGIS: ArcGIS 9

GEOPROCESSING BASICS 79

Working with data

Files, such as spreadsheets and documents, are organized intofolder hierarchies on your desktop computer. A GIS manages thedata sources that geoprocessing tools work with in a similarhierarchy of folders, files, and geodatabases. You can useArcCatalog to explore, access, and manage data sources, as wellas items such as folders and geodatabases. For more information,see Using ArcCatalog.

About workspaces

A workspace is a container of geographic data that will be usedby geoprocessing tools. There are three main workspacessupported—folders, personal geodatabases, and ArcSDE®

geodatabases—but you can also set a feature dataset as aworkspace if you want to work with its feature classes.

By setting a workspace prior to running tools, you can simplytype the name of a dataset—or a feature class if the workspace isa feature dataset—within the workspace as the parameter valuewhen running tools, rather than the full path to the data.Workspaces can be set in the Environment Settings dialog box.See ‘Working with workspaces’ in Chapter 6 for more information.

Folders

A folder can store other folders, geodatabases, data sources, andtoolboxes. Folders in the ArcCatalog tree represent folders ondisk. Coverages, shapefiles, TIN datasets, layers, and layer filescan only reside inside folders. Other data sources, such as rasterdata, feature classes, and tables, can be exported from a folder toa geodatabase, personal or ArcSDE. Feature datasets within afolder, such as coverage, Smart Data Compression [SDC] orVector Product Format [VPF] datasets, can be set as a workspaceso just the names of the feature classes within the dataset can beentered as inputs when running tools. However, results cannot bewritten to such datasets. A path to a valid workspace should beentered for the values of output data parameters.

Folders themselves can be used as inputs and outputs to certaingeoprocessing tools, such as the Create Folder tool or the CreatePersonal GDB tool. In the Search tab of the ArcToolbox window,type “folder” to locate tools that work with folders.ArcCatalog and the ArcToolbox window

Page 86: Geoprocessing in ArcGIS: ArcGIS 9

80 GEOPROCESSING IN ARCGIS

Geodatabases

A geodatabase is a relational database that contains geographicinformation. Geodatabases can contain feature classes, featuredatasets, tables, and toolboxes. Feature classes can be organizedinto a feature dataset, or they can exist independently in thegeodatabase.

For more information on geodatabases, see Using ArcCatalog,Modeling Our World, and Building a Geodatabase.

Personal geodatabases

To manage your own spatial database, you can create a personalgeodatabase that is stored in ArcCatalog in a Microsoft Accessdatabase. With personal geodatabases, many readers aresupported, but only a single editor is supported. You can createand work with personal geodatabases in ArcGIS without anyother software.

By setting a personal geodatabase as a workspace prior torunning a tool, you can simply type the name of a feature datasetor a feature class contained within a geodatabase as the inputdata when running a tool, and it will be taken from the location setfor the workspace. Feature datasets within a personalgeodatabase can also be set as a workspace, so you can workwith the feature classes it contains.

A personal geodatabase can be a source of input and adestination for output of data sources from geoprocessingoperations. Personal geodatabases can be managed using thesystem tools.

You can easily create a personal geodatabase using the CreatePersonal GDB tool located in the Workspace toolset in the DataManagement Tools toolbox.

In the Search tab of the ArcToolbox window, type “geodatabase”to locate tools that accept personal geodatabases as input oroutput.

ArcSDE geodatabases

To allow multiple users to simultaneously update data, use anArcSDE geodatabase, where data is stored in a centrally locatedrelational database management system, such as IBM® DB2®,Informix®, Oracle®, or Microsoft® SQL Server™. ArcSDEgeodatabases can be used with any ArcGIS product (ArcView,ArcInfo, or ArcEditor) but require ArcSDE for editing and schemamanagement.

There are two main advantages to using ArcSDE geodatabases:many people in the organization can update the geodatabase’scontents at the same time through the use of versioning, and longtransactions and large datasets can be handled efficiently.

By setting an ArcSDE geodatabase as a workspace prior torunning a tool, you can simply type the name of a feature datasetor a feature class contained within a geodatabase as the inputdata when running a tool, and it will be taken from the location setfor the workspace. Feature datasets within an ArcSDEgeodatabase can also be set as a workspace, so you can workwith the feature classes it contains.

An ArcSDE geodatabase can be a source of input and adestination for output of data sources from geoprocessingoperations. It can also be used as input to and output fromcertain geoprocessing tools. In the Search tab of the ArcToolbox

Page 87: Geoprocessing in ArcGIS: ArcGIS 9

GEOPROCESSING BASICS 81

window, type “geodatabase” to locate tools that accept ArcSDEgeodatabases as input or output.

About data sources

A data source is any geographic data used as input to or outputfrom a geoprocessing tool. Supported data sources includegeodatabase feature datasets and feature classes, shapefiledatasets, coverage datasets and feature classes, computer-aideddesign (CAD) datasets and feature classes, SDC feature datasetsand feature classes, VPF datasets and feature classes, rasterdatasets and raster dataset bands, TIN datasets, layers, layerfiles, tables, and table views. For more information on thestructure of data, see Modeling Our World.

The feature class is one of the most commonly used datasources. It is composed of a collection of geographic featureswith the same type of geometry—point, line, or polygon—andthe same set of attributes. Feature classes are discussed in thesections that follow. They can be contained within a geodatabaseas well as within the following datasets: geodatabase feature,shapefile, coverage, CAD, SDC, and VPF.

Feature data

Geodatabase feature datasets

Geodatabase feature datasets reside inside geodatabases,personal or ArcSDE. They contain a collection of geodatabasefeature classes that share the same extent and coordinate system.

The following geoprocessing tools accept geodatabase featuredatasets as input or output: Create Feature Dataset, Copy, Delete,Rename, and Project.

Geodatabase feature classes

You can perform geoprocessing tasks on the feature classescontained within a geodatabase feature dataset. Geodatabasefeature classes store geographic features represented as points,lines, polygons, annotation, dimensions, and multipatches andtheir attributes. They store simple features, so they can beorganized inside or outside a feature dataset, but always inside ageodatabase, personal or ArcSDE. Simple feature classes that areoutside a feature dataset are called standalone feature classes.Feature classes that store topological features must be containedwithin a feature dataset to ensure a common coordinate system.

In the Search tab of the ArcToolbox window, type “feature class”to locate tools that accept geodatabase feature classes as inputor output.

Page 88: Geoprocessing in ArcGIS: ArcGIS 9

82 GEOPROCESSING IN ARCGIS

Shapefile datasets

A shapefile dataset (.shp) is stored in a folder, is composed ofgeographic features and their attributes, and contains one featureclass. Geographic features in a shapefile can be represented withpoints, lines, or polygons (areas).

Because shapefile datasets contain one feature class, you canuse them like any other feature class.

In the Search tab of the ArcToolbox window, type “feature class”to locate tools that accept shapefiles as input or output.

Coverage datasets

A coverage is stored in a workspace that is a folder in your filesystem. It contains an integrated set of feature classes thatrepresent geographic features.

In the Search tab of the ArcToolbox window, type “coverage” tolocate tools that accept coverages as input or output.

Coverage feature classes

Coverage feature classes can store a set of points, lines (arcs),polygons (areas), regions, routes, tics, links, and annotation(text). They can also have topology, which determines therelationships between features that are within or between featureclasses.

To locate tools that work withgeodatabase feature classes, type“feature class” as the word tosearch for.

To locate tools that work withcoverages, type “coverage” as theword to search for.

Page 89: Geoprocessing in ArcGIS: ArcGIS 9

GEOPROCESSING BASICS 83

A coverage feature class can be used as input to tools thatproduce a distinct output or to tools that update the attributes ofthe input feature class. They cannot be used by those tools thatupdate the geometry of the input.

If you want to update the geometry of a coverage feature class,export it to a geodatabase feature class and perform updates tothe geometry of the geodatabase feature class.

In the Conversion Tools toolbox, click the To Geodatabasetoolset and use the Feature Class To Geodatabase tool to convertcoverage feature classes into geodatabase feature classes.

In the Search tab of the ArcToolbox window, type “feature class”to locate tools that work with coverage feature classes.

CAD feature datasets

A CAD feature dataset is the ArcGIS feature representation of aCAD file. A CAD feature dataset is composed of five read-onlyfeature classes: points, polylines, polygons, multipatches, andannotation.

In the Search tab of the ArcToolbox window, type “CAD” tolocate all tools that accept CAD feature datasets as input oroutput.

Supported CAD file formats include DWG (AutoCAD®),AutoDesk® Drawing Exchange Format (DXF), and DGN (thedefault MicroStation file format). If the extension of your CAD fileis not .dwg, .dxf, or .dgn, you will not see its feature datasetrepresentation in the ArcCatalog tree. Use the File types tab inthe Options dialog box (accessed via the Tools menu) to add thefile extension of your CAD file so its feature datasetrepresentation is displayed in the ArcCatalog tree.

Another representation of a CAD file in ArcGIS is the CADdrawing dataset, which is a pictorial representation of an entireCAD file. The symbology in a CAD drawing dataset mimics thesymbology of the originating CAD file. It is useful to display theCAD drawing dataset in any ArcGIS application with a display,but for geoprocessing purposes you'll generally use only theCAD dataset or feature classes as input to geoprocessing tools.

To locate tools that work with CADfeature datasets, type “CAD” asthe word to search for.

Page 90: Geoprocessing in ArcGIS: ArcGIS 9

84 GEOPROCESSING IN ARCGIS

CAD feature classes

A CAD feature class is a read-only, in-memory member of a CADfeature dataset. CAD feature classes include points, polylines,polygons, multipatches, or annotation.

A CAD feature class is the result of a direct file read into memoryof the objects contained within a single CAD drawing file of aspecific geometric type. The feature attribute table of a CADfeature class is a virtual table composed of select read-only CADgraphic properties and any existing block or cell attribute values.

Because they are read-only, CAD feature classes can only beused by geoprocessing tools that produce a distinct output.They cannot be used by tools that alter the geometry orattributes of the input feature class. To alter the geometry orattributes of a CAD feature class, export the feature class to ageodatabase feature class and perform the alteration on thegeodatabase feature class.

In the Search tab of the ArcToolbox window, type “feature class”to locate tools that accept CAD feature classes as input oroutput.

SDC datasets

A Smart Data Compression dataset contains read-only featureclasses, all of which have the same attribute information but withdifferent levels of generality in the shapes. SDC data is encryptedand highly compressed. This format is used by ESRI to provideStreetMap™ data and also by commercial data vendors who

distribute street data for geocoding and routing with variousESRI® software products.

The following geoprocessing tools accept SDC datasets as inputor output: Copy, Delete, and Rename.

SDC feature classes

SDC feature classes can store a set of points, lines, andpolygons. They can also have topology, which determines therelationships between features that are within or between featureclasses.

SDC feature classes differ in respect to other ArcGIS featureclasses because they support multiple geometries for a singlerecord. This design feature allows the storage of generalizedversions of detailed geometry with only one set of attributeinformation. They support a licensing mechanism that can beused to bind access to a specific ArcGIS application, such asArcReader™, or to a specific extension, such as ArcGIS BusinessAnalyst.

SDC feature classes are created using ESRI’s Data DevelopmentKit Professional (DDKP). They are composed of an SDC file thatstores both geometry and data, a spatial index (.sdi) file thatrepresents the spatial index, an attribute index descriptor (.idi) filethat is a pointer to attribute indexes, and any number of attribute

Page 91: Geoprocessing in ArcGIS: ArcGIS 9

GEOPROCESSING BASICS 85

indexes that are defined in the IDI file. Filename extensions forindividual attribute indexes are open as long as they are correctlydefined in the IDI file.

SDC feature classes can only be used as input to geoprocessingtools that produce a distinct output or tools that updateattributes. They cannot be used by those tools that update thegeometry of the input.

If you want to update the geometry of an SDC feature class,export it to a geodatabase feature class and perform updates tothe geometry of the geodatabase feature class. In the ConversionTools toolbox, click the To Geodatabase toolset and use theFeature Class To Feature Class tool or the Feature Class toGeodatabase tool (for multiple inputs) to convert SDC featureclasses into geodatabase feature classes.

In the Search tab of the ArcToolbox window, type “feature class”to locate tools that work with SDC feature classes.

VPF datasets

The VPF dataset is a U.S. Department of Defense militarystandard that defines a standard format, structure, andorganization for large geographic databases. A VPF datasetcontains read-only feature classes.

You can export from VPF to coverage and vice versa. In theSearch tab of the ArcToolbox window, type “VPF” to locate alltools that accept VPF datasets as input or output.

VPF feature classes

A VPF feature class is a collection of features (primitives) thathave the same attributes. Each feature class contains point(node), line (edge), polygon (face), or annotation features and hasan associated feature attribute table. VPF feature classes are read-only. They can only be used by geoprocessing tools that

produce a distinct output. They cannot be used by tools thatalter the geometry or attributes of the input feature class.

In the Search tab of the ArcToolbox window, type “feature class”to locate tools that accept VPF feature classes as input or output.

If you want to alter the schema of a VPF feature class, you mustexport the feature class to a geodatabase feature class. In theArcToolbox window, under Conversion Tools, click the ToGeodatabase toolset and use the Feature Class To Feature Classtool or the Feature Class to Geodatabase tool (for multiple inputs)to convert VPF feature classes into geodatabase feature classes.

Page 92: Geoprocessing in ArcGIS: ArcGIS 9

86 GEOPROCESSING IN ARCGIS

Raster data

Raster datasets

A raster dataset is any valid raster format that is organized intobands. A raster dataset can contain one or more bands. It can bestored in a folder in a file system, a geodatabase (personal orArcSDE), or a raster catalog. The following raster datasets aresupported: ESRI GRID, ERDAS IMAGINE, TIFF, MrSID, JFIF(JPEG), ESRI BIL, ESRI BIP, ESRI BSQ, Windows Bitmap, GIF,ERDAS 7.5 LAN, ERDAS 7.5 GIS, ER Mapper, ERDAS Raw, ESRIGRID Stack File, DTED Level 1 & 2, ADRG, PNG, NITF, CIB, andCADRG.

When you use a raster dataset as input to a geoprocessing tool,you can simply click the raster dataset in the Browse dialog boxand click Add. Band 1 of the raster dataset is used, unless it is atool that operates on multiband data, such as those in theMultivariate toolset (of the ArcGIS Spatial Analyst Toolstoolbox), or some of the raster data management tools such asCopy and Rotate.

In the Search tab of the ArcToolbox window, type “raster” tolocate all tools that accept raster datasets as input or output.

Raster dataset bands

A raster dataset band consists of a rectangular matrix of cellsthat describe characteristics of an area and their relative positionsin space. Each cell has a value, indicating what is represented inthe cell. All cells in a raster band have the same height and widthand represent a portion of an area.

If you know you want to use a specific band of a raster dataset asinput, double-click the raster dataset in the Browse dialog box forthe input parameter and click the band you want to use. If youuse the dataset, Band 1 will automatically be used.

Type “raster” in the Search tab of the ArcToolbox window tolocate tools that accept raster bands as input or output.

Raster catalogs

A raster catalog is a collection of raster datasets organized in atable, in which the records define the individual raster datasetsthat are included in the catalog. A raster catalog is used to displayadjacent or overlapping raster datasets without having to mosaicthem into a large file. Geodatabase raster catalogs can be createdusing the Create Raster Catalog tool. The raster datasets within araster catalog can be used as input to geoprocessing tools thataccept raster datasets as input.

Page 93: Geoprocessing in ArcGIS: ArcGIS 9

GEOPROCESSING BASICS 87

Type “raster” in the Search tab of the ArcToolbox window tolocate tools that accept raster catalogs or raster datasets—thatcould be stored inside a raster catalog—as input or output.

TIN data

TIN datasets

TIN datasets can be used to display and analyze surfaces. Theycontain irregularly spaced points that have x,y coordinatesdescribing their location and a z-value that describes the surfaceat that point. The surface could represent elevation, precipitation,or temperature. A series of edges join the points to form triangles.The resulting triangular mosaic forms a continuous facetedsurface, where each triangle face has a specific slope and aspect.

In the Search tab of the ArcToolbox window, type “TIN” to locatetools that accept TIN datasets as input or output.

Note: You will only see the ArcGIS 3D Analyst™ Tools toolbox ifyou have installed the 3D Analyst extension. If the tools aredisabled (a lock icon appears next to the tools), the extension isnot enabled. You need to enable the extension in the Extensionsdialog box of the application you’re working in (click the Toolsmenu, then click Extensions) to be able to work with theextension’s tools.

Layer data

Layer files

Layer files reference geographic data stored on disk. They canreference most data sources supported in ArcCatalog, such asfeature classes, CAD datasets, CAD drawing datasets, coveragedatasets, shapefile datasets, raster datasets and bands, TINdatasets, and so on. Think of them as a cartographic view of yourgeographic data. They are separate files on disk and have a .lyrextension.

Many geoprocessing tools will handle layer files. Some tools onlyaccept layer files or layers in memory as input or output. If this isthe case with the tool you are using, the display name for theparameter will contain the word “layer”, and all other data sourceswill be filtered out of the parameter’s Browse dialog box. For moreinformation on layer files, see Modeling Our World.

Geostatistical layer files

Geostatistical layer files are created by the ArcGIS GeostatisticalAnalyst extension.

You can export geostatistical layer files to ESRI GRID using theGeostatistical Layer To Raster tool located inside the

Page 94: Geoprocessing in ArcGIS: ArcGIS 9

88 GEOPROCESSING IN ARCGIS

Geostatistical Analyst Tools toolbox. Converting thegeostatistical layer file to ESRI GRID will enable you to performfurther geoprocessing.

Layers

A layer is an in-memory file that references data stored on disk. Itis the same as any layer created when you add data to the displayof ArcMap. The Make Layer tools (such as Make Feature Layer)create a layer from input data. This layer is temporarily stored inmemory; it is not saved on disk. It only remains available withinthe current session. If the session is closed, the layer is deleted.Layers created in ArcCatalog cannot be used in ArcMap and viceversa. ArcCatalog does not display created layers, but they canbe used as inputs to other geoprocessing tools in the session inwhich you are working.

One of the main reasons for making and using layers isperforming attribute or locational selections. By making a layer inmemory first, you can perform selections on the layer withoutaffecting the original data source.

If desired, you can save a layer to a layer file (.lyr) using the SaveTo Layer File tool.

Table data

Tables

A table can be stored in a folder or a geodatabase. It contains aset of data elements arranged in rows and columns. Each rowrepresents an individual entity, record, or feature, and eachcolumn represents a single field or attribute value. Tables cancontain attributes that can be joined to datasets to provideadditional information about geographic data.

Folder-based tables include INFO and dBASE tables. Both thesetables can be joined to any feature class, so the attributes fromthe table can be used in future processing.

Tables stored in a geodatabase, for example, Access, FoxPro®,Oracle, or SQL Server, may contain additional attributes for aparticular feature class, or they might contain geographicinformation, such as addresses or x, y, and z coordinates.

The graphic below shows an INFO™ table inside a folder and anAccess table inside a geodatabase.

Using ArcMap layers as input data: Major Roads is a layer in thetable of contents of ArcMap and is used as the input data for theBuffer tool. The layer is added by clicking the dropdown list for theInput Features parameter and selecting the layer. Layers createdin ArcCatalog can be used as inputs to tools in the same way.

Page 95: Geoprocessing in ArcGIS: ArcGIS 9

GEOPROCESSING BASICS 89

Type “table” in the Search tab of the ArcToolbox window tolocate tools that accept tables as input or output.

Table views

Table views are the table equivalent of a layer. They are tablesstored in memory and are the same as the table view created whena table is added to ArcMap. The Make Table View tool can beused to create a table view. ArcCatalog does not display thesetables, but they can be used as inputs to other geoprocessingtools in the session in which you are working. Once you exit theapplication, the tables in memory are removed.

Type “table” in the Search tab of the ArcToolbox window tolocate tools that accept table views as input or output.

Page 96: Geoprocessing in ArcGIS: ArcGIS 9

90 GEOPROCESSING IN ARCGIS

When you run a tool from its dialog box or the command line, aresult is produced. By default, results are not overwritten. If youare working in an application with a display, such as ArcMap,results are permanently created and added to the display bydefault. Such settings can be changed on the Geoprocessing tabof the Options dialog box, accessed via the Tools menu of theArcGIS Desktop application in which you are working.

Adding results to the display

The Add results of geoprocessing operations to the displaycheck box is only available if you are working in an ArcGISDesktop application with a display, such as ArcMap. It is notavailable in ArcCatalog. This option is checked on by default, soresults produced from running tools via their dialog box or thecommand line will be added to your display. For custom tools,only data referenced by derived data variables that are set asparameters in the model or the script’s dialog box will be added tothe display. The Add to Display option in the ModelBuilder

Results from running tools

window only applies when a model is run from the ModelBuilderwindow, not from its dialog box. For more information, see‘Running a model’ in Chapter 9.

Creating temporary results

The Results are temporary by default check box is only availableif you are working in an ArcGIS Desktop application with adisplay, such as ArcMap. It is not available in ArcCatalog. Bydefault, all results are permanent. Check this check box if youwant all the results that are created from running tools (and addedto the display) to be temporary by default. This can be useful ifyou are testing scenarios and don’t want to worry about cleaningup data you don’t want to keep. Once you exit the session allresults will be deleted; so before you exit the session, you mustmake permanent those temporary results you want to keep.

Accessing the options that can be setfor results from running tools

Uncheck the Add results of geoprocessingoperations to the display check box if you don’twant results added to the display. This option isnot available in ArcCatalog.

Check to create temporary results from runningtools. This option is not available in ArcCatalog.This option is only available when Add results ofgeoprocessing operations to the display ischecked.

Page 97: Geoprocessing in ArcGIS: ArcGIS 9

GEOPROCESSING BASICS 91

To make a temporary result permanent, right-click the layer in thedisplay table of contents and click Make Permanent. A quick wayto make multiple layers permanent is to save the application’sdocument. When you do this, all temporary results added to thedisplay will become permanent.

If you have unchecked the Add results of geoprocessingoperations to the display check box, the Results are temporary bydefault check box will become unchecked (if already checked) andwill be disabled. You can only create temporary results if the Addresults of geoprocessing operations to the display check box ischecked.

Overwriting results

The results of geoprocessing operations in any application canbe overwritten. This is a useful option if you are runningoperations over and over to achieve a certain result and youdon’t want to produce multiple undesirable outputs that take updisk space and will have to be deleted later.

If this check box is not checked (the default), each time you runan operation and name the result the same as an existing output,you will receive an error indicating that the output exists. It isuseful to retain the default state if you want to make sure you donot overwrite existing data.

Check to overwrite the results from runningtools. Care must be taken when this option ischecked. After running a tool, then rerunningthe tool (using the same output name), theresult from the first run is overwritten by theresult from the second run of the tool.

Information on other options

For information on the other options on the Geoprocessing tab ofthe Options dialog box, see the following sections:

For information on logging geoprocessing operations to a historymodel, see ‘Keeping track of geoprocessing operations’ in thischapter.

See Chapter 4 for information on specifying the location of theMy Toolboxes folder.

For information about changing the current environment settings,see Chapter 6.

See Chapter 9 for information on displaying valid parameterswhen connecting a variable to a tool and more than one parameteris valid.

Page 98: Geoprocessing in ArcGIS: ArcGIS 9

92 GEOPROCESSING IN ARCGIS

Geoprocessing settings

Geoprocessing settings include the state of the ArcToolboxwindow, the state of the Environment Settings dialog box, andany variables that have been created at the command line.

Geoprocessing settings are saved automatically betweenArcCatalog sessions and when you save a map document inArcMap. Also, when working on different projects you might usedifferent settings based on the nature of each project. Forinstance, you may have removed unnecessary toolboxes orchanged default environment settings. You can save thegeoprocessing settings you’ve specified as the default settingsfor all applications. Alternatively, you can save settings to a fileso you can quickly load them the next time you need them in anyapplication.

Each of these settings is discussed in the sections that follow.

The state of the ArcToolbox window

Any changes you make to the ArcToolbox window will be savedwhen you save the settings. This includes the addition orremoval of toolboxes and the reorganization of tools, such asthose in the following graphic.

For more information on working with toolboxes see Chapter 4,‘Working with toolboxes’.

The state of the Environment Settings dialog box

Any changes you make to the default environment settings, suchas those in the following graphic, will be saved when you savethe settings.

For more information on setting environments see Chapter 6,‘Specifying environment settings’.

Variables that have been created at the commandline

If you’ve created a variable for a complex parameter value thatyou want to use for certain projects or between applications,saving the settings will save your created variables, so you don’thave to re-create them each time they are needed.

See ‘About variables’ in Chapter 7 for more information onvariables and their creation.

See ‘Saving and loading geoprocessing settings’ on the followingpages for information on how to save and load geoprocessingsettings.

Page 99: Geoprocessing in ArcGIS: ArcGIS 9

GEOPROCESSING BASICS 93

Saving andloadinggeoprocessingsettingsGeoprocessing settings includethe state of the ArcToolboxwindow, the state of theEnvironment Settings dialogbox, and any variables thathave been created at thecommand line.

Settings are persisted betweenArcCatalog sessions, and if youare working in ArcMap and yousave the map document, allcurrently set geoprocessingsettings will be saved with themap document.

When you are switchingbetween different applicationsor working on a certain project,you may wish to save thegeoprocessing settings youhave specified to a file so youcan quickly load them the nexttime you need them in anyapplication. Alternatively, youmay save the settings as thedefault for all applications. See‘Geoprocessing settings’ earlierin this chapter to gain a betterunderstanding of the settingsthat are saved.

Saving settings

1. Right-click the ArcToolboxwindow, point to SaveSettings and click either ToFile or To Default, dependingon whether you want to savesettings to a file that can beloaded later, or you want toset the current settings as thedefault for all applications.

2. If you choose To File, clickthe Save in dropdown arrowand navigate to the locationin which you wish to save thesettings file.

3. Click the File name text boxand type a name for the file.

4. Click Save.

1

2

3

4

Page 100: Geoprocessing in ArcGIS: ArcGIS 9

94 GEOPROCESSING IN ARCGIS

Loading settings

1. Right-click the ArcToolboxwindow, point to LoadSettings and click either FromFile or From Default, depend-ing on whether you want toload settings from a file, oryou want to load the defaultsettings for all applications.

2. If you choose From File, clickthe Look in dropdown arrowand navigate to the locationof your saved settings XMLfile.

3. Click the XML file and clickOpen.

Your saved geoprocessingsettings are loaded.

1

2

3

Page 101: Geoprocessing in ArcGIS: ArcGIS 9

GEOPROCESSING BASICS 95

Keeping track of geoprocessing operations

When you perform geoprocessing tasks, regardless of themethod, whether from a dialog box, the command line, a model, ora script, there are different ways you can keep track of yourgeoprocessing operations:

• View the metadata for results from running geoprocessingtools.

• View messages in the Command Line window.

• View the tools run in any session.

• Create a report containing information about the tools run in asession.

Each of these options is discussed in the sections that follow.

Viewing metadata for geoprocessing results

Whenever a result is produced by running a geoprocessing tool,you can find out how the result was produced by viewing itsmetadata in ArcCatalog.

Viewing messages in the current session

The message section of the Command Line window recordsmessages for all geoprocessing operations, regardless of wherethey are performed. Tools that have been executed can be editedand rerun from a dialog box.

For more information on using the Command Line window, seeChapter 7, ‘Using the Command Line window’.

Viewing the tools run in any session

After running a geoprocessing tool using any ArcGIS Desktopapplication, the tool is added to the session’s history model,located in the History toolbox in your My Toolboxes folder.

The history model documents which tools were run and whichparameter values were set in the last session. You can view thisinformation the next time you open ArcCatalog by editing thehistory model and double-clicking each tool within it to view theparameter values that were set.

Right-click the execution string and click Open to edit the tool’sparameter values and rerun the tool.

Alter parameter values, then click OK torerun the tool.

Page 102: Geoprocessing in ArcGIS: ArcGIS 9

96 GEOPROCESSING IN ARCGIS

You can also view the contents of the history model as it is beinggenerated to view the tools that have been run and parametervalues that have been set to date in the current session. Afterrunning a tool, right-click the execution string in the messagesection of the Command Line window and click Show History. Formore information on viewing history during a session, seeChapter 7, ‘Using the Command Line window’.

If you don’t want a history model to be generated for eachsession, you can turn the option off. Click the Tools menu in theapplication you are running and click Options. Click theGeoprocessing tab and uncheck the Log geoprocessingoperations to a history model check box.

Generating a report of tools run in a session

When you generate a report from the history model generated fora session, you have a detailed account of the tools that were runduring that session.

For more information on generating a report, see ‘Generating areport’ in Chapter 9.

In the sample report above, the Clip tool and theparameter values that were set for it aredocumented for future reference.

To generate a report, click theModel menu and click Report. Areport can be displayed in awindow, or you can save it to disk.

In the history model above, there is one tool: Clip_1. This was the onlytool run in this particular session. You can open the tool to view theparameter values that were set. There could be multiple tools inside ahistory model, depending on the number of tools run in a particularsession.

Page 103: Geoprocessing in ArcGIS: ArcGIS 9

GEOPROCESSING BASICS 97

Sharing your geoprocessing work

When sharing your geoprocessing work, you should ensure thatyou send all relevant sources of information. A toolbox maycontain custom tools that require other files to execute. Scriptsadded to a toolbox are stored outside the toolbox, and systemtools added to a toolbox may reference dynamic link libraries(DLLs) not registered on the desktop. Models may containsystem tools and scripts, so a toolbox may contain a model thatcannot execute because one or more tools may be missing acomponent. If a toolbox contains a script or a system tool, thescript, DLL, or both must also be sent with the toolbox. Thereceiving user can then register any DLLs and update theproperties of the tool to ensure that the connections between thetool and its dependencies are correct, such as the path to thescript if relative paths have not been set for the tool.

Setting relative paths

When relative paths are set, all pathnames within the tool will bestored relative to the toolbox containing the tool. By ensuringthat the paths to all information sources are set as relative and bykeeping your data relative to the location of the toolbox, when theuser of your tools opens them, paths to sources of informationwill not have to be repaired.

Examine the following directory structure as an example.

As long as the directory structure between the toolboxes and thedata does not change and relative paths are set for the tools—themodel and script—the data folders and the toolboxes can be

placed in any folder, on any drive, as the graphic that followsshows.

The paths to information sources referenced in the model, forexample, input and derived data, and in the script, for instance,the path to the script, will be modified automatically.

To set relative paths for sources of information referenced by atool, right-click the tool and click properties. Click the General taband check the Store relative path names (instead of absolutepaths) check box.

Page 104: Geoprocessing in ArcGIS: ArcGIS 9

98 GEOPROCESSING IN ARCGIS

See ‘Storing relative pathnames’ in Chapter 5 for more informationon relative paths.

Setting permissions on a toolbox

A toolbox may be a file in a folder or a table in a geodatabase, sodepending on the physical location of the toolbox, certainpermissions may be set on the toolbox and its contents. Whensharing your toolboxes over a network or within an ArcSDEgeodatabase, you should make your toolboxes read-only. Manyusers can read the same toolbox, but problems can result fromallowing multiple users to make changes to the same toolbox. Thecontent of the toolbox is determined by the last application to beclosed. For more information, see ‘Rules for working withtoolboxes’ in Chapter 4.

A toolbox in a folder

A toolbox file’s (.tbx) permissions are set like any other file ondisk. Attributes such as read and write access may be set. InWindows 2000 or Windows XP, you can grant specific users anduser groups a wide range of permissions. These permissions arefor the entire TBX file, not for the specific tools it contains.

A toolbox in a geodatabase

A toolbox is a table in the database. In geodatabase terms, thetoolbox is an object class, and the type of permissions and howthey are granted are determined by the database supporting thegeodatabase. For example, in Oracle, an object class (table) has anowner who has read and write access. The owner may grant anumber of different database access permissions to other users.These permissions are for the entire toolbox table, not for thespecific tools it contains. Tools are simply rows in the table, sopermissions cannot be set on a tool-by-tool basis.

The geodatabase facilitates a multiuser work flow with the use ofversions that allow multiple users to edit an object class in thegeodatabase without data replication. Toolboxes do not supportmultiuser editing in a geodatabase, only multiuser reading.

Distributing your work

Once all relevant sources of information are in the same folder,relative paths are set for your tools, and permissions are set onyour toolboxes, you are ready to distribute your work. The safestand quickest way to distribute your work is to e-mail it or place iton an FTP site that can be accessed by the person receiving yourwork. Alternatively, or as a backup, you could copy the files to aCD and send it through the mail.

Archiving your work

Before you send your work, it is efficient to use an archivingprogram, such as WinZip®, to combine all the necessary files intoone compressed archive. Once the files are compressed, you thendistribute the archive. The most commonly used archive format isthe ZIP file, but you could use others, such as TAR, gzip, or CABfiles.

There are two benefits to using archives to distribute yourgeoprocessing work. First, only one file transfer operation isrequired to obtain all related files, and second, file transfer time isminimized because the files in an archive are compressed.

When the user receives an archive file, it needs to be unzipped toa folder. The paths to all information sources are automatically setrelative to the position of the toolbox, provided that you setrelative paths for your tools.

Page 105: Geoprocessing in ArcGIS: ArcGIS 9

GEOPROCESSING BASICS 99

Sharing your work via a network

If you are working in a networked environment, you can simplyshare the folder containing the necessary files, such as toolboxes,data, script files, and XML files for stylesheets, geoprocessingsettings, or documentation files, so others can access and copythem locally. Remember to set relative paths for sources ofinformation referenced by the tools, and be sure the samedirectory structure is set between the toolbox and the data on themachine your work is copied to.

You can use the standard Universal Naming Convention (UNC)format for paths, such as \\yourmachinename\folder name\etc, soothers in your local area network can access and run your toolsfrom, and place results on, your machine. However, this canintroduce issues with overwriting your toolboxes’ content.Remember that a toolbox’s contents are determined by the lastapplication to be closed. See ‘Rules for working with toolboxes’ inChapter 4 for more information.

Page 106: Geoprocessing in ArcGIS: ArcGIS 9
Page 107: Geoprocessing in ArcGIS: ArcGIS 9

IN THIS CHAPTER

101

Working with toolboxes 4• Opening and docking the

ArcToolbox window

• Locating the system toolboxes

• Creating new toolboxes

• Managing toolboxes

• Adding documentation totoolboxes

• Viewing documentation fortoolboxes

• Rules for working with toolboxes

A toolbox is a persistent entity that can contain toolsets and geoprocessingtools. It takes the form of a TBX file on disk or a table in a geodatabase.The collection of system toolboxes contains more than 400 system toolscategorized into toolsets.

A toolbox is the mechanism for sharing tools. Toolboxes are accessedthrough the ArcCatalog tree or the ArcToolbox window. They may be addedto or removed from the ArcToolbox window to create a list of shortcuts tooften used, or favorite, toolboxes stored on disk.

The behavior of a toolbox is similar to a dataset. A toolbox may be:

• Created inside a folder or a geodatabase

• Opened to see its contents, such as tools and toolsets

• Copied and pasted from one location to another

• Altered by adding, deleting, or renaming the tools and toolsets it contains

• Documented by creating or editing documentation

Page 108: Geoprocessing in ArcGIS: ArcGIS 9

102 GEOPROCESSING IN ARCGIS

Opening the ArcToolboxwindow

1. Click the Show/HideArcToolbox Window buttonon the Standard toolbar ofthe ArcGIS Desktop applica-tion you are working in toopen the ArcToolbox window.

A list of toolboxes thatcontain toolsets and systemtools is displayed in thewindow.

Docking the ArcToolboxwindow

1. Click the bar at the top of theArcToolbox window and dragthe window to your preferredlocation within the applica-tion or outside it.

2. Drop the panel by releasingthe mouse.

Opening anddocking theArcToolboxwindowWhen the ArcToolbox windowis initially opened, a list ofavailable toolboxes is displayedin the window. Contained withinthe toolboxes are system toolsthat can be run. The toolboxeslisted are shortcuts that pointto toolboxes stored on disk.

You can customize theArcToolbox window to central-ize the location of the toolboxesyou use most often. In additionto working with the systemtoolboxes, you can create yourown toolboxes in folders orgeodatabases that might bespread out over your system oron other machines in yournetwork.

The ArcToolbox window is aseparate window inside theArcGIS Desktop applicationyou are running. It can bedocked anywhere within theapplication, or it can be placedon your desktop.

1

2

1

Page 109: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLBOXES 103

1. Click the Tools menu andclick Options.

2. Click the General tab.

3. Check Toolboxes, then clickOK on the Options dialogbox.

A Toolboxes folder is addedto the ArcCatalog tree so youcan access the toolboxesinstalled on your system.

4. Navigate in the ArcCatalogtree to the Toolboxes folder.

5. Expand the Toolboxes folderto view its contents.

6. Expand the SystemToolboxes folder to view thetoolboxes you have storedon your system.

Locating thesystem toolboxesThe system toolboxes can beaccessed from the Toolboxesfolder in the ArcCatalog tree. Byexpanding the Toolboxescontained within the SystemToolboxes folder, you will seethe toolsets stored within them.Inside each toolset is a collec-tion of tools that can be used.

See Also

See Chapter 5, ‘Working withtoolsets and tools’, for moreinformation on working withsystem tools.

See Also

See ‘Opening and docking theArcToolbox window’ earlier in thischapter for information on usingthe ArcToolbox window to createshortcuts to the toolboxes you usemost frequently.

5

6

1

2

3

See Also

Type “Quick Reference Guide” inthe Search tab of the online Helpsystem and double-click the link tothe Geoprocessing CommandsQuick Reference Guide for a list ofavailable tools depending on theArcGIS product (ArcView,ArcEditor, or ArcInfo) andextension products you haveinstalled.

Page 110: Geoprocessing in ArcGIS: ArcGIS 9

104 GEOPROCESSING IN ARCGIS

Creating newtoolboxesYou can create new toolboxes inthe ArcToolbox window or theArcCatalog tree to hold thetools you want to use.

In the ArcToolbox window, newtoolboxes point to a defaultlocation on disk: the location ofthe My Toolboxes folder in theToolboxes folder in theArcCatalog tree.

Toolboxes can also be createdinside existing folders orgeodatabases directly withinthe ArcCatalog tree. Once youhave created a new toolbox, addit to the ArcToolbox window asa shortcut and use it from there.This saves having to navigateto the location of your toolboxin the ArcCatalog tree each timeyou want to use it. u

Creating a new toolbox inthe ArcCatalog tree

1. Right-click the folder orgeodatabase in which youwant to create a new toolbox,point to New, and clickToolbox.

2. Type a new name for thetoolbox.

3. Press Enter.

Creating a new toolbox inthe ArcToolbox window

1. Right-click the ArcToolboxfolder in the ArcToolboxwindow and click NewToolbox.

A toolbox shortcut appears inthe ArcToolbox window.

Tip

Locating toolboxesIf you are unsure about the locationof a toolbox, right-click the toolboxand click Properties to see thelocation on disk where the toolboxwas created. 1

See Also

See Chapter 5, ‘Working withtoolsets and tools’, for informationon adding tools to toolboxes andcreating new tools inside toolboxes.

1

Page 111: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLBOXES 105

Changing the defaultlocation of the MyToolboxes folder

1. Click the Tools menu andclick Options.

2. Click the Geoprocessing tab.

3. Click the Browse button.

4. Browse to the location whereyou would prefer newtoolboxes, which are createdinside the ArcToolboxwindow or directly inside theMy Toolboxes folder in theArcCatalog tree, to be stored.

5. Click OK on the Browse forFolder dialog box.

6. Click OK.

All new toolboxes that youcreate inside the ArcToolboxwindow or the My Toolboxesfolder will be stored in thislocation on disk.

The My Toolboxes folder islocated inside the Toolboxesfolder, which is at the root levelin the ArcCatalog tree. Newtools can be created directly inthis folder. Alternatively, theycan be created inside theArcToolbox window. Toolscreated inside the ArcToolboxwindow are shortcuts that pointto this folder.

You can change the defaultlocation on disk for the MyToolboxes folder. Any newtoolboxes you create directlyinside the My Toolboxes folderor the ArcToolbox window willbe stored on disk in the locationspecified.

1

2

3

6

Tip

Resetting the location ofthe My Toolboxes folderTo reset the location on disk of theMy Toolboxes folder back to thedefault, click Reset on theGeoprocessing tab of the Optionsdialog box, accessed via the Toolsmenu in the application you areworking in.

Page 112: Geoprocessing in ArcGIS: ArcGIS 9

106 GEOPROCESSING IN ARCGIS

Copying and pasting atoolbox within theArcCatalog tree

1. Right-click the toolbox in theArcCatalog tree and clickCopy.

2. Right-click the folder orgeodatabase into which youwant to place a copy of thetoolbox and click Paste.

A copy of the toolbox isplaced in the destinationlocation.

ManagingtoolboxesYou manage toolboxes in asimilar way to how you managedata.

Toolboxes can be copied andpasted between folders,between geodatabases, orbetween geodatabases andfolders.

Toolbox shortcuts can becopied from the ArcToolboxwindow and pasted into a folderin the ArcCatalog tree. Theycan be copied and pasted into ageodatabase, provided thecopied toolbox resides inside ageodatabase.

You cannot copy and pastetoolbox shortcuts within theArcToolbox window. Instead,create a new toolbox and copytools or toolsets into it fromexisting toolboxes in theArcToolbox window. u

Tip

About read-only toolboxesThe tools within toolboxes that areset as read-only can be run andcopied but cannot be altered. Settoolboxes as read-only if you wantothers to access and run yourtools, but you don’t want theircontents to be altered.

Copying and pasting atoolbox from theArcToolbox window tothe ArcCatalog tree

1. Right-click the toolbox short-cut in the ArcToolbox windowand click Copy.

2. Navigate in the ArcCatalogtree to the location into whichyou want to paste thetoolbox.

3. Right-click the folder orgeodatabase and click Paste.

A copy of the toolbox isplaced in the destinationlocation.

1

2

1

3

Page 113: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLBOXES 107

Dragging and droppingtoolboxes

1. Click the toolbox you want tomove, then drag and place itin another location.

The location you place it intocan be a folder or ageodatabase.

Note that if you drag thetoolbox into the ArcToolboxwindow, it is not moved. Ashortcut to the toolbox ondisk is created.

Toolboxes can be dragged anddropped in the ArcCatalog treein the same way you drag anddrop data. When a toolbox isdragged into another folder orgeodatabase, it is moved to thenew location if the new locationis on the same disk. If the newlocation is on a different disk, acopy of the toolbox is made.

Toolboxes that you havecreated in folders andgeodatabases can be added ordragged to the ArcToolboxwindow, providing quick accessto often used tools. u

Adding toolboxes to theArcToolbox window fromthe ArcCatalog tree

1. Right-click the toolbox in theArcCatalog tree and clickAdd to ArcToolbox.

The toolbox is added to theArcToolbox window as ashortcut to the toolbox storedon disk.

1

1

Tip

About toolboxes in theArcToolbox windowToolboxes in the ArcToolboxwindow are shortcuts that point totoolboxes in folders orgeodatabases on disk. Whenworking with toolboxes in theArcToolbox window, you arealways accessing and updating theactual toolbox on disk, not a copyof the toolbox.

Page 114: Geoprocessing in ArcGIS: ArcGIS 9

108 GEOPROCESSING IN ARCGIS

Adding toolboxes to theArcToolbox window viathe ArcToolbox contextmenu

1. Right-click the ArcToolboxfolder inside the ArcToolboxwindow and click AddToolbox.

2. Click the Look in dropdownarrow and navigate to thelocation of the toolbox ondisk that you want to add as ashortcut.

3. Click the toolbox.

4. Click Open.

The toolbox is added to theArcToolbox window.

The toolbox that is added is ashortcut that points to thetoolbox stored on disk. Usethe shortcut as a fast way toaccess the toolbox on disk.

If you are working in a desktopapplication, such as ArcMap,where you do not have accessto the ArcCatalog tree, you’llalways use the ArcToolboxwindow to access toolboxes.Toolboxes can be added asshortcuts to the ArcToolboxwindow by using the AddToolbox option. u

1

2

3

4

See Also

If you have set up your ArcToolboxwindow with appropriate toolboxesfor a particular project, you cansave the geoprocessing settings byright-clicking the ArcToolboxwindow and clicking Save Settings.Settings can be loaded in theArcToolbox window in any ArcGISapplication by right-clicking theArcToolbox window and clickingLoad Settings. For more informa-tion, see ‘Geoprocessing settings’in Chapter 3.

Page 115: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLBOXES 109

Deleting toolboxes

1. Right-click the toolbox in theArcCatalog tree and clickdelete.

The toolbox is permanentlydeleted from disk.

Toolboxes can be deleted fromthe ArcCatalog tree similarly todatasets.

If the toolbox you delete refersto a script, the script added tothe toolbox is not also deletedfrom disk. You must delete thescript from disk using, forinstance, Windows Explorer, if itis also no longer needed.

Toolboxes you add as shortcutsto the ArcToolbox windowcannot be deleted, but they canbe removed from theArcToolbox window. Thetoolbox will still exist on disk.This provides you with an easyway to manage the toolboxesyou frequently use in theArcToolbox window andremove those you don’t useoften. You can always addtoolboxes back to theArcToolbox window.

To protect toolboxes from beingdeleted, make them read-only.For toolboxes inside a folder,right-click the TBX file on diskand click Properties to set theread-only property on yourtoolbox. For toolboxes inside apersonal geodatabase, right-click the geodatabase on diskand click Properties to set theread-only property. Fortoolboxes inside an ArcSDEgeodatabase, set privileges forthe toolbox. Right-click thetoolbox in ArcCatalog and clickPrivileges. u

Removing toolboxesfrom the ArcToolboxwindow

1. Right-click the toolbox andclick Remove.

The toolbox shortcut will beremoved from the ArcToolboxwindow, but the toolbox thatis stored on disk will not bedeleted.

1

1

Page 116: Geoprocessing in ArcGIS: ArcGIS 9

110 GEOPROCESSING IN ARCGIS

Renaming toolboxes

1. Click the toolbox you want torename.

2. Click File and click Rename.

3. Type the new name.

4. Press Enter.

Toolboxes you create can berenamed to something moremeaningful in the ArcCatalogtree.

If you have already added atoolbox as a shortcut to theArcToolbox window withinArcCatalog and you rename thetoolbox in the ArcCatalog tree,the shortcut in the ArcToolboxwindow will be updatedautomatically. If you rename theshortcut, the toolbox on diskwill be automatically renamed inthe ArcCatalog tree.

However, if you add the toolboxto the ArcToolbox window inArcMap, then rename thetoolbox in ArcCatalog, thetoolbox name will not beupdated in the ArcToolboxwindow in ArcMap because ithas already been read intomemory. You have to removethe toolbox and add it back tothe ArcToolbox window toobtain the name change madeto the toolbox.

Toolboxes inside a geodatabaseact as any other object. Certaincharacters are not allowed inthe name of the toolbox. u

Tip

Renaming toolboxesFor a quick way to rename atoolbox, click the toolbox to selectit, then click again to rename it.

1

2

3

Page 117: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLBOXES 111

Sometimes the ArcCatalogtree’s list of a toolbox’s con-tents will not match thetoolbox’s actual contents. Onereason this could happen is ifyou had two ArcCatalogapplications open at once andyou deleted a tool from atoolbox in one application. Theother application will not knowabout this change until you exitthe application and openanother application. To avoidhaving to close the application,you can just refresh thetoolbox. Note that to avoidsuch conflicts it is alwayssafest to work with oneapplication open at a time. u

Refreshing toolboxes

1. Right-click the toolbox in theArcCatalog tree and clickRefresh.

The toolbox should nowcontain its actual contents.

1

See Also

See ‘Rules for working withtoolboxes’ in this chapter for moreinformation on conflicts that canoccur when working with the sametoolbox in multiple applications.

Page 118: Geoprocessing in ArcGIS: ArcGIS 9

112 GEOPROCESSING IN ARCGIS

Viewing the location andalias of a toolbox

1. Right-click the toolbox andclick Properties.

2. Click the General tab.

The name of the toolbox, thelocation in which it is stored,and the alias name for thetoolbox are displayed.

The alias can be used whenadding or setting the toolboxcontaining the tool you wishto use at the command line orinside a script.

3. Click OK.

By right-clicking a toolbox andclicking Properties, you can findout the location of the toolboxon disk and the alias used.

Obtaining the location of atoolbox on disk is particularlyuseful if you have added atoolbox as a shortcut to theArcToolbox window and wishto know where it is located ondisk.

The toolbox alias is an alterna-tive name for the toolbox. It canbe used to avoid confusionwhen running tools at thecommand line or within a script,when tools have the same namebut are stored in differenttoolboxes in the ArcToolboxwindow. For example, typing“clip_analysis”, then a space, atthe command line will produceusage for the system tool Clipin the Analysis Tools toolbox. u

See Also

See Chapter 7, ‘Using the Com-mand Line window’, for moreinformation on using aliases at thecommand line.

3

2

1

Page 119: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLBOXES 113

Saving toolboxes withina map document

1. In ArcMap, set up yourtoolboxes in the ArcToolboxwindow with the tools youwant to use within the mapdocument.

2. Click File on the Main Menu,then click Save As.

3. Click the Save in dropdownarrow, and navigate to adirectory for which you havewrite access.

4. In the File name box, type aname for the map document.

5. Click Save.

Your changes to theArcToolbox window will besaved with the mapdocument.

6. Click File, then Exit to closethe ArcMap session.

The ArcToolbox window is aseparate window in eachapplication. It is saved in itscurrent state when you save amap document. This is useful ifyou are working on differentprojects and will use differenttools for each project.

See Also

See ‘Geoprocessing settings’ inChapter 3 for information onsaving geoprocessing settings,including the state of theArcToolbox window, so settings canbe loaded at a later date in anyArcGIS Desktop application.

1

2

3

4

5

Page 120: Geoprocessing in ArcGIS: ArcGIS 9

114 GEOPROCESSING IN ARCGIS

Addingdocumentation totoolboxesYou can add documentation totoolboxes you have createdusing the DocumentationEditor.

The entries in the GeneralInformation section of theDocumentation Editor willappear in the metadata tab forthe toolbox. The abstractprovides a paragraph of textdescribing the toolbox’scontents. Keywords enable atoolbox to be found easily whensearching for it in ArcCatalog.Author information is funda-mental if you want users of yourtoolbox to be able to contactyou, and you should documentany constraints as to the use ofthe toolbox.

Entries in the Help section ofthe Documentation Editorappear in the Help pageaccessed via the ArcToolboxwindow. You can add summaryinformation for the toolbox andalso for its toolsets. u

Adding documentation toa toolbox via theArcToolbox window

1. Right-click the toolbox andclick Edit Documentation.

The Documentation Editoropens so you can adddocumentation to yourtoolbox.

See Also

See ‘Adding documentation totools’ in Chapter 5 for informationon documenting tools.

Adding documentation toa toolbox via theArcCatalog tree

1. Click the toolbox in theArcCatalog tree, then clickthe Metadata tab.

2. Click the Edit Metadatabutton on the Metadatatoolbar.

The Documentation Editoropens so you can adddocumentation to yourtoolbox.

1 2

1

Page 121: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLBOXES 115

The abstract is a brief descrip-tion of the contents of thetoolbox. It displays only in theMetadata tab, not in the Helppage for the toolbox, that isaccessed via the ArcToolboxwindow.

Keywords can make it easy tofind toolboxes in theArcCatalog tree. If yourtoolboxes are spread out indifferent folders, you cansimply search the ArcCatalogtree for all toolboxes with thesame keyword. A list of toolboxshortcuts with the samekeyword is provided. u

Adding an abstract

1. Open the DocumentationEditor.

2. Click Abstract in the GeneralInformation section.

3. Enter a paragraph of text forthe abstract.

4. Click Finish.

2 3

4

Adding keywords

1. Open the DocumentationEditor.

2. Click Keywords.

3. Click the first row and enterthe name for the firstkeyword.

4. Continue adding keywordsas appropriate, then clickFinish.

Tip

Writing documentation fortoolboxesUse the documentation for thesystem toolboxes as a guide to helpyou write documentation for yourown toolboxes.

2 3

4

Tip

Previewing your Help fileYou can view the Help page as youare creating it. Click the Previewbutton to view your documentationin an HTML file.

Page 122: Geoprocessing in ArcGIS: ArcGIS 9

116 GEOPROCESSING IN ARCGIS

Adding information aboutthe author

1. Open the DocumentationEditor.

2. Click Author in the GeneralInformation section.

3. Enter your name, organiza-tion, and position.

4. Enter your address details.

5. Click Finish.

Adding information aboutconstraints

1. Open the DocumentationEditor.

2. Click Constraints in theGeneral Information section.

3. Type information regardingthe limitations and con-straints of the toolbox.

4. Click Finish.

2

5

3

4

2

4

3

If you are distributing yourtoolbox, it is important todocument your contact details.Users might, for instance, wantto credit your work in the workthey do using your toolbox andwill need your contact informa-tion for this purpose. Alterna-tively, a user might want tocontribute information thatmight increase the usefulnessof your toolbox.

You can also list the constraintsof the toolbox’s contents.Constraints might be related tothe proper use or distribution ofthe toolbox and could alsoinclude a liability statement. u

Page 123: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLBOXES 117

Adding a summaryparagraph for a toolset

1. Open the DocumentationEditor.

2. Click Toolsets, expand atoolset, and click Summary.Click the Paragraph button toenter text for the toolset.

3. Type a summary paragraphfor the toolset into the textbox.

4. Click Finish.

2 3

5

4

2 3

4

In the Help section of theDocumentation Editor, you canadd a summary for the entiretoolbox and summaries for eachtoolset. Summary informationcan take the form of paragraphs,bullet points, illustrations,hyperlinks, subsections, andindented text. This informationis displayed in the Help pageaccessed via the toolbox’scontext menu in the ArcToolboxwindow. The next few pagesexplain how to add this informa-tion to your Help pages.

The order of the Contents list inthe Documentation Editor isreflected in the Help page. Youmay want to move the para-graph text for a summary sothat, for instance, a link torelated information is displayedabove the paragraph in the Helppage. Click Paragraph in theContents list and click the downarrow or the up arrow toreposition the paragraph text inthe desired location. u

Adding a summaryparagraph for a toolbox

1. Open the DocumentationEditor.

2. Click Summary.

2. Click the Paragraph button toinsert a paragraph of textabout the toolbox.

3. Type the paragraph into thetext box.

4. Click Finish.

Page 124: Geoprocessing in ArcGIS: ArcGIS 9

118 GEOPROCESSING IN ARCGIS

Add bullet items if you need toadd a list of bullet points toyour toolbox or toolsetsummaries. u

Adding bullet items

1. Open the DocumentationEditor.

2. Depending on whether youwant to add bullet points tothe summary of a toolbox orto a specific toolset, clickSummary; or click Toolsets,click a toolset in the Contentstab, then click Summary.

3. Click the Bullet Item button toinsert a bullet item.

4. Type the text for the bulletitem into the input box.

5. Continue adding bullet itemsand text as appropriate.

6. Click Finish.

32 4

6Items in theContents list

Page 125: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLBOXES 119

Inserting hyperlinks

1. Open the DocumentationEditor.

2. Depending on whether youwant to add a hyperlink to thesummary of a toolbox or to aspecific toolset, click Sum-mary; or click Toolsets, click atoolset in the Contents tab,then click Summary.

3. Click the Hyperlink button toadd a link to a file or Website.

4. Type the Path to the filenameor Web page.

The filename could be agraphic, such as a BMP or aJPEG file, or it could be anXML file. When linking toWeb pages, type the fulladdress of the page (http://...).

5. Type a Name that will displayas the text for the link.

6. Click Finish.

Hyperlinks enable relatedinformation to be accessiblefrom a Help page. The user ofyour Help page simply clicksthe link to open another file. Itcould be, for instance, anHTML file, a graphic, a textdocument or a Web page. u

2 3 4

6 5

Tip

Inserting links one afteranotherIf you want to add links in avertical list, click the Hyperlinkbutton, then click the Paragraphbutton, then the Hyperlink button.Adding the paragraph prevents thelinks from being added next to eachother horizontally.

Page 126: Geoprocessing in ArcGIS: ArcGIS 9

120 GEOPROCESSING IN ARCGIS

Adding an illustration

1. Open the DocumentationEditor.

2. Depending on whether youwant to add an illustration tothe summary of a toolbox orto a specific toolset, clickSummary; or click Toolsets,click a toolset in the Contentstab, then click Summary.

3. Click the Illustration button toadd a path to the illustrationthat will display directly in theHelp page.

4. Type the Path to the illustra-tion or click the Browsebutton, click the Look indropdown arrow in the Opendialog box, and navigate tothe location of the illustrationon disk. Click the illustrationand click Open.

5. Click the Name text box andtype a name for theillustration.

The name will display whenthe mouse pointer is heldover the graphic.

6. Click Finish.

2 43

6

Tip

Alternative ways to addgraphicsTo save space in your Help page orto hide illustrations that the user isnot required to see immediately,you can add an illustration as ahyperlink or to a subsection so itonly appears when the subsectionis expanded.

You can add illustrationsdirectly into your toolbox ortoolset summaries. Illustrationshelp to clarify the informationgiven in the text of asummary. u

5

Page 127: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLBOXES 121

Adding subsections

1. Open the DocumentationEditor.

2. Depending on whether youwant to add a subsection tothe summary of a toolbox orto a specific toolset, clickSummary; or click Toolsets,click a toolset in the Contentstab, then click Summary.

3. Click the Subsection buttonto add an expandablesection.

4. Type a name for the title ofthe subsection.

5. Click any of the buttons toadd items to the subsec-tion—for example, anillustration or a paragraph.

6. Click Finish.

Subsections are expandablesections of text that can includeany items, such as illustrations,bullet points, paragraphs,hyperlinks, or additionalsubsections. u

32 4

65

Page 128: Geoprocessing in ArcGIS: ArcGIS 9

122 GEOPROCESSING IN ARCGIS

Adding indented text

1. Open the DocumentationEditor.

2. Depending on whether youwant to add indents to thesummary of a toolbox or to aspecific toolset, click Sum-mary; or click Toolsets, click atoolset in the Contents tab,then click Summary.

3. Click the Indent button to addindented text.

4. Click the Indent button againto add another indent. Anyitems added while thesecond indent is selected willbe indented twice.

Add as many indents asnecessary to place text,graphics, hyperlinks, bulletpoints, or subsections in thedesired position on the page.

5. Click the item you wantindented, for example, aparagraph or an illustration.

6. Enter the information for theitem.

7. Click Finish.

2 5

7

6

3

Tip

Deleting itemsTo delete an item from the Contentslist, click the item and click theDelete button.

Tip

Placing items in theContents listYou can control the placement ofitems in the Summary section of theContents list. Click Summary, thenclick a button, such as the illustra-tion button, to place an item at theend of the list of items in theSummary section of the Contentslist. To place an item in a specificlocation, click an existing itemadded to the Contents list, thenclick a button to add an itemunderneath the selected item. Itemscan also be ordered later using theup and down arrows.

Any item in your Help pagescan be indented. Indents areuseful for repositioning text orgraphics in the Help page. Theycan be nested inside otherindents in order to nudge text orgraphics away from the left sideof the Help page. u

4

Page 129: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLBOXES 123

Exporting toolboxdocumentation to anHTML file

1. Right-click the toolbox andclick Properties.

2. Click the Help tab.

3. Click Export.

4. Click the Save in dropdownarrow and navigate to thelocation into which you wantto save the HTML file.

5. Type a File name and clickSave.

6. Click OK on the toolbox’sproperties dialog box.

See Also

After exporting the documentationfor all your toolboxes to HTMLfiles and compiling them into aHelp system (.chm), you can set upeach toolbox to reference anappropriate Help page in yourCHM file. See ‘Referencing acompiled Help file’ in this chapterfor more information.

The documentation you add toa toolbox using the Documenta-tion Editor can be exported toan HTML file, providing a staticview of your Help page. Notethat future changes made in theDocumentation Editor will notbe reflected in this HTML file. u

1

2

3

4

5

Page 130: Geoprocessing in ArcGIS: ArcGIS 9

124 GEOPROCESSING IN ARCGIS

Referencing a compiledHelp file

1. Right-click the toolbox andclick Properties.

2. Click the Help tab.

3. Check Reference a compiledhelp (CHM) file for thetoolbox help.

4. Browse to the location of theCHM file or type the path.

5. Type a Help Context thatcorresponds to a topic in theCHM file if you want a certaintopic to be displayed bydefault when the help for thetoolbox is opened.

6. Click OK.

Your toolboxes can referencepages within a compiled Helpfile (.chm). A CHM file consistsof compiled HTML files that aresnapshots of the help writtenfor toolboxes.

By providing the Help Context(the HTML topic ID), when theuser of your toolbox clicks Helpon the toolbox’s context menu,the help topic associated withthe Help Context ID in the CHMfile will display instead of theHelp file written in the Docu-mentation Editor. If you don’tsupply a Help Context, theCHM file will display with itsdefault page.

If modifications are made to theHelp file written in the Docu-mentation Editor, this Help fileis saved with the tool but is notdisplayed when the toolbox’sHelp file is viewed as long as aCHM file is referenced in thetoolbox’s Help tab.

There are many sources ofinformation on creating andcompiling HTML Help, or CHM,files. A good starting point isthe ‘Microsoft HTML Help 1.4SDK’ topic available from theMicrosoft library. Type “http://msdn.microsoft.com” in yourWeb browser and click the linkto the Library. In the Library,you’ll find information oncreating and compiling CHMfiles listed under ‘Visual Toolsand Languages, HTML Help’.

1

2

3

5

6

4

Page 131: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLBOXES 125

Viewing Help for atoolbox in theArcToolbox window

1. Right-click the toolbox andclick Help.

An HTML document opens,displaying documentation forthe toolbox.

2. Click Close to close the Helpwindow.

Viewingdocumentationfor toolboxesYou can view documentationfor all system toolboxes and forcustom toolboxes for which youhave added documentation.

All documentation added to theHelp section of the Documenta-tion Editor will display when theHelp for a toolbox is accessedthrough the ArcToolboxwindow. u

1

Page 132: Geoprocessing in ArcGIS: ArcGIS 9

126 GEOPROCESSING IN ARCGIS

Viewing metadata for atoolbox

1. Click the toolbox in theArcCatalog tree, then clickthe Metadata tab.

An abstract, keywords,author, constraints informa-tion, and a list of toolsets canbe displayed in the Metadatatab, depending on what isdocumented in the Docu-mentation Editor.

Metadata for a toolbox can beviewed in the toolbox’sMetadata tab via theArcCatalog tree. The informa-tion added to the GeneralInformation section of theDocumentation Editor isdisplayed, as well as a list oftoolsets if any have beencreated.

See Also

See ‘Adding documentation totoolboxes’ in this chapter forinformation on documenting yourtoolboxes and toolsets.

1

Page 133: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLBOXES 127

Rules for working with toolboxes

If a toolbox is altered in one application, for instance, in ArcMap,while another application is accessing it, such as ArcCatalog,there is the possibility that changes will be lost. When the lastapplication is closed, it will simply overwrite any changes thatwere made earlier. When making changes to a toolbox, only oneapplication should be open at a time so this type of conflict isavoided. Errors will not occur when a toolbox is accessed bymultiple applications, but the resulting toolbox may not be whatyou expect.

Rules for accessing a toolbox:

• A toolbox is rewritten when a change has been completed.Refresh the toolbox in other applications that are accessingthe same toolbox to refresh the contents of the toolbox.

• If multiple applications access a toolbox, the content of thetoolbox is determined by the last application to be closed.Changes made to the toolbox in applications closed earlier willbe lost.

• If two applications access a toolbox at the same time, changesmade in one application will not be seen by the toolbox in theother application.

For example, if a toolbox is open in ArcCatalog and ArcMapand a new tool is added in ArcCatalog, ArcMap will not seethe tool unless it reopens the toolbox. Removing the toolboxfrom the ArcToolbox window in ArcMap, then adding it backwill refresh the toolbox’s contents.

• If a toolbox is accessed in two applications at the same time,deleting the toolbox in one application will not cause it to bedeleted in the other.

For example, if a toolbox is open in ArcCatalog and ArcMapand it is deleted in ArcCatalog, ArcMap will still have accessto it because it has already read it into memory. When

ArcMap is closed, it will rewrite the toolbox, so instead ofbeing deleted, a newer version is created.

See ‘Sharing your geoprocessing work’ in Chapter 3 forinformation on the issues to consider when sharing yourtoolboxes with others.

Page 134: Geoprocessing in ArcGIS: ArcGIS 9
Page 135: Geoprocessing in ArcGIS: ArcGIS 9

IN THIS CHAPTER

129

Working with toolsets and tools 5• Managing toolsets

• Working with tools

• Creating models and addingscripts

• Setting parameters

• Changing tool properties

• Adding documentation to tools

• Viewing documentation for tools

• Finding tools

• Understanding tool licensing

Toolsets and tools are contained within toolboxes. Toolsets are used to groupcollections of tools together into logical groupings. A tool is a geoprocessingoperation that performs a geoprocessing task. There are hundreds of systemtools available, categorized into toolsets for ease of access. When you run atool, you simply open the tool’s dialog box, supply values for the tool’srequired parameters and any optional parameters if you don’t want to acceptthe default, then run the tool.

Toolsets can be created inside writable toolboxes, and you can createtoolsets inside toolsets to further organize the contents of a toolbox. Ifyou’re working with a group of system tools from different toolboxes, it’seasy to add the tools you want to work with into your own toolbox for easeof access.

If you need to repeat the same sequence of tools, it is most efficient tocreate your own model inside a toolbox or write a script and add it to atoolbox. The script can be created in any COM-compliant scriptinglanguage, such as Python or VBScript, or it could be an existing AML orEXE file. You can set parameters for models and scripts so users canspecify their values when they run your tools from their dialog boxes.

There is documentation available for each system tool, helping youunderstand how each tool works and what parameter values you need tospecify. When you create your own models inside or add scripts totoolboxes, it is equally important to document them so the user understandshow they work, so their life cycles are infinite. You can easily add Helpusing the Documentation Editor.

Page 136: Geoprocessing in ArcGIS: ArcGIS 9

130 GEOPROCESSING IN ARCGIS

ManagingtoolsetsThe system tools are organizedinto logical groupings, calledtoolsets. You can create yourown toolsets inside newtoolboxes or inside existingtoolsets to further organize thecontents of a toolbox.

You may, for instance, have aset of conversion toolsetsinside a toolbox, such as aRaster Conversion toolset and aFeature Conversion toolset.The tools inside the RasterConversion toolset might befurther organized into a Rasterto Feature toolset and a Featureto Raster toolset.

Toolsets you create can berenamed. If you have theArcToolbox window open inone ArcGIS Desktop applica-tion, such as ArcMap, and youchange the name of a toolsetinside a toolbox in ArcCatalog,you will have to remove thetoolbox containing the toolsetin the ArcToolbox window inArcMap and add it back againto see the change to the toolsetname. u

Creating a new toolset

1. Right-click the toolbox ortoolset you have created,point to New, and clickToolset.

A new toolset is createdinside the toolbox or toolset.

Renaming toolsets

1. Right-click the toolset youwant to rename and clickRename.

2. Type the new name.

3. Press Enter.

Tip

Read-only toolboxesIf your toolbox is read-only youcannot create toolsets inside it.

1

1

Page 137: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 131

Deleting toolsets

1. Right-click the toolset thatyou want to delete and clickDelete.

The toolset is permanentlydeleted from disk.

Toolsets you create can bedeleted from either theArcCatalog tree or theArcToolbox window.

If you are working in theArcToolbox window with atoolbox you created thatcontains toolsets you are notworking with, create a newtoolbox and copy the toolsetsyou are currently using into it.Then remove the toolbox youdon’t need from the ArcToolboxwindow. By doing this, you willretain the original contents ofthe toolbox, but you’ll removethe toolsets you are notcurrently working with fromyour ArcToolbox window.

See Also

See ‘Creating new toolboxes’ inChapter 4 for information on thecreation of new toolboxes.

1

Tip

Creating/Viewingdocumentation for a toolsetToolset documentation can becreated and viewed at the toolboxlevel. See Chapter 4, ‘Working withtoolboxes’, for information oncreating and viewingdocumentation for toolsets.

Page 138: Geoprocessing in ArcGIS: ArcGIS 9

132 GEOPROCESSING IN ARCGIS

Working withtoolsContained within the SystemToolboxes folder in theArcCatalog tree are toolboxesthat contain toolsets. Withineach toolset are system toolsthat you can run. Systemtoolboxes are added to theArcToolbox window by default,providing a quick alternative towork with your favorite systemtools. u

Opening a tool’s dialogbox

1. Right-click the tool and clickOpen.

Alternatively, double-click thetool.

The tool’s dialog box isopened so you can setvalues for its parameters andrun the tool.

1

Tip

Viewing the system tools inthe ArcCatalog treeClick the Tools menu in theapplication you are using and clickOptions. Click the General tab andcheck Toolboxes in the list of top-level entries.

Tip

Environment settingsClick Environments on a tool’sdialog box. Environment settingsspecified will be used for thecurrent run of the tool only.

See Also

You can run your own tools as anysystem tool by opening the tool’sdialog box and running the tool.See ‘Creating models and addingscripts’ in this chapter for moreinformation.

Page 139: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 133

Running a tool from itsdialog box

1. Right-click the tool you wantto run and click Open.

2. Fill in the tool’s parametervalues.

Required parameters have agreen circle to the left ofthem, indicating that a valueis required.

Those parameters that areoptional do not require aparameter value unless youwant to change the defaultvalue.

Check that all parametershave valid values. Those thathave invalid values will havea red cross to the left of them.

3. Click Environments to alterenvironment settingsspecified for the entireapplication. Changedsettings are only applied forthis run of the tool. Theapplication’s environmentsettings are not permanentlyaltered.

4. Click OK to run the tool.

A progress dialog boxappears, displaying thestatus of the processing.

5. Click Details to view theexecution messages.

6. Click Close on the Progressdialog box.

Tip

Using a selected setSelect data in the display, then runa tool from the ArcToolbox window.The tool will perform the operationon the selected set.

See Also

For information on changing thesettings applied to results fromrunning tools, see ‘Results fromrunning tools’ in Chapter 3.

Rules dictate where results willbe placed. Specify the path inthe tool’s dialog box, or set up aworkspace in the EnvironmentSettings dialog box, then type aname for the result inside atool’s dialog box—it will beplaced in the location set for theworkspace. Alternatively, if noworkspace is set, results willautomatically be placed in thelocation of the input data to atool. If there is no workspaceset and the input data’s locationis read-only, the result will beplaced in the location of yoursystem’s TEMP environment. u

See Also

The message section of theCommand Line window documentsthe execution of tools and allowsfor the reexecution of tools. SeeChapter 7, ‘Using the CommandLine window’.

4 3

1

Page 140: Geoprocessing in ArcGIS: ArcGIS 9

134 GEOPROCESSING IN ARCGIS

Copying and pastingtools

1. Right-click the tool you wantto copy and click Copy.

2. Right-click the toolbox ortoolset that you want to pastethe tool into and click Paste.

Tip

Dragging or pasting toolsinto read-only toolboxesYou cannot drag or paste a toolinto a read-only toolbox. Make thetoolbox writable or create a newtoolbox and paste the tool into thenew toolbox instead.

Dragging and droppingtools

1. Click the tool you want tomove.

2. Drag the tool and drop it ontoanother toolset or toolbox.

The tool is moved to the newlocation.

In either the ArcCatalog tree orthe ArcToolbox window, youcan organize your tools bycopying and pasting ordragging and dropping thembetween toolboxes or toolsets.

When you copy and paste atool, a copy is placed in thedestination toolbox or toolset.When you drag and drop a tool,the tool is moved to thedestination location, providedyou are working within thesame disk. If you drag and dropa tool from a toolbox or toolseton one disk to a toolbox ortoolset on another disk, a copyof the tool will be created. u

2

1

1

2

Page 141: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 135

Adding system tools

1. Right-click the toolbox ortoolset into which you want toadd system tools, point toAdd, and click Tool.

2. Expand the toolboxes andtoolsets and check the toolsyou would like to add intoyour toolbox or toolset.

If you check the toolbox, alltools within the toolbox willbe added. If you check atoolset within a toolbox, alltools within the toolset will beadded.

3. Click OK.

You can add system tools intowritable toolboxes or toolsetsprovided that the DLL has beenregistered with the system andthe tools in the DLL have beenregistered with the correctcomponent categories. Allsystem tools within the SystemToolboxes are, by default,registered correctly. If you havetools that have not beenregistered correctly, they willnot display in the Add Tooldialog box.

By checking a toolbox ortoolset in the Add Tool dialogbox, all tools contained withinthe particular toolbox or toolsetwill be added into your createdtoolset or toolbox. Using theAdd Tool dialog box to addsystem tools into your owntoolbox can be quicker thancopying and pasting them. It isalso useful for placing systemtools that are spread out in u

See Also

See ‘Creating new toolboxes’ inChapter 4 for information on howto create your own toolbox.

Tip

Read-only toolboxesYou cannot add tools into read-onlytoolboxes. Either make the toolboxwritable, or create a new toolbox toadd tools into.

3

2

1

Page 142: Geoprocessing in ArcGIS: ArcGIS 9

136 GEOPROCESSING IN ARCGIS

Adding tools from a DLL

1. Right-click the toolbox ortoolset into which you want toadd tools, point to Add, andclick Tool.

2. Click Add From File. u

2

toolsets in different toolboxesinto the same toolbox for easeof access.

If you don’t see the tools youare expecting in the Add Tooldialog box, the DLL might notbe registered with the systemand the tools in the DLL mightnot be registered with thecorrect component categories.You can click the Add From Filebutton to select the DLL andclick Open. Doing so performsthe necessary registrations sothe tools will display in the AddTool dialog box.

1

Page 143: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 137

3. Click the Look in dropdownarrow and browse to thelocation of the DLL file.

4. Click the DLL file to select it.

5. Click Open.

The DLL is registered withthe system, and the toolswithin the DLL are registeredwith the correct componentcategories. This registrationenables the toolbox contain-ing the tools to be added tothe Add Tool dialog box.

6. Check the added toolbox.

7. Click OK on the Add Tooldialog box.

All the tools within thechecked toolbox are addedto your toolbox or toolset.

6

7

34

5

Page 144: Geoprocessing in ArcGIS: ArcGIS 9

138 GEOPROCESSING IN ARCGIS

Deleting tools

1. Right-click the tool you wantto delete and click Delete.

Renaming a tool’s label

1. Right-click the tool and clickRename.

2. Type a new name for thetool’s label and press Enter.

Tip

About tools in read-onlytoolboxesYou cannot delete or rename toolsthat are in read-only toolboxes. Ifyou cannot make the toolboxwritable, create a new toolbox andadd to it the tools you want to use.

Tip

About renaming toolsWhen you rename a tool by right-clicking and clicking Rename, youare only renaming the tool’s label,not the name of the tool. See‘Changing the name, label, anddescription for your tools’ in thischapter for more information ontool names and labels.

1

1

2

Page 145: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 139

Displaying the propertiesof a tool

1. Right-click the tool and clickProperties.

The name of the tool (used atthe command line or inside ascript), the label (used tolabel the tool in theArcCatalog tree or theArcToolbox window), and adescription for the tool aredisplayed.

The default stylesheets areapplied if the Stylesheet textbox is empty. The location forthe default stylesheets is\Program Files\ ArcGIS\Desktop\ArcToolbox\Stylesheets on the drivewhere you installed ArcGIS.

2. Click OK.

See Also

See ‘Changing the name, label, anddescription for your tools’ in thischapter for more information onmodifying the properties of a toolyou have created.

See Also

See ‘Setting a modified stylesheetfor a tool’ in this chapter forinformation on changing thestylesheet used by a tool you havecreated.

See Also

For information on relative pathnames, see ‘Storing relativepathnames’ in this chapter.

See Also

For information on the Help tab,see ‘Referencing a compiled helpfile’ in this chapter.

Tip

Changing the properties oftoolsYou cannot change the properties ofsystem tools, even if they are copiedto a writable toolbox. You canchange the properties for a tool youhave created if the toolboxcontaining the tool is writable.

2

1

Page 146: Geoprocessing in ArcGIS: ArcGIS 9

140 GEOPROCESSING IN ARCGIS

Creating a new model

1. Right-click the toolbox intowhich you want to create anew model, point to New, andclick Model.

A new model is created in thetoolbox with a default name,and a ModelBuilder windowis opened so you can buildyour model.

Creating modelsand addingscriptsYou can use the tools containedwithin the system toolboxes toperform your geoprocessingtasks. However, when youknow you will need to repeatthe use of the same tool orsequence of tools many times,either on the same input dataand refining parameters or ondifferent input data, you shouldcreate a model or add a script.Doing so enables you toperform multiple operations atone time, rather than performingthem one by one.

Models run processes that youhave built and strung togetherin a ModelBuilder window. u

A created model inside a toolbox and its ModelBuilder window

See Also

For information on buildingmodels see Chapter 8, ‘Introducingmodel building’, and Chapter 9,‘Using the ModelBuilder window’.

See Also

For information on creatingtoolboxes, see Chapter 4, ‘Workingwith toolboxes’.

1

Page 147: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 141

Adding a script to atoolbox

1. Right-click the toolbox ortoolset into which you want toadd a script, point to Add,and click Script.

2. Type a Name for the script.

3. Type a Label for the script.

4. Optionally, type a Descriptionfor the script.

5. Optionally, click the Browsebutton to change the defaultstylesheet used for the tool.

If the Stylesheet text box isempty, the default stylesheetis used. See ‘Setting amodified stylesheet for a tool’in this chapter for moreinformation on stylesheets.

6. Optionally, check Storerelative path names—insteadof absolute paths—to storerelative pathnames. See‘Storing relative pathnames’in this chapter for moreinformation.

7. Click Next. u

Scripts are useful for perform-ing batch processing and canbe run standalone or frominside a toolbox. After adding ascript to a toolbox, you candefine the parameters forvariables that are set as systemarguments—for example,sys.argv [ ] in Python—insidethe script, so the user of thescript will be able to set valuesfor these parameters in thescript’s dialog box. See ‘Settingscript parameters’ in thischapter for information on theprocess of defining parameters.

In the first panel of the ScriptWizard, the options that mustbe specified are the name andthe label for the script. Thename is used when the script isrun at the command line or frominside another script. Thereshould be no spaces in thename. The label is the displayname for the script and maycontain spaces. u

See Also

You do not have to create a scriptfrom scratch. You can build amodel, then export the model to ascript. See ‘Exporting a model to ascript’ in Chapter 9.

See also Writing GeoprocessingScripts With ArcGIS for moreinformation on writing scripts.

2

3

4

5

6

7

1

Page 148: Geoprocessing in ArcGIS: ArcGIS 9

142 GEOPROCESSING IN ARCGIS

8. Click the Browse button, thenclick the Look in dropdownarrow and navigate to thelocation of your script.

9. Click the script file and clickOpen.

Note that you can type thename of a script file that doesnot exist—with the appropri-ate extension for the scripttype. The wizard will ask ifyou want to create it.

10. Optionally, check Showcommand window whenexecuting script to viewmessages that are not pipedthrough the geoprocessor ina command window.

Messages that are pipedthrough the geoprocessorwill display in the messagesection of the CommandLine window.

11. Click Next. u

In the second panel of thewizard you add the script thatwill be added to the toolbox.

A script is a simple text file thatcan be created in any texteditor. It can be written in anyCOM-compliant scriptinglanguage, such as Python,JScript, or VBScript.

Note that the script you addcan also be an AML script or anEXE file.

Refer to Writing GeoprocessingScripts With ArcGIS to learnmore about writinggeoprocessing scripts.

If you are sent a script, you canadd it to a toolbox and run it,provided all values for variablesare hard coded within the scriptand paths to input data arecorrect. u

See Also

See ‘Editing a custom model orscript’ in this chapter for informa-tion on how to edit the contents ofmodels or scripts.

8

Q

W

Page 149: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 143

The last panel of the wizardallows for the setting ofparameters and their properties.

If all values set for variableswithin the script are hardcoded—for example, a path isspecified as the value for aninput data parameter—you donot need to set any parameters.If there are variables set assystem arguments (sys.argv [ ])within the script, this meansthat they need to be defined asparameters within the Propertiesdialog box of the script so theuser of the script can specifythe value for these parameters.Without defining the param-eters that will appear on thescript’s dialog box, the scriptwill not run. If parameters needto be defined, see ‘Settingscript parameters’ in thischapter for information on thisprocess.

12. If you need to defineparameters, you can do soin this panel of the wizard,then click Finish.

Your script is added to thetoolbox and will run whenyou open its dialog box,supply any values forparameters, then click OK.

E

Page 150: Geoprocessing in ArcGIS: ArcGIS 9

144 GEOPROCESSING IN ARCGIS

Editing a custom modelor script

1. Right-click the model or scriptand click Edit.

If the tool is a model, theModelBuilder window willopen, so you can edit thecontents of the model.

If the tool is a script, the scriptwill be opened in its nativeapplication, so you can editthe code.

Tip

Editing system tools

Models and scripts installed withthe system cannot be edited.

See Also

If your tools are displaying asshown, with a red x over them,there could be a tool (a model orscript) referenced in the model thatno longer exists in its location ondisk, or the DLL of a COM toolcould be unregistered. You’ll alsosee a red x if a parameter name ina model or a script that is added tothe model has changed. See‘Repairing a model’ in Chapter 9for information on fixing brokenmodels.

1

Page 151: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 145

Setting modelparameters

1. Right-click the created modeland click Properties.

2. Click the Parameters tab.

A list of model parameters isdisplayed if any have alreadybeen set.

3. Click Add to add variables asmodel parameters to the list.

4. Click the variables you wantto add as model parameters;press Ctrl to select more thanone variable.

5. Click OK.

The variables are added asmodel parameters to the list.

6. Click OK on the propertiesdialog box.

7. Right-click the model andclick Open to see the modelparameters that have beenset on the model’s dialogbox.

See Also

See ‘Creating a new model’ earlierin this chapter and Chapter 9,‘Using the ModelBuilder window’,for information on building modelsand exposing parameters asvariables so they can then be set asmodel parameters for a model’sdialog box.

SettingparametersOnce you have created yourmodel, you can set variables asmodel parameters so theparameters display on yourmodel’s dialog box. In theprocess of adding a script to atoolbox, you can also setparameters. Note that in theprocess of setting parametersfor a script, the parameters andtheir properties are defined.Parameters are already definedfor a model as they inherit theproperties of the variable.

The user of your model or scriptwill specify values for setparameters in the model’s or thescript’s dialog box.

For a model, there are two waysto set parameters: via themodel’s properties dialog box orwithin the ModelBuilderwindow after building yourmodel. See ‘Working withvariables’ in Chapter 9 for u

1

7

6

3

4

5

2

Page 152: Geoprocessing in ArcGIS: ArcGIS 9

146 GEOPROCESSING IN ARCGIS

Setting script parameters

1. Right-click the script andclick Properties.

2. Click the Parameters tab.

3. Type a display name for thefirst parameter.

In this example, Input Folderis the display name for theparameter. This name willappear as the parametername in the script’s dialogbox.

4. Click the Data Type cell forthe parameter, then click thedropdown list and select theappropriate data type.

In this example, the appropri-ate data type is a folder. Allother data types will befiltered from the Browsedialog box for the InputFolder parameter. u

information on setting variablesas model parameters within theModelBuilder window.

If you have received a scriptand information on its param-eters and their properties, it isan easy task to define and setparameter information for ascript.

If the values for variables insideyour script are set as systemarguments (sys.argv [ ]), youmust define the parameters thatcorrespond to these systemarguments so the user canspecify the values for theseparameters inside the script’sdialog box.

For example, the value for theinput workspace may have beenset as a system argument in thescript as follows:

gp.workspace = sys.argv [1]

rather than a hard-coded path:

gp.workspace =“C:\\Workspace” u

See Also

See Writing Geoprocessing ScriptsWith ArcGIS for information onwriting scripts. 23

4

1

A Python script showing values for variables set as systemarguments (sys.argv [ ])

Page 153: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 147

5. In the Parameter Propertiessection, click the cell next tothe property Type and selectthe appropriate type for theparameter, either Required,Optional, or Derived.

In the example, it is requiredto specify an input folder.

6. Click the cell next to theproperty Direction and clickeither Input or Output for thedirection of the parameter.

In the example, the param-eter Input Folder is an inputto the tool, so its directionproperty should be set asInput.

7. Click the cell next to theproperty MultiValue and clickYes or No, depending onwhether the parametershould accept multiplevalues or not.

In the example, the param-eter Input Folder onlyaccepts one value, a folder,so this property should be setto No.

8. Set a Default value if desired.

In this example, the defaultvalue is set toC:\GP_Tutorial\San_Diego.This value will be displayedby default in the dialog box ofthe tool as the Input Folderparameter’s value. u

This is for the user to be able tospecify the input workspaceinside the script’s dialog box.

The order you add the param-eters must match the order ofthe arguments in the script.Each parameter has a set ofproperties associated with it:

Display Name—The name yousee for the label of the param-eter in the script’s dialog box.

Data Type—The data typeaccepted by the parameter. Forinstance, you might only wantraster datasets to be acceptedfor an input parameter. TheBrowse dialog box for theparameter will filter out all otherdata types when you set thedata type property for theparameter to be Raster Dataset.

Type—This property defineswhether the parameter isrequired, optional, or derived.Required parameters require aninput value from the user.Optional parameters do notrequire a value from the user.Set output parameters to bederived if the tool updates theinput to the tool or if you u

See Also

See Chapter 8 of WritingGeoprocessing Scripts WithArcGIS for information on settingparameter values.

5

6

7

8

Page 154: Geoprocessing in ArcGIS: ArcGIS 9

148 GEOPROCESSING IN ARCGIS

9. If a default value is not set,you can specify to display thevalue set in the EnvironmentSettings dialog box. Click thecell next to the propertyEnvironment and choose theappropriate environmentsetting from the dropdownlist.

10. If only certain parametervalues are allowed, you canset a domain.

Click the cell next to theproperty Domain and clickthe Domain button.

11. Check either Coded Value orRange, depending onwhether valid values are arange or specific values.

For a range, specify the startand end values. If the user ofthe tool specifies a valueoutside this range, theparameter value will becomeinvalid. For coded values,type the valid values onebelow the other in the textbox.

In the example, a domain isnot necessary.

12. Click OK on the Domaindialog box. u

need an output for use in amodel but you don’t want theoutput parameter to show in thescript’s dialog box.

Direction—This propertydefines whether the parameteris an input or an output.

MultiValue—If you need yourparameter to be able to handlean array of values rather thanjust one value, you should setthe MultiValue property to Yes.For example, you might want toclip multiple feature classes.The Data Type would beFeature Class, and by makingthe parameter support multiplevalues, you allow the user tospecify multiple input featureclasses.

Default—You can set up adefault value for the parameterthat will show up when thescript’s dialog box is opened,such as the path to the inputdata for the input data param-eter or a value for the clustertolerance parameter. If youdon’t specify a value for theDefault property, the parametervalue will be blank when thescript’s dialog box is opened. Ifyou specify a value for thisproperty, the Environmentproperty will be disabled. Clearthe value set for the Defaultproperty to enable the Environ-ment property. u

9

Q

W

E

Page 155: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 149

13. If the parameter isdependent on anotherparameter for information,click the cell next to theDependency property andselect the parameter that it isdependent on.

In the example, the InputFolder is the first parameterentered, so there are noother parameters availableyet in the dropdown list.

14. Continue adding parametersand setting their propertiesuntil all necessaryparameters have beendefined.

15. Click OK.

Environment—You can set thevalue for the parameter todisplay whatever is set in theEnvironment Settings dialogbox. If a value is set for thisproperty, the Default property isdisabled and the Coded Valuedomain check box is disabled.Setting this property to NONEwill enable the Default propertyand allow a Coded Valuedomain to be set again.

Domain—Set the domainproperty to limit the number orrange of acceptable parametervalues. For instance, acceptablevalues may be 1 of 3 values, orthere may be a range ofacceptable values for aparameter.

Dependency—You can specifythat a parameter is dependenton a value being specified foranother parameter. For example,a field parameter needs to knowabout the input feature classbefore it can be populated withthe fields from the input. If theoutput from a script tool isderived, where the output is thesame as the input, the outputtype needs to be set as derivedand the output parameter valueset to have a dependency onthe input parameter value.When a value is entered for theinput parameter on the tool’sdialog box, the value is auto-matically also used for theoutput parameter.

R

Y

Page 156: Geoprocessing in ArcGIS: ArcGIS 9

150 GEOPROCESSING IN ARCGIS

Changing toolpropertiesSystem tools are read-only sotheir properties cannot bemodified. You can modify oradd additional properties foryour own tools, provided theyreside in writable toolboxes.

Properties you can modifyinclude the name, label, anddescription for the tool; thestylesheet used; whetherrelative pathnames should bestored; the source for a script;and parameters available in thetool’s dialog box. u

Changing the name, label,and description for yourtools

1. Right-click the tool (model orscript) and click Properties.

Note that the toolbox contain-ing the tool must not be read-only. You cannot alter theproperties of tools in read-only toolboxes.

2. Click the General tab.

3. Click the Name text box andtype a new name for the tool.

The name is used when thetool is run at the commandline or inside a script.

Note that spaces are notallowed in the name.

4. Click the Label text box andtype a new label for the tool.

The label is the display namefor the tool. Spaces in thelabel are allowed.

5. Click the Description text boxand type a description for thetool.

The description appears inthe Help panel in the tool’sdialog box.

6. Click OK on the propertiesdialog box.

Tip

Accessing the propertiesdialog box for a modelYou can also access the propertiesdialog box for a model inside theModelBuilder window by clickingModel on the Main menu, thenclicking Model Properties.

See Also

See Chapter 6 for information onthe Environments tab of a tool’sproperties dialog box.

3

5

6

4

2

1

See Also

See ‘Referencing a compiled Helpfile’ in this chapter for informationon the Help tab.

Page 157: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 151

Setting a modifiedstylesheet for a tool

1. Copy the default stylesheetor stylesheets(MdDlgContent.xsl,MdDlgHelp.xsl, or both) fromyour ArcGIS\ArcToolbox\Stylesheets folder to thelocation of the toolboxcontaining the tool. If thetoolbox is located inside ageodatabase, copy thestylesheet to the location ofthe geodatabase.

2. Open the copied stylesheetsin Notepad or any editor andmodify the contents.

In the example, the defaultbackground image isreplaced by a graphic of themodel diagram. Only thename of the graphic isspecified because thegraphic is located in thedefault location: \Documentsand Settings\username000\Application Data\ESRI\ArcToolbox\Dlg (on WindowsNT, the username000 folderis located on\WINNT\Profiles). If you onlyspecify the name, users ofyour tool will have to placethe graphic in the Dlg folderon their machine. Alterna-tively, a hard-coded path canbe specified.

3. Right-click the tool and clickProperties. u

Stylesheets are used to controlthe properties of items insidetool dialog boxes. The defaultstylesheets are usually suffi-cient for most purposes, butyou may want to customizesome of the properties, forexample, by changing thebackground image used or byadding text.

The MdDlgContent.xsl defaultstylesheet contains theproperties for the contentspanel. It can be found in yourArcGIS\ArcToolbox\Stylesheetsfolder. To override it, first makea copy of MdDlgContent.xsllocally, then proceed to modifythe contents of the copiedstylesheet. You can simplyopen the .xsl file in Notepad tomodify its contents.

Note that the defaultstylesheets are used if theStylesheet text box on theGeneral tab of the Propertiesdialog box for the tool is empty.

The main stylesheet you’ll wantto customize isMdDlgContent.xsl. However,you can also customizeMdDlgHelp.xsl, which is thestylesheet applied to the Helppanel of the tool’s dialog box. u

2

3

Page 158: Geoprocessing in ArcGIS: ArcGIS 9

152 GEOPROCESSING IN ARCGIS

4. Click the General tab.

5. Click the Browse button nextto the Stylesheet text box.

6. Click the Look in dropdownarrow and navigate to thelocation of the Contentsstylesheet.

7. Click the .xsl file and clickOpen.

If you want to add a customHelp stylesheet also, type asemicolon, then the path tothe Help stylesheet.

8. Check Store relative pathnames, instead of absolutepaths.

9. Click OK on the ModelProperties dialog box. u

9

4

58

When entering the customstylesheets into the Stylesheettext box, there is an order forthe placement of thestylesheets. If you want tooverride bothMdDlgContent.xsl andMdDlgHelp.xsl, type the path toeach alternative stylesheet,separating them with a semico-lon in the tool’s propertiesdialog box. The path to theContent stylesheet must beplaced first.

If you only want to apply acustomized Help stylesheet,simply place a semicolon inplace of the Content stylesheetand the defaultMdDlgContent.xsl will be used.

When just the Contentstylesheet is modified, asemicolon is not necessary tomake sure the defaultMdDlgHelp.xsl is applied. u

See Also

See the appendix for moreinformation on customizing yourdialog boxes by modifying thedefault stylesheets.

Page 159: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 153

10. Right-click the tool and clickOpen to see the changesyou have made to the dialogbox.

By placing your modifiedversion of the stylesheet atthe same level as thetoolbox and by settingrelative paths for your tool, ifyou send the folder—containing the tool, the datathe tool requires, and thestylesheet—to someoneelse, your custom stylesheetwill be applied when theuser of your tool opens thetool’s dialog box. Oneexception is any graphic thatwill display on the tool’sdialog box. These have to beplaced in the correct locationon the receiver’s machine,either in the Dlg folder, ifonly the name is specified inthe XSL file, or in the exactlocation specified in the XSLfile.

Q

See Also

See ‘Sharing your geoprocessingwork’ in Chapter 3 for moreinformation on sending your work.

See Also

See ‘Storing relative pathnames’ inthis chapter for information onsetting relative paths for yourtools.

Page 160: Geoprocessing in ArcGIS: ArcGIS 9

154 GEOPROCESSING IN ARCGIS

Storing relativepathnames

1. Right-click the tool and clickProperties.

2. Click the General tab.

3. Check Store relative pathnames, instead of absolutepaths.

4. Click OK on the propertiesdialog box.

1

2

3

4

See Also

See ‘Sharing your geoprocessingwork’ in Chapter 3 for moreinformation on sharing tools.

When you add data to a model,add a script to a toolbox, orspecify a different stylesheet touse for a tool, references tothese sources of information arestored with the tool. The nexttime you edit or open the tool,the source information islocated based on the refer-ences. If the tool can’t find asource of information it needs,you’ll have to locate the sourceyourself or ignore the reference,in which case you may havedifficulties running the tool.

If you plan on distributing yourtools to others, they’ll needaccess to the sources ofinformation they reference. Tomake it easier to distribute allinformation sources with yourtool, you can store relativepathnames to sources ofinformation. All pathnameswithin the tool will be storedrelative to the toolbox contain-ing the tool. For example, if youset relative pathnames for yourtool, then distributed it alongwith the data in the samedirectory, the references storedin the tool would be correctregardless of their placement ondisk. u

Page 161: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 155

Changing the source fora script

1. Right-click the script andclick Properties.

2. Click the Source tab.

3. Click the Browse button nextto the Script File text box.

4. Click the Look in dropdownarrow and navigate to thelocation of the script youwant to add.

5. Click the script and clickOpen.

6. Click OK on the propertiesdialog box.

When a script is initially addedto a toolbox, the name andlocation of the script that willrun is specified.

There are many reasons youmight want to alter the name orlocation of a script file. If youare sent a toolbox containing ascript and the script was notsaved with relative paths, thepath to the script will need tobe updated to point to thelocation of the script on yourmachine. Alternatively, renam-ing the script that the toolreferences on disk will mean itwill have to be updated in thetool’s Properties dialog box. u

See Also

See Writing Geoprocessing ScriptsWith ArcGIS for information onwriting scripts.

See Also

See ‘Adding a script to a toolbox’earlier in this chapter to learn howto add a script to a toolbox.

1

2

3

6

Page 162: Geoprocessing in ArcGIS: ArcGIS 9

156 GEOPROCESSING IN ARCGIS

Removing parameters fora model

1. Right-click the model andclick Properties.

2. Click the Parameters tab.

3. Click the model parameteryou want to remove andeither press Delete on thekeyboard or click the Re-move button.

4. Click OK.

As the author of a script or amodel, in the Parameters tabyou can add parameters,remove them, or change theirorder.

As the user of a tool, you canremove, add, and change theorder of parameters. Removinga parameter for a model orscript, however, will remove theparameter from the model or thescript’s dialog box. If the modelor script depends on user inputfor the value of the removedparameter, it will not run. u

See Also

See ‘Setting parameters’ earlier inthis chapter for information onsetting parameters for scripts ormodels.

See Also

You can also set and removeparameters for a model inside theModelBuilder window. It issometimes easier to set modelparameters in this way, as you cansee all the processes that make upthe model, making it easier todecide which variables should beset as model parameters. SeeChapter 9, ‘Using theModelBuilder window’, for moreinformation.

1

2

3

4

Page 163: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 157

Removing parameters fora script

1. Right-click the script andclick Properties.

2. Click the Parameters tab.

3. Click to the left of the displayname for the parameter youwant to remove, then pressDelete on your keyboard.

The parameter is removed.

4. Click OK.

1

2

3

4

Page 164: Geoprocessing in ArcGIS: ArcGIS 9

158 GEOPROCESSING IN ARCGIS

Changing the order ofparameters

1. Right-click the tool (either amodel or a script) and clickProperties.

2. Click the Parameters tab.

3. Click the row for the param-eter you want to reorder.

4. Click the move up or movedown button depending onwhere you want to positionthe parameter in the dialogbox for your tool.

5. Click OK on the propertiesdialog box.

6. Right-click the tool and clickOpen to see the changes thathave been made to the orderof parameters on the tool’sdialog box.

The order of parametersdepends on the desiredposition for parameters on thedialog box of the model orscript. Usually, input parametersare at the top, then outputparameters, and optionalparameters are at the bottom ofthe dialog box.

Changing the order of param-eters for a model so theydisplay in your chosen positionon the model’s dialog box willnot have an adverse effect onthe execution of the model. Ifyou change the order ofparameters on the Parameterstab of a script, you must changethe order of system arguments(sys.argv [ ]) inside your scriptto mimic the order set in theParameters tab; otherwise, yourscript will not execute correctly.

See Also

See ‘Setting parameters’ earlier inthis chapter for information onsetting parameters for scripts andmodels.

See Also

See ‘Adding a script to a toolbox’earlier in this chapter to learn howto add a script to a toolbox.

1

6

3

2

4

Page 165: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 159

Addingdocumentation totoolsIn a similar way to storingmetadata for a dataset, yougenerally have documentationyou would like to store along-side your tools.

The entries in the GeneralInformation section of theDocumentation Editor willappear as the tool’s metadata.The abstract provides aparagraph of text describing thetool’s contents. Keywords canbe used when searching for atool in ArcCatalog. Authorinformation is fundamental ifyou want users of your tool tobe able to contact you, and youshould document any con-straints as to the use of thetool.

Entries in the Help section ofthe Documentation Editorappear in the Help pageaccessed via the ArcToolboxwindow or the tool’s dialog box.You can include summaryinformation, describing whowrote the tool and what the tooldoes; an illustration; usagetips; documentation for eachtool parameter; and examplecode for running the tool fromthe command line or inside ascript. u

Adding documentation toa tool via the ArcToolboxwindow

1. Right-click the tool and clickEdit Documentation.

The Documentation Editoropens so you can adddocumentation to your tool.

Adding documentation toa tool via the ArcCatalogtree

1. Click the tool in theArcCatalog tree, then clickthe Metadata tab.

2. Click the Edit Metadatabutton on the Metadatatoolbar.

The Documentation Editoropens so you can adddocumentation to your tool.

1

1 2

Page 166: Geoprocessing in ArcGIS: ArcGIS 9

160 GEOPROCESSING IN ARCGIS

You can add an abstract todescribe what the tool does.The abstract will appear whenthe tool’s help is accessed viathe metadata tab and also as thedescription in the Help panel ofthe tool’s dialog box. It will takeprecedence over any text addedas the tool’s description in theGeneral tab of the tool’sProperties dialog box.

Keywords can make it easy tofind tools using either theArcCatalog Search tool or theSearch tab of the ArcToolboxwindow. If your tools are spreadout on disk in differenttoolboxes, you can simplysearch for all tools with thesame keyword.

Keywords you might addinclude:

• The tool name

• The supported data types

• The name of the toolbox ortoolset the tool belongs to

• Special words associatedwith the tool u

Adding an abstract forthe tool’s Help page

1. Open the DocumentationEditor.

2. Click Abstract in the GeneralInformation section.

3. Enter a paragraph of text forthe abstract.

4. Click Finish.

2 3

4

Tip

Writing documentation fortoolsUse the documentation written forthe system tools as a guide to helpyou write documentation for yourown tools.

Adding keywords

1. Open the DocumentationEditor.

2. Click Keywords.

3. Click the first row and enterthe name for the first key-word.

4. Continue adding keywordsas appropriate, then clickFinish.

2 3

4

Page 167: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 161

If you are distributing yourtool, it is important to documentyour contact details. Usersmight, for instance, want tocredit your work or contributeinformation that might increasethe usefulness of your tool.

You can also list any con-straints of the tool. Constraintsmight be related to the properuse or distribution of the tooland could also include aliability statement. u

Adding informationabout constraints

1. Open the DocumentationEditor.

2. Click Constraints in theGeneral Information section.

3. Type information regardingthe constraints of using thetool.

4. Click Finish.

Adding informationabout the author

1. Open the DocumentationEditor.

2. Click Author in the GeneralInformation section.

3. Enter your name, organiza-tion, and position.

4. Enter your address details.

5. Click Finish.

See Also

See ‘Viewing documentation fortools’ in this chapter for informa-tion on viewing your created Helppage.

45

32

2

4

3

See Also

For information on documentingtoolboxes and toolsets, see ‘Addingdocumentation to toolboxes’ inChapter 4.

Page 168: Geoprocessing in ArcGIS: ArcGIS 9

162 GEOPROCESSING IN ARCGIS

In the Help section of theDocumentation Editor, you canadd a summary describing whatthe tool does. Summaryinformation can take the form ofparagraphs, bullet points,hyperlinks, illustrations,subsections, and indented text.This information is displayed inthe Help page accessed via thetool’s context menu in theArcToolbox window.

Add paragraphs of text todescribe a tool’s behavior, andbullet points to add lists ofinformation. Hyperlinks allowthe user of your Help page toclick the link to open anotherdocument. It could be anotherHelp page, a graphic, or a Webpage. Hyperlinks allow relatedinformation to be accessiblefrom a Help page. Graphics helpto illustrate the informationgiven in the text. Subsectionsare expandable sections of textthat can include any items, suchas illustrations, bullet points,paragraphs, and hyperlinks.They help to order the informa-tion in your Help page. Indentsare useful for repositioning textor graphics in the Help page.They can be nested inside otherindents in order to nudge text orgraphics away from the left sideof the Help page. u

Adding a summary

1. Open the DocumentationEditor.

2. Click Summary.

3. Click the desired button,depending on what informa-tion you want to add.

Click Paragraph, then clickthe Paragraph item in theContents list and type text forthe paragraph on the rightside of the DocumentationEditor. Click Bullet to insert abullet point. Click Hyperlink toinsert a link to anotherdocument—for example,another Help page, a Webpage, or a graphic. ClickIllustration to insert a graphic.Click Subsection to add anexpandable subsection, andclick Indent, then anotherbutton, such as Paragraph, toinsert indented text.

4. Click Finish.

2 3

4

Page 169: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 163

Adding documentationfor parameters

1. Open the DocumentationEditor.

2. Click Parameters.

3. Expand the parameter forwhich you want to adddocumentation and clickCommand Reference orDialog Reference, depend-ing on whether you wantyour help to display in theHelp page or the tool’s dialogbox.

4. Click the desired button,depending on what informa-tion you want to add.

Click Paragraph, then clickthe Paragraph item in theContents list and type text forthe paragraph on the rightside of the DocumentationEditor. Click Bullet to insert abullet point. Click Hyperlinkto insert a link to anotherdocument. Click Illustration toinsert a graphic. Click Codeto add example code. ClickSubsection to add anexpandable subsection, andclick Indent, then anotherbutton, such as Paragraph, toinsert indented text.

5. Click Finish.

The parameters for whichvalues are supplied on thedialog box of the tool can bedocumented to provideinformation about each one.This documentation will appearin the Help page in the Com-mand line syntax section andthe Scripting syntax section ifyou add documentation underthe Command Referencesection. It will appear when theuser of your tool clicks the Helppanel in the tool’s dialog box,then clicks the documentedparameters in the dialog box ifyou add documentation underthe Dialog Reference section.Parameter documentation cantake the form of paragraphs,bullet points, hyperlinks,illustrations, subsections, andindented text. This informationis displayed in the Help pageaccessed via the tool’s contextmenu in the ArcToolboxwindow. u

2 3 4

5Tip

Reordering contentThe order of the Contents list in theDocumentation Editor is reflectedin the Help page. To reorder thecontents, click an item, forinstance, Paragraph, in theContents list and click the down orup arrow to reposition the item inthe desired location.

Page 170: Geoprocessing in ArcGIS: ArcGIS 9

164 GEOPROCESSING IN ARCGIS

Adding usage tips

1. Open the DocumentationEditor.

2. Click Usage Tips.

3. Click the desired button,depending on what informa-tion you want to add.

Click Paragraph, then clickthe Paragraph item in theContents list and type text forthe paragraph on the rightside of the DocumentationEditor. Click Bullet to insert abullet point. Click Hyperlink toinsert a link to anotherdocument—for example,another Help page, a Webpage, or a graphic. ClickIllustration to insert a graphic.Click Code to add examplecode. Click Subsection to addan expandable subsection,and click Indent then anotherbutton, such as Paragraph, toinsert indented text.

4. Click Finish.

In the Help section of theDocumentation Editor, you canadd usage tips that can provideuseful information to help theuser run your tool. Usage tipinformation can take the form ofparagraphs, bullet points,hyperlinks, illustrations,subsections, and indented text.This information is displayed inthe Help page accessed via thetool’s context menu in theArcToolbox window.

Add paragraphs of text todescribe a tool’s behavior, andbullet points to add lists ofinformation. Hyperlinks allowthe user of your Help page toclick the link to open anotherdocument. It could be anotherHelp page, a graphic, or a Webpage. Hyperlinks allow relatedinformation to be accessiblefrom a Help page. Graphics helpillustrate the information givenin the text. Subsections areexpandable sections of text thatcan include any items, such asillustrations, bullet points,paragraphs, and hyperlinks.They help to order the informa-tion in your Help page. Indentsare useful for repositioning textor graphics in the Help page.They can be nested inside otherindents to nudge text orgraphics away from the left sideof the Help page. u

2 3

4

Page 171: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 165

Illustrations can be powerfulaids that can complement yourtool summary and help explainwhat the tool does. You can adda name that will display whenthe mouse pointer is held overthe illustration. The namedescribes the contents of theillustration. You can also add acaption, a single paragraph oftext, that will display under-neath the illustration. u

Adding an illustration

1. Open the DocumentationEditor.

2. Click Illustration.

3. Type the path to the illustra-tion or click the Browsebutton, click the Look indropdown arrow in the Opendialog box, and navigate tothe location of the illustrationon disk. Click the illustrationand click Open.

4. Type a name that describesthe contents of theillustration.

The name will appear whenthe cursor is held over theillustration.

5. Type a caption for theillustration.

The caption will displayunder the illustration.

6. Click Finish.

2 3 4 5

6

Tip

Previewing Help filesAs you are adding documentation,click the Preview button in theDocumentation Editor to see howyour help will display in HTMformat.

Page 172: Geoprocessing in ArcGIS: ArcGIS 9

166 GEOPROCESSING IN ARCGIS

Adding a command lineexample

1. Open the DocumentationEditor.

2. Click Command Example.

3. Type the code to show anexample of how to run thetool at the command line.

4. Click Finish.

Adding a script example

1. Open the DocumentationEditor.

2. Click Script Example.

3. Type the code to show anexample of how to run thetool from within a script.

4. Click Finish.

See Also

See ‘Setting parameters’ earlier inthis chapter for information onsetting variables as parameters sothe parameters display on yourtool’s dialog box. Values for setparameters can be entered via thetool’s dialog box, at the commandline, or within a script.

In addition to running via adialog box, your tools can berun from a command line or ascript. You can add an exampleto show how to run the tool atthe command line or from withina script. u

32

4

2 3

4

Page 173: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 167

Exporting tooldocumentation to anHTML file

1. Right-click the tool and clickProperties.

2. Click the Help tab.

3. Click Export.

4. Click the Save in dropdownarrow and navigate to thelocation into which you wantto save the HTML file.

5. Type a File name and clickSave.

6. Click OK on the tool’sproperties dialog box.

The documentation you add toa tool using the DocumentationEditor can be exported to anHTML file.

Doing so enables you to useyour created HTML files whencompiling a Help file (.chm). u

See Also

See ‘Referencing a compiled Helpfile’ in the task that follows forinformation on compiling Helpfiles.

1

2

3

4

5

Tip

Alternative export optionsClick the Metadata tab for a tool,then click Export metadata.Numerous export formats areavailable. Save to XML to alter theinformation between the XML tags,then import the XML file with theImport Metadata button to updatethe documentation for a tool.

Page 174: Geoprocessing in ArcGIS: ArcGIS 9

168 GEOPROCESSING IN ARCGIS

Referencing a compiledHelp file

1. Right-click the tool and clickProperties.

2. Click the Help tab.

3. Check Reference a compiledhelp (CHM) file for the toolhelp.

4. Browse to the location of theCHM file or type the path.

5. Type a Help Context thatcorresponds to a topic in theCHM file if you want a certaintopic to be displayed bydefault when the help for thetoolbox is opened.

6. Click OK.

If you have a compiled Help file(.chm), your tools can referenceit. A complied Help file is usedfor viewing a snapshot of atool’s documentation.

By providing the Help Context(the HTML topic ID), when theuser of your tool clicks Help onthe tool’s context menu, thehelp topic associated with theHelp Context ID in the CHM filewill be displayed. Help writtenin the tool’s DocumentationEditor is always stored with thetoolbox. However, the CHM filetakes precedence over this help.

If you do not supply a HelpContext ID or you supply anincorrect Help Context ID, theCHM file will display with itsdefault page.

There are many sources ofinformation on creating andcompiling HTML Help, or CHMfiles. A good starting point isthe ‘Microsoft HTML Help 1.4SDK’ topic available from theMicrosoft library. Type “http://msdn.microsoft.com” in yourWeb browser and click the linkto the Library. In the Library,you’ll find information oncreating and compiling CHMfiles listed under ‘Visual Toolsand Languages, HTML Help’.

2

3

4

5

6

1

Page 175: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 169

Viewingdocumentationfor toolsA quick way to learn about aparticular tool is to view thetool’s documentation. You canview documentation for allsystem tools and for customtools for which you have addeddocumentation.

Each parameter within a tool’sdialog box can have documen-tation associated with it,helping the user provide correctvalues for parameters. u

Viewing help forparameters on a tool’sdialog box

1. Right-click the tool and clickOpen.

A short description for thetool is displayed in the Helppanel.

2. Click any parameter on thedialog box.

Help for the parameter willdisplay in the Help panel.

3. Click OK.

See Also

See ‘Adding documentation totools’ earlier in this chapter forinformation on documenting yourown tools.

1

2

3

Page 176: Geoprocessing in ArcGIS: ArcGIS 9

170 GEOPROCESSING IN ARCGIS

Viewing Help for a toolvia its dialog box

1. Right-click the tool and clickOpen.

2. Click the Help button at thetop of the Help panel to viewHelp for the entire tool.

When you view Help forsystem tools in this way, theDesktop Help System isopened and Help for theparticular system tool isdisplayed.

When you view Help for yourown tools, it will display in aWeb browser.

All documentation added to theHelp section of the Documenta-tion Editor will display when theHelp for a tool is accessedthrough the ArcToolboxwindow or through the tool’sdialog box.

Via the ArcToolbox window orthe tool’s dialog box, summaryinformation, describing whowrote the tool and what the tooldoes; an illustration; usagetips; documentation for eachtool parameter; and examplecode for running the tool fromthe command line or inside ascript can be viewed.

There are three ways you canaccess documentation writtenin the Help section of theDocumentation Editor—via thetool’s dialog box, the Helpoption on the context menu ofthe tool, or the online Helpsystem. u

1

2

Page 177: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 171

Viewing help for a tool inthe ArcToolbox window

1. Right-click the tool in theArcToolbox window andclick Help.

The same documentationaccessible from the Helpbutton on the tool’s dialogbox is displayed.

1

Viewing help for a toolvia the online Helpsystem

1. Click Help on the Mainmenu of the ArcGIS Desktopapplication you are runningand click ArcGIS DesktopHelp.

2. Click the Contents tab anddouble-click theGeoprocessing/ArcToolboxbook to view its contents.

3. Double-click theGeoprocessing tool refer-ence and navigate to thebook you are interested in tosee a list of the topics in thatcategory.

4. Click the topic you want toread to display it.

5. Click expand all to open allsections within the topic atone time.

Tip

Using the online HelpsystemYou can use the Contents tab tonavigate to the Help file for aparticular tool, or you can searchthe Index for specific tools. You canalso use the Search tab to look upHelp topics that have specificwords or phrases.

See Also

See Using ArcCatalog and UsingArcMap for more information onusing the ArcGIS Desktop onlineHelp system.

Tip

Using the online HelpsystemThe online Help system is useful forbrowsing through tool documenta-tion, but you can also access othergeoprocessing documentationthrough the online Help systemincluding the contents of this book.Click the Extensions book in theContents tab to access help forspecific extensions you might haveinstalled, such as ArcGIS SpatialAnalyst or 3D Analyst.

1

4

5

2Tip

Accessing toolsClick the Open Tool link on a tool’sHelp page to open the tool’s dialogbox.

Page 178: Geoprocessing in ArcGIS: ArcGIS 9

172 GEOPROCESSING IN ARCGIS

Viewing metadata for atool

1. Click the tool in theArcCatalog tree and click theMetadata tab.

Documentation added in theGeneral Information sectionof the Documentation Editorwill display.

1Metadata for a tool can beviewed in the tool’s Metadatatab, via the ArcCatalog tree.Only the information added tothe General Information sectionof the Documentation Editor isdisplayed. You can view anabstract describing what thetool does, keywords that can beused when searching for a toolin ArcCatalog, author informa-tion, and any constraints as tothe use of the tool.

Page 179: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 173

Finding toolsThere are hundreds ofgeoprocessing tools that youcan access, so finding aparticular tool can be a daunt-ing task. There are differentways you can search for toolsto help you to find the tool youare looking for.

One way to search for tools isto search for a toolbox thatcontains a tool you want to use.You may have createdtoolboxes inside subfolders,buried deep within your system.You can use the Searchcapabilities within ArcCatalogto search for toolboxes. u

Finding toolboxes in theArcCatalog tree

1. Click Edit on the Main menuof ArcCatalog and clickSearch.

2. Click the Name & locationtab.

3. To search by name, type allor part of the toolbox nameyou’re looking for into theName text box. Use anasterisk (*) to represent oneor more letters. You can alsotype just an asterisk tosearch for all toolboxes in acertain location.

4. To search by type, scrollthrough the Data type list andclick Toolbox.

5. Click the Search dropdownarrow and click where youwant to search.

6. Click the Browse button;navigate to and click thefolder, database connection,or Internet server in which tostart searching; then clickOpen.

7. Type a name for your searchin the Save as text box.

8. Click Find Now.

The Search is saved in theSearch Results folder and isselected in the ArcCatalogtree.

9. Click Close.

1

6

2 3 8

4 5

9

7

Tip

An alternative way to findtools in ArcCatalogClick the Search tool and click theAdvanced tab. Click the Metadataelement dropdown arrow and clickFull Text. Click the Value input boxand type a word in the tool’smetadata, such as a keyword, thenclick Find Now. All tools that havethe keyword in their metadata willbe located.

Page 180: Geoprocessing in ArcGIS: ArcGIS 9

174 GEOPROCESSING IN ARCGIS

A second way you can searchfor tools is to use theArcToolbox index. If you knowthe name of the tool you arelooking for, this is a quick wayto locate the tool.

A third way you can search fortools is to use the ArcToolboxSearch tab. This is especiallyuseful if you aren’t sure of thetool name you are looking for,but you know the data type youwant to use as input. In thelower example, typing “Cover-age” finds all tools that haveCoverage set as a keyword inthe tool’s documentation.

This method of finding tools isalso useful for locating toolsthat have a different name fromthat which you might be usedto. Keywords associate oldnames for system tools withtheir new names, so if you typethe name of a tool that has beenrenamed, you will be able tolocate the tool you want to use.For example, typing“GreaterThan” would locate theArcGIS Spatial AnalystGreaterThanFrequency tool.

Using the ArcToolboxindex to find tools

1. Click the Index tab at thebottom of the ArcToolboxwindow.

2. If it is known, type the nameof the tool you want to use, orscroll through the list to findthe tool you are looking for.

3. Select the tool, then eitherdouble-click the tool to openits dialog box or click Locateto switch to the list of Favoritetoolboxes and view thelocation of the tool in itstoolbox.

1

2

3

Searching ArcToolbox tofind tools

1. Click the Search tab in theArcToolbox window.

2. Type a word to search fortools.

3. Click Search.

All tools containing that wordare listed.

4. Select a tool, then eitherdouble-click the tool to openits dialog box or click Locateto switch to the list of Favoritetoolboxes and view thelocation of the tool in itstoolbox.

1

23

4

Tip

Searching for system toolsusing the online HelpsystemUse the Search tab to find Helptopics for specific tools.

Page 181: Geoprocessing in ArcGIS: ArcGIS 9

WORKING WITH TOOLSETS AND TOOLS 175

Understanding tool licensing

The system tools that are available for use depend on the ArcGISsoftware product (ArcView, ArcEditor, or ArcInfo) you arelicensed to use. Extension products, such as ArcGIS SpatialAnalyst, give you access to even more tools.

By default, in the ArcCatalog tree you will see all tools, regardlessof whether or not you are licensed to use a particular tool. If youare not licensed to use a tool, a lock icon will appear over the tool.

In the ArcToolbox window, you will not see the tools that you arenot licensed to use by default. If you want to view these tools,right-click the ArcToolbox window and click Show/Hide LockedTools. Tools you are not licensed to use will appear with a lockicon over them.

For documentation on tools that are licensed with each ArcGISsoftware product, type “Quick Reference Guide” in the Search tabof the online Help system and double-click the link to the‘Geoprocessing Commands Quick Reference Guide’.

A lock icon will appear over unlicensed tools. You must havethe appropriate license to run the tool.

When a model is created using tools accessible only with anArcInfo license and the model is edited on a machine that hasArcView or ArcEditor installed, you will see the lock icon overtools in the ModelBuilder window that are not available with thelicense you are using. The appropriate license (ArcInfo in thiscase) is needed for the tools within the model to run.

As with models, if a script is created using tools accessible onlywith an ArcInfo license and the script is run on a machine thathas ArcView or ArcEditor installed, an error will occur whenrunning the script. The appropriate ArcGIS product (ArcInfo inthis case) needs to be installed for the script to run. See thesection on licensing and extensions in Writing GeoprocessingScripts With ArcGIS for information on license handling whenwriting scripts.

Within the ModelBuilder window, lock icons appear over tools that you arenot licensed to use.

Page 182: Geoprocessing in ArcGIS: ArcGIS 9

176 GEOPROCESSING IN ARCGIS

Similar behavior will be experienced for models or scripts thatcontain tools from an extension product when you do not have alicense to run the extension product’s tools. You need to checkout a license in the Extensions dialog box of the application youare working in by clicking the Tools menu, then clickingExtensions to be able to work with a particular extension’s tools.

Note that the number of tools available for an extension is thesame regardless of the ArcGIS software product you havelicensed. Note also that even if you install ArcInfo, you can onlyuse the tools within the Coverage Tools toolbox if you have alsoinstalled ArcInfo Workstation. The same lock icon will appearover coverage tools if ArcInfo Workstation is not installed.

Page 183: Geoprocessing in ArcGIS: ArcGIS 9

IN THIS CHAPTER

177

Specifying environment settings 6• About environment settings

• Specifying environment settings

• Specifying general settings

• Working with workspaces

• Specifying coverage settings

• About coverage precision

• Setting precision for coverages

• Specifying geodatabase settings

• Specifying raster geodatabasesettings

• Specifying raster analysis settings

Environment settings are values that may be used by tools. They are similarto a parameter and can apply to multiple tools. Examples of environmentsettings include the current workspace from which to take input data andplace results or the extent to apply to results.

When geoprocessing tools are run, default environment settings set for theapplication are applied to all applicable tools. These settings can be changedin the Environment Settings dialog box.

There will be times when the environment settings specified for theapplication are not appropriate for a particular tool. For instance, you want togenerate z-values for the output from one model, but you do not want tospecify this for the application because doing so will result in z-values beingcreated for all results from running tools. For such times, you can specifyenvironment settings specifically for a particular model. When the model isrun, these settings will always override environment settings specified for theapplication.

Within a model, there may be processes that require different environmentsettings from those set for a model or the application. You can specifyenvironment settings for a process in the model if different environmentsettings are necessary. Environment settings specified for a process overridethose set for the model or the application.

This chapter explains how to specify environment settings for the application,a model, and individual processes within a model. You’ll also learn about thevarious environment settings that are available.

Page 184: Geoprocessing in ArcGIS: ArcGIS 9

178 GEOPROCESSING IN ARCGIS

Environment settings are hierarchical in nature. There are threelevels at which they can be set. They can be set for theapplication you are working in so they apply to all tools, for amodel so they apply to all processes within the model, or for aparticular process within a model. Settings specified for a processoverride those set for the model and the application. Settingsspecified for the model override those set for the application.

Application environment settings

When you run a tool, there are certain environment settings thatmay apply, such as the current workspace from which to takeinput data and to place results. To determine which environmentsettings are used by a particular tool, consult Help for the toolyou are using. Values for environment settings can be specified inthe Environment Settings dialog box within the application youare using—either via the Geoprocessing tab of the Options dialogbox, accessed via the Tools menu on the Main menu of theapplication you are running, or by right-clicking the ArcToolboxwindow—and they will be used by all appropriate tools.

When you specify a value for an environment setting, such asthe current workspace, the value specified is automatically usedby appropriate tools. In the case of the current workspace, if thevalue -the path to the workspace—is set in the EnvironmentSettings dialog box, you can type the name of the input data to atool and the name of the output data produced by running a tool,and the path to the current workspace will be supplied for you.

Application environment settings persist when altered inArcCatalog, so you don’t have to set environment settings foreach ArcCatalog session. In ArcMap, you can store environmentsettings by saving the map document. You can also save yourgeoprocessing settings, which include settings specified in theapplication’s Environment Settings dialog box, so they can beloaded at any time. This is useful if you are working on multiple

About environment settings

projects that require different environment settings. See‘Geoprocessing settings’ in Chapter 3 for more information.

You can alter environment settings within a tool’s dialog box for aparticular instance of running a tool. Environment settingsspecified for the application will be overwritten. Note that ifenvironment settings are specified for a custom tool (a model or ascript) or a process within a model, these settings will alwaysoverride application-level settings—regardless of whether theyare set in the application’s Environment Settings dialog box or viathe tool’s dialog box at the time of execution. See Chapter 5,‘Working with toolsets and tools’, for more information on settingenvironments at the time of running a tool from its dialog box.

The application’s Environment Settings dialog box with theGeneral Settings section expanded and some valuessupplied. It is used to set environment settings for theapplication. Settings specified here apply to all appropriatetools.

Page 185: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 179

Model/Script environment settings

Environment settings specified for the application are passeddown to, and are used by, models and scripts, unlessenvironment settings are specified for a specific model or script.Settings specified for a model or a script override settingsspecified for the application.

Environment settings for the model are specified in theEnvironments tab of the Model Properties dialog box. This dialogbox is accessible via the Model menu within the ModelBuilderwindow or by right-clicking the model in its toolbox and clickingProperties.

Within a script, environment settings can be specified and will beapplied to all tools run within the script, as the following exampleshows.

# Set the workspace environment setting

GP.Workspace = "D:\\St_Johns\\data.mdb"

# Set the cluster tolerance environment setting

GP.ClusterTolerance = 2.5

# Calculate the default spatial grid index, half

#it and then set the spatial grid 1 environment#setting

GP.SpatialGrid1 = pGP.CalculateDefaultGridIndex("roads") / 2

# Clips the roads by the urban area feature class

GP.Toolbox = "Analysis"

GP.Clip("roads","urban_area","urban_roads")

Process environment settings

Processes in a model or script can have their own environmentsettings that will override those settings specified for the entiremodel or script as well as for the application.

Accessing the Environment Settings dialog box for a process in a model.Settings specified either for the model or for the application will beoverridden. In the example above, the inputs to and result from thisprocess only will be placed in the workspace specified.

Page 186: Geoprocessing in ArcGIS: ArcGIS 9

180 GEOPROCESSING IN ARCGIS

Within a script, you can set environment settings for oneprocess, then reset or alter settings for another process if desired.

For more information

See the tasks that follow for more information on how to specifyenvironment settings for the application, a model, and a processwithin a model and for information on each environment settingthat can be specified. See Chapter 3 of Writing GeoprocessingScripts With ArcGIS for more information on specifyingenvironment settings within a script.

Page 187: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 181

SpecifyingenvironmentsettingsDefault environment settingsare applied when you run tools.Rather than taking the default,you may want to specify yourown environment settings.

Changing the default settingsthat will be used is a prerequi-site to performinggeoprocessing tasks. You mayonly be interested in analyzinga small piece of a geographicarea, such as changing theextent for results, or you maywant to write all results to aspecific location—for example,changing the current workspaceor the scratch workspace.

Environment settings can be sethierarchically, meaning thatthey can be set for the applica-tion so they will apply to allappropriate tools, be set withina particular model or script, orbe set for a process within amodel. u

Specifying settings forthe application

1. Click Tools on the Main menuof the application you areusing, and click Options.

2. Click the Geoprocessing tab.

3. Click the Environmentsbutton.

The Environment Settingsdialog box is opened.

4. Expand the contents of thesection containing theenvironment settings youwish to alter.

5. Set values for appropriateenvironment settings.

6. Click OK.

Environment settingsspecified will be applied toall tools that accept them.

Tip

An alternative way toaccess the EnvironmentSettings dialog boxRight-click the ArcToolbox windowand click Environments.

1

4

6

3

2

Page 188: Geoprocessing in ArcGIS: ArcGIS 9

182 GEOPROCESSING IN ARCGIS

Specifying environmentsettings for a model

1. Right-click the model in itstoolbox and click Edit.

2. Click the Model menu andclick Model Properties.

3. Click the Environments tab.

4. Expand the settings youwould like to override.

5. If you want to override allsettings for a particular groupof environment settings, suchas all General Settings,simply check the box to theleft of the General Settingssection.

If you want to override aspecific setting within aparticular group of environ-ment settings, expand thegroup of settings thatcontains the setting you wishto override, then check thesetting.

6. Click Values.

The checked settings aredisplayed. u

All tools will utilize the environ-ment values set for the applica-tion unless they are manuallyset elsewhere. If you setenvironment values for a model,those values will supersede theones set for the application.

If you set environment settingsfor a process inside a model,those settings will overridesettings for the model andsettings for the application.

When specifying environmentsettings for a model or aprocess within a model, you cancheck a group of settings tooverride all values in thatgroup, or you can expand thecontents of a particular groupof settings and check specificones for which you want tooverride the default value.

Tip

An alternative way toaccess a model’sEnvironment Settingsdialog boxRight-click the model in its toolboxand click Properties, then click theEnvironments tab.

2

3

4

6

Page 189: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 183

7. Expand the categories ofsettings displayed and set analternative value for thechosen settings.

The values you specify willapply to all applicable toolswithin the model and willoverride any settingsspecified for the application.

8. Click OK on the EnvironmentSettings dialog box.

9. Click OK on the tool’sproperties dialog box.

See Also

If you want to set values forenvironment settings within astandalone script, refer to WritingGeoprocessing Scripts WithArcGIS for more information.

7

8

9

Page 190: Geoprocessing in ArcGIS: ArcGIS 9

184 GEOPROCESSING IN ARCGIS

Specifying environmentsettings for a process

1. In the ModelBuilder window,right-click the tool of theprocess you want to changedefault environment settingsfor and click Properties.

2. Click the Environments tab.

3. Either check a group ofsettings if you wish tooverride all settings in thegroup or expand a group ofsettings and click a particularsetting.

4. Click Values.

The settings you checked aredisplayed in an EnvironmentSettings dialog box.

5. Change the default value setfor each environment settingto be more appropriate forthe process.

6. Click OK, then click OK onthe properties dialog box.

1

3

4

5

6

2

Page 191: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 185

Specifyinggeneral settingsThe General Settings section ofthe Environment Settings dialogbox contains settings that areapplicable to most output datatypes. Included in this sectionare the following settings thatyou can change: the currentworkspace, the scratchworkspace, the output coordi-nate system, the default outputz-value, whether outputs willhave z- or m-values, the extentand snap raster, and the clustertolerance. Each of thesesettings is discussed in thepages that follow.

Viewing general settingsfor the application

1. Click Tools on the Mainmenu of the application youare using, then click Options.

2. Click the Geoprocessing tab.

3. Click the Environmentsbutton.

The Environment Settingsdialog box is opened.

4. Click General Settings toview the settings.

5. Click OK.

Tip

An alternative way toaccess the EnvironmentSettings dialog boxRight-click the ArcToolbox windowand click Environments.

1

2

3

See Also

See ‘About environment settings’earlier in this chapter for informa-tion on setting environments for theapplication, for a model, or for aprocess within a model.

4

5

Page 192: Geoprocessing in ArcGIS: ArcGIS 9

186 GEOPROCESSING IN ARCGIS

Working with workspaces

A workspace is the work area used during a geoprocessingsession. Within the computer file system, the workspace is adirectory containing geographic data. There are three directorystructures that are supported: folders, geodatabases, andgeodatabase feature datasets. There are two workspaces that canbe set in the Environment Settings dialog box: the currentworkspace and the scratch workspace.

The current workspace

Setting the current workspace allows you to set the location fromwhich inputs are taken and outputs are placed when runningtools. It allows you to type the name of inputs and outputs fortools rather than also having to type the path or browse to thelocation of the data each time you run a tool.

The scratch workspace

If you have a scratch workspace set, outputs from tools will beplaced in the location specified with a default name. If youremove the path given for the output parameter and simply type aname, the result will be saved into your current workspace if it isset or to the location of the input data if it is not set.

In your day-to-day work flow, you can accept the default pathand name for results that you do not care to keep so they areplaced in the scratch workspace, and type a meaningful name foroutputs from tools that you want to keep so they are placed inthe location of the current workspace.

If the current workspace and the scratch workspace are not set,the outputs from tools will, by default, be placed in the location ofthe input data. The exception is the Feature Class to Coveragetool, when the input is a geodatabase feature class. In this case,with no workspaces set, the output will be placed in the samelocation as the input geodatabase.

Using workspaces in ArcMap

When running individual tools in an application with a displayvia the ArcToolbox window, such as ArcMap, you can simplifythe process of running tools by following the steps below.

1. Set workspaces

Set a current workspace and a scratch workspace in theEnvironment Settings dialog box. See the task ‘Viewing generalsettings for the application’ earlier in this chapter for informationon accessing the Environment Settings dialog box.

2. Check to create temporary results

Optionally, on the Geoprocessing tab of the Options dialog box,check to create temporary results when running tools from theirdialog boxes or from the command line. You should do this if youknow that you will be generating results from tools that you willlikely not want to keep after the application is closed, such aswhen experimenting with different outcomes to produce adesirable result.

Note that the Add results of geoprocessing operations to thedisplay check box must first be checked in order to check Resultsare temporary by default. If results are not set to be added to thedisplay, they will always be permanently created.

Page 193: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 187

3. Run tools

After setting the workspaces (current and scratch) and,optionally, checking to create temporary results, you are ready torun tools.

Open a tool’s dialog box and supply the name of a datasetcontained within the current workspace, then click anotherparameter in the dialog box. The path to the current workspaceset will be supplied for the input parameter, and the scratchworkspace path will be supplied for the value of the outputparameter, with a default name.

Fill in the rest of the parameters and click OK to run the tool.

All results are temporarily created and placed in the location setfor the scratch workspace.

When you want to create a result you want to keep, simply clearthe default path and name given for the output parameter andtype a name. It will be saved in the location set for the currentworkspace. As all your important results are saved to the locationof the current workspace, you can simply delete the contents ofthe folder or geodatabase that you have specified as the scratchworkspace.

4. Make results permanent

If you want to permanently save a certain temporary result, right-click the layer in the table of contents and click Make Permanent.The result will be permanently saved in the location of the scratchworkspace.

Alternatively, uncheck Results are temporary by default in theGeoprocessing tab of the Options dialog box, and always createpermanent results in your scratch workspace.

The Geoprocessing tab of the Options dialogbox, accessed by clicking Options on the Toolsmenu

Page 194: Geoprocessing in ArcGIS: ArcGIS 9

188 GEOPROCESSING IN ARCGIS

Using workspaces in a model

Within a model, you may want your intermediate results to be saved in one directory and your final results to be saved in another. In theEnvironment Settings dialog box for the application or the model, set the current workspace to one location and the scratch workspaceto another location. In the model, leave the default path and name supplied for all intermediate outputs from tools, then simply type thename for the final result, without specifying a path. It will be saved to the location of the current workspace. See ‘About intermediatedata’ in Chapter 9 for more information on managing intermediate data.

Leave thedefault path

and name forintermediate

results to savethem to the

location of thescratch

workspace.

Right-click thefinal derived dataelement anduncheckintermediate. Typea name for thefinal output. It willbe placed in thelocation of thecurrentworkspace. Whenyou deleteintermediate datawithin the modelor run the modelvia its dialog box,this final result willnot be deleted.

uu

Page 195: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 189

2

3

See Also

See ‘Working with workspaces’earlier in this chapter for moreinformation on setting the currentand the scratch workspaces.

Setting the currentworkspace

1. Follow steps 1–4 of ‘Viewinggeneral settings for theapplication’.

2. Type the path to theworkspace you want to useor click the Browse button tonavigate to a location ondisk.

The workspace can be ageodatabase, a folder, or ageodatabase feature dataset.

3. Click OK.

Page 196: Geoprocessing in ArcGIS: ArcGIS 9

190 GEOPROCESSING IN ARCGIS

2

3

See Also

See ‘Working with workspaces’earlier in this chapter for moreinformation on setting the currentand the scratch workspaces.

Setting the scratchworkspace

1. Follow steps 1–4 of ‘Viewinggeneral settings for theapplication’.

2. Type the path to the ScratchWorkspace you want to use,or click the Browse button tonavigate to a location ondisk.

The workspace can be ageodatabase, a folder, or ageodatabase feature dataset.

3. Click OK.

All output results fromrunning tools will automati-cally be placed in the scratchworkspace with a defaultname.

Page 197: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 191

Setting the outputcoordinate system

1. Follow steps 1–4 of ‘Viewinggeneral settings for theapplication’.

2. Click the Output CoordinateSystem dropdown arrow andclick the desired option—Same as Input, Same asDisplay, As Specified Below,or Same as Layer “layername”.

If you choose As SpecifiedBelow, type the coordinatesystem information into theOutput Coordinate Systemtext box if it is known, or clickthe Browse button to set upthe coordinate systeminformation.

Same as Display takes thecoordinate system from theactive data frame in ArcMap.In ArcCatalog you must bepreviewing data to see thisoption.

Same as Layer “layer name”is only available in ArcGISDesktop applications with adisplay, such as ArcMap orArcScene.

Alternatively, click theBrowse button next to thedropdown list to apply thecoordinate system informa-tion from an existing dataset.

3. Click OK on the EnvironmentSettings dialog box.

You can specify the coordinatesystem that will be applied tospatial data created by runningtools. The coordinate system(geographic or projected)defines the location of thespatial data on the earth.

Precedence rules dictate whichcoordinate system is applied tooutputs from running tools:

• If the output resides inside afeature dataset, the coordi-nate system of the featuredataset will always be used.

• If the coordinate system isset in the EnvironmentSettings dialog box and theoutput does not resideinside a feature dataset, thecoordinate system set in theEnvironment Settings dialogbox is used.

• If there is no value set forthe Output CoordinateSystem environment settingand the output does notreside inside a featuredataset, the coordinatesystem of the first input tothe tool is used.

When setting the coordinatesystem to apply in the Environ-ment Settings dialog box, thedefault specifies that thecoordinate system of outputsbe the same as the first input tothe tool (Same as Input). Youcan change the default settingso that outputs are projected u

2

3

Page 198: Geoprocessing in ArcGIS: ArcGIS 9

192 GEOPROCESSING IN ARCGIS

on the fly from the coordinatesystem of the input to thecoordinate system specified(using As Specified Below) orso that the outputs are pro-jected on the fly from thecoordinate system of the inputto that of the display, which isthe active data frame inArcMap. Alternatively, set thecoordinate system for outputsto be the same as a layer in thetable of contents of the display(using Same as Layer), or clickthe Browse button next to thedropdown list to take thecoordinate system informationfrom an existing dataset. u

See Also

Before running geoprocessing toolsthat create feature datasets orfeature classes within ageodatabase, you can set up spatialdomain information—the allowablecoordinate range for x,ycoordinates, m (measure)-values,z-values, and precisioninformation. See ‘Specifyinggeodatabase settings’ in thischapter for more information.

Page 199: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 193

If your input feature classescontain z-values in the featuregeometry or you have setOutput has Z values toENABLED in the GeneralSettings section of theEnvironment Settings dialogbox, you can set up a defaultoutput z-value that will be givento each vertex in the outputfeature class after a tool is run ifno z-value can be attained fromthe input.

Each vertex in the feature classwill contain an x, y, and zcoordinate. The value for the zcoordinate will be based on theinput to the tool. If the inputdoes not contain z-values, thevalue set for the Default OutputZ Value setting in the Environ-ment Settings dialog box will beapplied as the z-value to allvertices in the output featureclass. If no default outputz-value is set, the value will bethe minimum value set for thez-domain in the EnvironmentSettings dialog box. If there isno z-domain set in the Environ-ment Settings dialog box, thez-value will be taken from theminimum value set for thez-domain of the input. If theinput does not contain az-domain, zero is used as thez-value. u

Setting the default outputz-value

1. Follow steps 1–4 of ‘Viewinggeneral settings for theapplication’.

2. Type a z-value to apply to allfeatures in feature classescreated by running appli-cable tools. This value will beapplied if a z-value cannotbe used from the input to thetool.

3. Click OK.

2

3

Page 200: Geoprocessing in ArcGIS: ArcGIS 9

194 GEOPROCESSING IN ARCGIS

Z-values, such as buildingheights, may be represented onthe z-axis in a three-dimensionalx,y,z coordinate system.

If you want your feature classoutputs to be able to storez-values for each vertex, youmust specify this beforerunning a tool. This capabilitycannot subsequently be added.

The default (Same As Input)takes the state of the input datato a tool—if the input can storez-values, the output will also beable to store z-values.

By setting the option toEnabled, output feature classeswill be able to store z-values,regardless of whether the inputdata to a tool can.

By setting the option toDisabled, outputs from toolswon’t be able to store z-values,even if the input to a tool can.

If you set this option toEnabled or Same As Input, thez-values applied to each vertexin the output will be based onthe input if they are present. Ifz-values are not present on theinput and there is no value setfor the Default Output Z Valuein the Environment Settingsdialog box, the minimum valuein the z-domain is used as thez-value. If there is no z-domainin the input, zero is given as thez-value. u

Specifying whether theoutput has z-values

1. Follow steps 1–4 of ‘Viewinggeneral settings for theapplication’.

2. Click the Output has Z valuesdropdown arrow and clickEnabled, Disabled, or SameAs Input.

3. Click OK.

2

3

Page 201: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 195

M-values on polylines are usedin linear referencing to imply aroute measure. Route measurescan be used to represent alocation along a route, such asmileages along a highway.

If you want your output featureclasses to be able to storem-values for each vertex, youmust specify this beforerunning a tool. The ability tostore m-values cannot besubsequently added.

The default (Same As Input)takes the state of the input datato a tool—if the input can storem-values, the output will alsobe able to store m-values.

By setting the option toEnabled, output feature classeswill be able to store m-values,regardless of whether the inputdata to a tool can.

By setting the option toDisabled, outputs from toolswon’t be able to store m-values,even if the input data can.

If you set this option toEnabled or Same As Input, them-values applied to each vertexin the output will be based onthe input if they are present,unless the tool will set or resetmeasure values, in which caseinput measures will be ignoredand new ones will be calculated.

If m-values are not present inthe input, they will be set toNot a Number (NaN). u

Specifying whether theoutput has m-values

1. Follow steps 1–4 of ‘Viewinggeneral settings for theapplication’.

2. Click the Output has Mvalues dropdown arrow andclick Enabled, Disabled, orSame As Input.

3. Click OK.

2

3

Page 202: Geoprocessing in ArcGIS: ArcGIS 9

196 GEOPROCESSING IN ARCGIS

By specifying an extent, youdefine the area of interest forresults from running tools.

In the case of feature data, allinput features to a tool thatpass through the area ofinterest will be included in thecalculation.

For raster data, results fromrunning tools will be containedwithin the extent set.

The extent is a rectangle,specified by identifying thecoordinates of the window inmap space.

The default extent is set toDefault. With this extent set,the tool determines the extent ofthe output based on the extentof the input.

Intersection of Inputs setsgeoprocessing to only beperformed where all layersoverlay, which is the minimumof the inputs.

Union of Inputs sets the extentof the results to be the same asthe combined extent of inputsto a tool.

Same as Layer sets the extentto be the same as an existinglayer in the table of contents.

As Specified Below sets acustom extent. Specify the fourvalues, in map units, for theextent you wish to apply. Youmust specify the Top, Right, u

Changing the defaultextent

1. Follow steps 1–4 of ‘Viewinggeneral settings for theapplication’.

2. Click the Output Extentdropdown arrow and selectthe required option.

If you click As SpecifiedBelow, type the x,y coordi-nates that will be used as theextent for all results fromgeoprocessing operations(Left = minimum x coordi-nate, Bottom = minimum ycoordinate, Right = maximumx coordinate, and Top =maximum y coordinate).

Alternatively, click theBrowse button and browse toa dataset from which to takethe extent.

Same as Layer is onlyavailable in ArcGIS Desktopapplications with a display,such as ArcMap or ArcScene.

3. Click OK.

2

3

Page 203: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 197

Setting the extent toSame as Display

1. Click the Zoom In tool andzoom in on the display to thearea in which you wish toperform geoprocessing.

Note: If you are working inArcCatalog, click a dataset,then click the Preview tabfirst.

2. Follow steps 1–4 of ‘Viewinggeneral settings for theapplication’.

3. Click the Output Extentdropdown arrow and clickSame as Display.

4. Click OK.

The extent of all results willbe set to that of the display.

Bottom, and Left values. Aneasy way to do this is to set theextent to that of an existingdataset, then modify the valuesto the required extent.

Same as Display sets the extentto be the same as the areavisible in the display of theapplication. If you are workingin ArcCatalog, you have to bepreviewing data to see thisoption in the dropdown list.

Alternatively, you can click theBrowse button and browse to adataset on disk to take theextent from. u

3

4

1

Page 204: Geoprocessing in ArcGIS: ArcGIS 9

198 GEOPROCESSING IN ARCGIS

Setting a snap raster ensuresthat the cell alignment of theanalysis extent will matchaccurately with an existingraster. This is done by snappingthe lower-left corner of thespecified analysis extent to thelower-left corner of the nearestcell in the snap raster andsnapping the upper-right cornerof the specified analysis extentto the upper-right corner of thenearest cell in the snap raster. u

Setting a raster to snapall results to

1. Follow steps 1–4 of ‘Viewinggeneral settings for theapplication’.

2. Click the Output Extentdropdown arrow and clickeither Same as Display or AsSpecified Below, or click theBrowse button to browse to adataset to set the extent foranalysis results. Alternatively,click the dropdown list andclick a layer to take the extentfrom.

The snap raster setting isonly enabled when one ofthe above options is set forthe extent. This is becausethese are the only options inwhich the analysis extentspecified may not have thesame cell alignment as yourraster data.

3. Type the path and name ofthe raster to snap to.

Alternatively, click theBrowse button, click the Lookin dropdown arrow, andnavigate to the location of theraster to use. Click the raster,then click Add.

4. Click OK.

All raster results will besnapped to the cellalignment of the rasterspecified.

2

3

4

Tip

Working with raster dataWhen using raster data withdifferent cell alignments together inthe same tool, nearest neighborinterpolation will be used to matchthe different cell alignments duringanalysis. This could causeunwanted artifacts with continuousdata sources and is not recom-mended. To ensure this will nothappen, it is always best to try tocreate raster data with the samecell alignments.

Page 205: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 199

The cluster tolerance is thedistance range in which allvertices and boundaries in afeature class are consideredidentical, or coincident.

To minimize error, the clustertolerance you choose should beas small as possible, dependingon the precision level of yourdata.

By default, the minimumpossible tolerance value iscalculated in the units of thespatial reference of the input.This default value is applied ifyou don’t specify a clustertolerance before running a tool.

Setting the clustertolerance

1. Follow steps 1–4 of ‘Viewinggeneral settings for theapplication’.

2. Type a value for the ClusterTolerance and set the units.

When running subsequenttools, the cluster toleranceapplied to the results will firstbe converted to the units ofthe input data if the units ofthe cluster tolerance and theinput data are different.

3. Click OK.

The cluster tolerance sethere will be used by all toolsthat use a cluster tolerance.Tip

Calculating the defaultcluster toleranceYou can calculate the default clustertolerance for a feature class usingthe Calculate Default ClusterTolerance tool in the Featureclasstoolset of the Data ManagementTools toolbox.

2

3

See Also

Type “Topology Basics” in theSearch tab of the online Helpsystem for more information on thecluster tolerance.

Page 206: Geoprocessing in ArcGIS: ArcGIS 9

200 GEOPROCESSING IN ARCGIS

Specifyingcoverage settingsThe environment settings in theCoverage Settings section ofthe Environment Settings dialogbox apply to coverage toolsonly. The default value for thefollowing settings can bechanged: the precision for newor derived coverages and thelevel of comparison betweenprojection files. Each of thesesettings is discussed in thepages that follow. u

Viewing coveragesettings for theapplication

1. Click Tools on the Main menuof the application you areusing and click Options.

2. Click the Geoprocessing tab.

3. Click the Environmentsbutton.

The Environment Settingsdialog box is opened.

4. Click Coverage Settings toview the settings for whichvalues can be changed.

5. Click OK.Tip

An alternative way toaccess the EnvironmentSettings dialog boxRight-click the ArcToolbox windowand click Environments.

1 2

3

4

5

See Also

See ‘About environment settings’earlier in this chapter for informa-tion on setting environments for theapplication, a model, or a processin a model.

Page 207: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 201

Before running coverage tools,you can set the degree ofsimilarity between inputprojection files required for amatch to occur. Use this optionif you want to validate the inputprojections before runningcoverage tools.

The following settings areavailable:

NONE—no comparison ofprojection files is made. Anycombination of projectioninformation will result in amatch. Tools will run regardlessof the projection of the inputs.This is the default.

PARTIAL—at least oneprojection file must be defined;the others can be unknown andwill result in a match. Definedprojection files must beidentical.

FULL—all projection informa-tion must be specified andidentical in the projection file ofeach input dataset.

Similar projections and param-eters that are defined indifferent ways will not match.For example, UNITS METERSand UNITS1, which are equal,will not match. DefiningUniversal Transverse Mercator(UTM) and State Plane projec-tions by their central meridiansor parallels will not match withthe same projection definedusing the ZONE option.

Setting the level ofcomparison betweenprojection files

1. Follow steps 1–4 of ‘Viewingcoverage settings for theapplication’.

2. Click the Level Of Compari-son Between Projection Filesdropdown arrow and choosethe level of comparison yourequire before tools arerun—NONE, PARTIAL, orFULL.

3. Click OK.

2

3

Page 208: Geoprocessing in ArcGIS: ArcGIS 9

202 GEOPROCESSING IN ARCGIS

About coverage precision

What is coordinate precision?

Coordinate precision refers to the mathematical exactness of acoordinate and is based on the possible number of significantdigits that can be stored for each coordinate. ESRI ArcInfocoverages are stored in either single- or double-precisioncoordinates. Single precision stores up to seven significantdigits for each coordinate. This means that values of 4,999,999.6units or 5,000,000.4 units are rounded off to 5,000,000 units whenstored in single precision. Double precision stores up to 15significant digits—typically 13 to 14—and retains a mathematicalprecision of much less than 1 meter at a global extent. Note thatmathematical precision does not, by itself, define accuracy. It is,however, a major factor in coverage resolution.

When to use double precision

It is probably best to use double precision if the coordinateresolution of a coverage must be maintained past six significantdigits. Here are some of the conditions that meet this requirement:

• Your coverage requires a high level of accuracy—for example,a parcels layer.

• You need to use a map projection whose coordinate valuesexceed the available coordinate precision.

• You are changing datums—for example, from NAD27 toNAD83.

How does precision work?

The computer can only discern a limited number of decimalplaces, depending on the precision being used. For single-precision coordinates, the computer assumes that values such as1.2345678 and 1.23456789 are equal because numbers beyond theseventh digit are ignored. You might imagine a small halosurrounding each coordinate that is equal to the resolution of

coordinate storage on the computer. Coordinates withoverlapping halos are seen by the computer to represent the samelocation.

Coverages stored with either single- or double-precisioncoordinates can be used interchangeably; for example, you candisplay single- and double-precision coverages over each other,overlay them, merge them, and so on. This capability, however,does not replace the need to be clear and deliberate about howyou encode, store, and manage each coverage. Base yourdecision of which type of precision to use on the desired level ofcoordinate accuracy to be maintained for each coverage.

The coordinate systems for many map projections use largecoordinate values—for example, State Plane and UTMcoordinates contain values in the 2 million to 6 million range. Inthese cases, you can use double-precision coordinates tomaintain accuracy of less than one unit, extending beyond thedecimal point.

As mentioned, double-precision coverages can store up to15 significant digits. This is sufficient to map any point on theearth to better than a millimeter of accuracy. However, double-precision coverages require additional disk space for storingcoordinates. Thus, it may be worthwhile to store coverages thatrequire high levels of accuracy, such as parcels, in a double-precision coordinate system and coverages needing lessaccuracy, such as soils, in a single-precision coordinate system.

Precision rules

You can define the coordinate precision of new and derivedcoverages created. These two rules are creation and processing.

The creation rule specifies the precision with which to create allnew coverages. Any time a new coverage is created, thecoordinate precision of the new coverage is defined by thecurrent creation rule. Single precision is the default. Thus, if you

Page 209: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 203

want to create double-precision coverages, you must set theprecision for new coverages to DOUBLE.

The processing rule specifies the precision with which to createall derived coverages. When a coverage is derived from one ormore existing coverages, such as the result of the Buffer orUpdate tools, the coordinate precision of the derived coveragereflects the current processing rule. For example, the outputcoverage precision can be the highest of a set of input coverages.Thus, if all input coverages are in a single-precision coordinatesystem, the output coverage will be single precision; if at leastone of the coverages is double precision, the output coverage isdouble precision. By setting LOWEST for the precision ofderived coverages, the precision of derived coverages will betaken from the input coverage with the lowest precision. Thus, ifall input coverages are in double precision except one that is insingle precision, the derived coverage’s precision will be single.

To create double-precision coverages regardless of the precisionof the input coverages, set the processing rule to DOUBLE beforeyou begin.

To always create new coverages in double precision, set the Precision ForNew Coverages to DOUBLE in the Environment Settings dialog box. Allnew coverages created by tools that create coverages, such as the CreateCoverage tool, will be in double precision.

To always create your derived coverages in double precision, regardless ofthe precision of the input coverages, set the processing rule to DOUBLE inthe Environment Settings dialog box before you run geoprocessing tools.

Page 210: Geoprocessing in ArcGIS: ArcGIS 9

204 GEOPROCESSING IN ARCGIS

Setting the precision fornew coverages

1. Follow steps 1–4 of ‘Viewingcoverage settings for theapplication’.

2. Click the Precision For NewCoverages dropdown arrowand choose the level ofprecision you require, eitherSINGLE or DOUBLE.

3. Click OK.

See Also

See Chapter 7, ‘Using theCommand Line window’, forinformation on specifyingenvironment settings at thecommand line.

Setting the precision forderived coverages

1. Follow steps 1–4 of ‘Viewingcoverage settings for theapplication’.

2. Click the Precision ForDerived Coveragesdropdown arrow and choosethe option for setting theprecision— HIGHEST,LOWEST, SINGLE, orDOUBLE.

3. Click OK.

2

3

2

3

Setting precisionfor coveragesBefore you begin using tools inthe Coverage Tools toolbox,you should determine what theprecision of your outputcoverages should be.

New coverages are those thatare created, for example, usingthe Create Coverage tool.Derived coverages are thosethat are derived from tools thataccept input data to derive theoutput coverage, for example,coverages created by runningthe Buffer tool.

The default precision is set toSINGLE for new coverages thatare created and HIGHEST forderived coverages. If you wantnew coverages that are createdto be in double precision, setthe Precision For New Cover-ages to DOUBLE. If you alwayswant derived coverages to be indouble precision, regardless ofthe precision of the input data,set the precision for derivedcoverages to DOUBLE.

Page 211: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 205

SpecifyinggeodatabasesettingsThe Geodatabase Settingssection of the EnvironmentSettings dialog box providesenvironment settings for resultsplaced in a geodatabase.Included are the followingsettings that can be changed:the output configurationkeyword, output spatial grids,and spatial domain and preci-sion information. Each of thesesettings is discussed in thepages that follow. u

Tip

An alternative way toaccess the EnvironmentSettings dialog boxRight-click the ArcToolbox windowand click Environments.

Viewing geodatabasesettings for theapplication

1. Click Tools on the Main menuof the application you areusing and click Options.

2. Click the Geoprocessing tab.

3. Click the Environmentsbutton.

The Environment Settingsdialog box is opened.

4. Click Geodatabase Settingsto view the settings for whichvalues can be specified.

5. Click OK.

See Also

See ‘About environment settings’earlier in this chapter for informa-tion on setting environments for theapplication, a model, or a processin a model.

1 2

3

4

5

Page 212: Geoprocessing in ArcGIS: ArcGIS 9

206 GEOPROCESSING IN ARCGIS

Setting the outputconfiguration keyword

1. Follow steps 1–4 of ‘Viewinggeodatabase settings for theapplication’.

2. Type a configurationkeyword.

To use the default configura-tion keyword, leave the valuefor the setting blank.

3. Click OK.

For more information, see theappropriate ArcSDE configu-ration and tuning guide.

The configuration keywordspecifies the storage parameters(configuration) forgeodatabases in a RelationalDatabase Management System(RDBMS)—ArcSDE only.

The database storage configu-ration enables your databaseadministrator to fine-tune howthe RDBMS in which yourgeodatabase is implementedstores data. The configurationparameters are groupedtogether into one or moreconfiguration keywords, one ofwhich is the default configura-tion keyword that specifies thedefault storage parameters.

When you create a dataset,such as a feature class, geomet-ric network, or raster, you cantell the database which configu-ration keyword to use. Differentconfiguration keywords can beused for different datasets.Normally, you can simply usethe default configurationkeyword, which geoprocessingtools will access automatically.In some cases, the databaseadministrator may have createdalternative configurationkeywords for use when youcreate particular datasets ortypes of data in order tomaximize their performance orfine-tune some aspect of howthey are stored in the database.In this case, an alternativekeyword can be specified. u

2

3

Page 213: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 207

You can set up output spatialgrids that are two-dimensionalgrid systems that span a featureclass. When zoomed in on afeature class and performing aspatial search, only the featuresthat fall in the necessary cellsof the spatial grid are searched,enabling the quick location offeatures that might match thecriteria of the spatial search.

Personal geodatabase featureclasses require a single spatialgrid. ArcSDE geodatabasefeature classes can have up tothree spatial grids. Each spatialgrid must be at least three timesthe previous spatial grid.Feature size is an importantfactor in determining anoptimum size for the spatialgrid. Data that contains featuresof different sizes may requireadditional spatial grids toincrease the speed of graphicalqueries.

If you are unfamiliar withcreating spatial grids, use thedefault, which will calculate anappropriate size. A poorlydefined grid size can increasethe spatial search time. u

Tip

Obtaining a value forOutput Spatial Grid 1Run the Calculate Default SpatialGrid Index tool located inside theFeature class toolset in the DataManagement Tools toolbox.

Setting the output spatialgrid

1. Follow steps 1–4 of ‘Viewinggeodatabase settings for theapplication’.

2. Type a value for the cell sizeof Output Spatial Grid 1 inmap units.

3. If applicable, type values forthe cell sizes of OutputSpatial Grids 2 and 3 in mapunits, or leave the default(blank). The value for eachspatial grid level should be atleast three times larger thanthe previous level.

These grids are only used ifthe input feature class usedby a tool is an ArcSDEfeature class.

4. Click OK.

2

3

4

Page 214: Geoprocessing in ArcGIS: ArcGIS 9

208 GEOPROCESSING IN ARCGIS

Setting the x,y domain

1. Follow steps 1–4 of ‘Viewinggeodatabase settings for theapplication’.

2. Click the Output XY Domaindropdown arrow and click thedesired option—Same asInput, As Specified Below,Same as Display, or Same asLayer “layer name”.

If you choose As SpecifiedBelow, type the x,y domaininformation into the textboxes if it is known.

The Same as Display optionin ArcCatalog takes the x,ydomain information from thecurrent dataset beingpreviewed. In ArcMap, thisoption takes the x,y domaininformation from the activedata frame.

Same as Layer “layer name”is only available in ArcGISDesktop applications with adisplay, such as ArcMap orArcScene.

Alternatively, click the Browsebutton to apply the x,ydomain information from anexisting dataset.

3. Click OK on the EnvironmentSettings dialog box.

When results from runningtools will be feature classes orfeature datasets within ageodatabase, you can first setup the spatial domain, whichincludes the precision, whichdefines the level of detail that ismaintained when data valuesare stored in a geodatabase,and the allowable coordinaterange for x,y coordinates, m(measure)-values, such asmileages along a highway, andz-values, such as buildingheights.

Precedence rules dictate wherethe spatial domain informationwill come from when runningtools:

• If the output will be placedinside a feature dataset, thex,y domain set for thefeature dataset will alwaysbe applied—if an x,y domainis set in the EnvironmentSettings dialog box it will beignored in this case. M- andz-domain information is notdetermined by the featuredataset. This informationcan be set in the Environ-ment Settings dialog box. Ifit is not set there, the m- andz-domains will be calculatedby the tool, based on itsinputs.

• If spatial domain informationis set in the EnvironmentSettings dialog box and theoutput does not reside u

2

3

Page 215: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 209

Setting the z-domain

1. Follow steps 1–4 of ‘Viewinggeodatabase settings for theapplication’.

2. Click the Output Z Domaindropdown arrow and clickthe desired option—Same asInput, As Specified Below,Same as Display, or Same asLayer “layer name”.

If you choose As SpecifiedBelow, type the z-domaininformation into the text box ifit is known.

The Same as Display optionin ArcCatalog takesthe z-domain informationfrom the current datasetbeing previewed. In ArcMap,this option takes thez-domain information fromthe active data frame.

Same as Layer “layer name”is only available in ArcGISDesktop applications with adisplay, such as ArcMap orArcScene. Only layers thathave a z-domain will beavailable in the dropdownlist.

Alternatively, click the browsebutton to apply the z-domaininformation from an existingdataset.

3. Click OK on the EnvironmentSettings dialog box.

inside a feature dataset, thespatial domain informationset in the EnvironmentSettings dialog box is used.

• If there are no values set forthe spatial domain settingsin the Environment Settingsdialog box and the outputdoes not reside inside afeature dataset, the spatialdomains will be calculatedusing the domains of thetool input.

When setting the spatialdomain information to use inthe Environment Settings dialogbox, the default (for x,y coordi-nates or for m- and z-values)specifies that the spatial domainof outputs be the same as thefirst input to the tool (Same asInput). You can change thedefault setting so that outputsare projected on the fly from thespatial domain set for the inputto the spatial domain set for thedisplay (Same as Display), or tothe spatial domain specified (AsSpecified Below). Alternatively,set the spatial domain foroutputs to be the same as alayer in the table of contents ofthe display (Same as Layer).

3

2

See Also

For more information on thespatial domain, see Building aGeodatabase.

Page 216: Geoprocessing in ArcGIS: ArcGIS 9

210 GEOPROCESSING IN ARCGIS

Setting the m-domain

1. Follow steps 1–4 of ‘Viewinggeodatabase settings for theapplication’.

2. Click the Output M Domaindropdown arrow and click thedesired option—Same asInput, As Specified Below,Same as Display, or Same asLayer “layer name”.

If you choose As SpecifiedBelow, type the spatialdomain information into thetext box if it is known.

The Same as Display optionin ArcCatalog takes the m-domain information from thecurrent dataset beingpreviewed. In ArcMap, thisoption takes the m-domaininformation from the activedata frame.

Same as Layer “layer name”is only available in ArcGISDesktop applications with adisplay, such as ArcMap orArcScene. Only layers thathave an m-domain will beavailable in the dropdownlist.

Alternatively, click the Browsebutton to apply the m-domaininformation from an existingdataset.

3. Click OK on the EnvironmentSettings dialog box.

Tip

Storing m- and z-valuesIf the input to a tool does notcontain z- or m-values and thedefault of Same as Input is set forOutput has Z Values and Outputhas M Values in the GeneralSettings section of the EnvironmentSettings dialog box, regardless ofwhether you have a domain set form-values and z-values, they cannotbe stored in the output fromrunning the tool. You must setOutput has Z Values and Outputhas M Values to Enabled in theGeneral Settings section of theEnvironment Settings dialog boxbefore running tools using inputsthat do not have the ability to storem-values and z-values.

2

3

See Also

The spatial domain informationforms a part of the spatialreference you might want to set upbefore running tools. Spatialreference information also consistsof the coordinate system to apply toresults. For information on settingthe coordinate system beforerunning tools, see ‘Setting theoutput coordinate system’ earlier inthis chapter.

Page 217: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 211

Specifying rastergeodatabasesettingsThe raster geodatabase settingssection of the EnvironmentSettings dialog box providessettings for raster geodatabaseresults. Included are thefollowing settings that can bechanged: the default compres-sion type for ArcSDEgeodatabases, the defaultsettings for pyramid creationand calculating statistics, andthe tile size used when loadingraster data to an existing rasterdataset. Each of these settingsis discussed in the pages thatfollow. u

Tip

An alternative way toaccess the EnvironmentSettings dialog boxRight-click the ArcToolbox windowand click Environments.

Viewing rastergeodatabase settings forthe application

1. Click Tools on the Main menuof the application you areusing and click Options.

2. Click the Geoprocessing tab.

3. Click the Environmentsbutton.

The Environment Settingsdialog box is opened.

4. Click Raster GeodatabaseSettings to view the settingsfor which values can bespecified.

5. Click OK.

See Also

See ‘About environment settings’earlier in this chapter for informa-tion on setting environments for theapplication, a model, or a processin a model.

2

3

1

4

5

Page 218: Geoprocessing in ArcGIS: ArcGIS 9

212 GEOPROCESSING IN ARCGIS

Setting the compressiontype

1. Follow steps 1–4 of ‘Viewingraster geodatabase settingsfor the application’.

2. Click the Compressiondropdown arrow and click thecompression type you wantto use.

3. If JPEG or JPEG2000 isselected for the Compres-sion, enter a value forCompression quality.

All raster dataset resultscreated in an ArcSDEgeodatabase will first becompressed in the mannerspecified.

4. Click OK.

The compression type setting isused by any tools that loadraster data into an ArcSDEgeodatabase. The blocks ofdata in a raster can be com-pressed before being stored inan enterprise geodatabase.Three types of compression aresupported, LZ77, JPEG, andJPEG2000.

LZ77 (the default) is a losslesscompression that preserves allraster cell values. It uses thesame compression algorithm asthe PNG image format and onesimilar to ZIP compression. Asyou can rely on the pixels notchanging their values after youcompress them, use LZ77 forperforming visual or algorithmicanalysis.

JPEG is a lossy compressionbecause raster cell values maynot be preserved after compres-sion and decompression. Ituses the public domain JPEG(JFIF) compression algorithmand only works for unsigned8 bit raster data (single bandgrayscale or three band rasterdata).

JPEG2000 uses wavelet technol-ogy to compress rasters so theyvisually appear lossless,meaning that although the cellvalues do get manipulated, thedifferences between the originaland the same raster withcompression are not easilydistinguishable. u

2

4

3

Page 219: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 213

Use JPEG or JPEG2000 forrasters that are meant aspictures or backdrop imagery.

If JPEG or JPEG2000 is selected,you can also set thecompression quality to controlhow much loss the image will besubjected to by thecompression algorithm. Thevalues of the pixels of an imagecompressed with a highercompression quality will becloser to those of the originalimage. Valid value ranges ofcompression quality are fromfive to 95. The defaultcompression quality is 75. Theamount of compression willdepend upon the data andcompression quality. The morehomogeneous the data, thehigher the compression ratio.The lower the compressionquality, the higher thecompression ratio. Lossycompression normally results inhigher compression ratios whencompared to losslesscompression.

The primary benefits ofcompressing data are thatcompressed data requires lessstorage space and data displaytimes will be quicker as there isless information to transmit. u

Page 220: Geoprocessing in ArcGIS: ArcGIS 9

214 GEOPROCESSING IN ARCGIS

Creating pyramids

1. Follow steps 1–4 of ‘Viewingraster geodatabase settingsfor the application’.

2. Build pyramids is checked bydefault. If you previouslyunchecked it, check it.

3. Click the Pyramid resamplingtechnique dropdown arrowand click the resamplingtechnique you wish to use toresample the data in order tobuild the pyramid layers.

4. Click OK.

Pyramids are reduced resolu-tion representations of yourdataset. They can speed updisplay of raster datasets byretrieving only the data that isnecessary at a specifiedresolution.

By default, pyramids are createdfor raster datasets in an ArcSDEgeodatabase by resampling theoriginal data. There are threeresampling methods available:nearest neighbor, bilinear, andcubic.

The default is nearest neighbor.It works for any type of rasterdataset. Use nearest neighborfor nominal data or rasterdatasets with colormaps, suchas land use data, scanned maps,and pseudocolor images.

Use bilinear interpolation orcubic convolution for continu-ous data, such as satelliteimagery or aerial photography.

If you uncheck Build pyramids,pyramids will not be createdwith the output raster. Notbuilding pyramids savesstorage space but will lead toslower display speeds, espe-cially for larger rasterdatasets. u

2

34

Page 221: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 215

Calculating statistics

1. Follow steps 1–4 of ‘Viewingraster geodatabase settingsfor the application’.

2. Calculate statistics ischecked by default. If youpreviously unchecked it,check it.

3. Type a value for the skipfactor in the X and Y direc-tion.

If, for instance, you type avalue of 2 for both, everyother pixel will be skippedwhile calculating statistics. Askip factor of 1,1 ensures full,accurate statistics.

4. If there are values in theraster that you wish to ignorewhile calculating statistics forthe raster, type their values,separated by a semicolon (;).These are usually valuessuch as the background.

5. Click OK.

The Statistics option enablesyou to build statistics foroutput raster datasets createdin a geodatabase. Statistics arerequired for your raster datasetto perform certain tasks inArcMap or ArcCatalog, such asapplying a contrast stretch orclassifying your data. It is notessential to build statistics ifthey have not already beencalculated, since they arecalculated the first time they areneeded. It is, however, recom-mended that you calculatestatistics for your rasterdatasets before using them ifyou want to use certain featuresthat require statistics. Thedefault display of your rasterwill be improved in most casesif statistics have already beencalculated, because a standarddeviation stretch is applied ifstatistics are present.

Setting a Skip factor allows youto speed up the process ofcalculating statistics byskipping pixels. The Skip factoronly applies for file-based orpersonal geodatabase rasterdatasets.

Values you set to ignore willnot participate in the statisticscalculation. Normally you maywant to ignore the values of thebackground. This only appliesfor personal geodatabase rasterdatasets. u

2

3

4

5

Page 222: Geoprocessing in ArcGIS: ArcGIS 9

216 GEOPROCESSING IN ARCGIS

Setting the tile size

1. Follow steps 1–4 of ‘Viewingraster geodatabase settingsfor the application’.

2. Type a value for the tile Widthand the tile Height if you wantto change the default.

3. Click OK.

The tile size setting is used byany tools that create rasterdatasets in an ArcSDEgeodatabase. ArcSDEgeodatabases store rasterdatasets in a data type knownas a binary large object, orBLOB.

The tile size option lets youcontrol the number of pixelsthat are stored in each BLOBand, therefore, lets you controlthe size of each BLOB. It isspecified as the number ofpixels in X (tile width) and Y(tile height).

The default tile size is 128 by128, which is good for mostcases. However, if the tile size istoo big, you will end upbringing up more data than isneeded each time you accessthe data. For example, you wantto display a window of 100 *100 and it only covers one tile.If you set the tile size to be 512,you need to get the tile of 512 *512 pixels. If your tile size is setto 128 * 128, you’ll bring upless extra data if the displaywindow is 100 * 100.

2

3

Page 223: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 217

Specifying rasteranalysis settingsThe Raster Analysis Settingssection of the EnvironmentSettings dialog box providesenvironment settings that willapply when working with toolsthat input or output a raster,either file-based or within apersonal or ArcSDEgeodatabase. Included in thissection are the followingsettings that you can change:the cell size and the mask.These settings are discussed inthe pages that follow. u

Viewing raster analysissettings for theapplication

1. Click Tools on the Mainmenu of the application youare using and click Options.

2. Click the Geoprocessing tab.

3. Click the Environmentsbutton.

The Environment Settingsdialog box is opened.

4. Click Raster AnalysisSettings to view the param-eters for which values can beset.

5. Click OK.

Tip

An alternative way toaccess the EnvironmentSettings dialog boxRight-click in the ArcToolboxwindow and click Environments.

See Also

See ‘About environment settings’earlier in this chapter for informa-tion on setting environments for theapplication, a model, or a processin a model.

1

4

5

2

3

See Also

See ‘Specifying general settings’earlier in this chapter for informa-tion on setting the extent and snapraster for results from runningtools.

Page 224: Geoprocessing in ArcGIS: ArcGIS 9

218 GEOPROCESSING IN ARCGIS

The default cell size, orresolution, for analysis resultsis set to the largest cell size ofthe input raster datasets for atool, the maximum of the inputs.

The default cell size when afeature class is used as input toa tool is the width or the height(whichever is shortest) of theextent of the feature classdivided by 250.

Exercise caution when specify-ing a cell size finer than theinput raster datasets. No newdata is created; cells areinterpolated using nearestneighbor resampling. The resultis as precise as the coarsestinput.

Other options available:Minimum of Inputs sets the cellsize of your analysis results tothe input raster dataset with thesmallest cell size; As SpecifiedBelow enables you to specify acell size for analysis results;and Same as Layer enables youto select an input raster layeron which to base the cell size ofyour analysis results.

For tools that accept onlyfeatures as input, you canspecify the cell size for youroutput raster in the tool’sdialog box. u

Setting the cell size foroutputs

1. Follow steps 1–4 of ‘Viewingraster analysis settings forthe application’.

2. Click the Cell Size dropdownarrow and click the requiredoption.

If you click As SpecifiedBelow, type a value for thecell size.

Alternatively, click theBrowse button and browse toa raster dataset from which totake the cell size.

Note that the option Same asLayer is only available if youare accessing the Environ-ment Settings dialog boxfrom within an ArcMapsession and you have addeda layer to your ArcMapsession.

3. Click OK.

2

3

Page 225: Geoprocessing in ArcGIS: ArcGIS 9

SPECIFYING ENVIRONMENT SETTINGS 219

Sometimes you only want toperform analysis on cells in aparticular area. The maskidentifies those cells within theanalysis extent that will beconsidered when running a tool.If the mask was overlaid on theinput raster you want to use foranalysis, only cells covered bythe mask will be processed. Allother cells will be assigned theNoData value in the result afterrunning a tool.

Setting an analysis mask is atwo-step process. The analysismask must first be created if youdo not already have one. Ananalysis mask can be feature(point, line, or polygon) orraster data. You could create anempty feature class inArcCatalog, then define the areaof interest (the mask) using theArcMap Editor toolbar. Alterna-tively, you could create a maskraster using the Reclassify tool,giving a value to cells you wishto create results for andassigning NoData to the rest.The analysis mask must then beset in the Environment Settingsdialog box.

Setting a mask

1. Follow steps 1–4 of ‘Viewingraster analysis settings forthe application’.

2. Type the path and the nameof the Mask or click theBrowse button, click the Lookin dropdown arrow, andnavigate to the location of themask, then click Add.

3. Click OK.

2

3

Page 226: Geoprocessing in ArcGIS: ArcGIS 9
Page 227: Geoprocessing in ArcGIS: ArcGIS 9

IN THIS CHAPTER

221

Using the Command Line window 7• Starting the Command Line

window

• Working with the command line

• About variables

• Creating variables

• Managing variables

The Command Line window contains a message section and a commandline. When tools are executed—from a tool’s dialog box, the command line, aModelBuilder window, or a script—execution messages appear in themessage section of the window. The command line offers an alternative tousing a dialog box to run a tool. It allows you to type the name of the tooland its parameter values as a string, then execute the tool when you pressEnter. It can be quicker to run a tool at the command line, especially if youare familiar with the tool and its parameter values and you have createdvariables for complex parameters you use frequently. For ArcInfoWorkstation users, the command line usage will be familiar, as it is nearlyidentical to the usage displayed using the Usage command.

Through the Command Line window you can:

• Obtain a list of available tools and environment settings.

• View usage for tools to see the parameter values that must be specified.

• Run tools by entering their names and parameter values.

• Set values for environment settings.

• Create variables for parameter values that you can save and reuse.

• View output messages for environment settings specified or tools run.

• Open the dialog box of a previously run tool, edit parameter values, thenrerun the tool.

Page 228: Geoprocessing in ArcGIS: ArcGIS 9

222 GEOPROCESSING IN ARCGIS

Starting theCommand LinewindowThe Command Line windowconsists of a command line,where you can execute toolsand set values for environmentsettings, and a messagesection.

When you execute tools—froma dialog box, the command line,or within a ModelBuilderwindow or a script—messagesare created. These messagesinclude such information aswhen the tool began executing,what parameter values are beingused, the progress of the tool’sexecution, and warnings ofpotential problems or errors.

Information messages indicatethat an event happened, suchas the progress of a tool’sexecution or the time a tool wasexecuted. By default theydisplay in black text.

Warning messages indicateissues, such as a problem withthe execution of a tool. Bydefault they display in greentext.

Error messages indicate acritical event that will prevent atool from executing. Errors aregenerated when one or moreparameters have invalid values,such as a nonexistent path to u

Opening the CommandLine window

1. Click the Show/Hide Com-mand Line Window button onthe Standard toolbar of theapplication you are workingin.

The Command Line windowis opened and docked withinthe application.

1

CommandLine window

The Command Line window can be used inside any ArcGISDesktop application and is a dockable window, so you canposition it anywhere within the application you are working in oroutside it.

Page 229: Geoprocessing in ArcGIS: ArcGIS 9

USING THE COMMAND LINE WINDOW 223

Docking the CommandLine window

1. Click and drag the bar at thetop of the Command Linewindow to your preferredlocation within theapplication.

2. Drop the panel to dock thewindow.

1

2

Tip

Positioning the windowPress and hold the Ctrl key whilemoving the Command Line windowwithin the application to prevent itfrom docking itself until it is in thedesired position.

data or an invalid keyword. Bydefault they display in red text.

The default font and text colorfor messages (informationmessages, warnings, anderrors), as well as for commandsyou type and processes run,can be altered by right-clickingthe command line or themessage window and clickingFormat.

Page 230: Geoprocessing in ArcGIS: ArcGIS 9

224 GEOPROCESSING IN ARCGIS

Working with thecommand lineType any character at thecommand line to see a list ofavailable commands (tools andenvironment settings) in adropdown list. After typing thename of the command andtyping a space, usage appears.Usage is a command’s param-eter syntax. It shows you theparameters for which valuesmust be specified. u

Getting a list of availabletools and environmentsettings

1. Type any character at thecommand line to see a list oftools and environmentsettings.

Typing tool orenvironment settingnames

1. Type the first few letters of thetool or environment settingname, then use the mousepointer to scroll through thelist and select the tool orenvironment setting that youwant to use.

2. Press the Space key to addthe tool or environmentsetting name to the commandline.

By pressing the Space key, aspace is automatically addedafter the tool or environmentsetting name and the usageis displayed.

Usage helps you supplyvalues for the tool’s or theenvironment setting’sparameters.

See Also

Before running tools at thecommand line, you can choosewhether, by default, you create atemporary result, add the result tothe display, and overwrite existingoutputs. See ‘Results from runningtools’ in Chapter 3 for moreinformation on these options.

Tip

An alternative way to scrollthrough the list of tools andenvironment settingsUse the up and down arrows onthe keyboard to scroll through thelist of tool names and environmentsettings.

2

1

1

Page 231: Geoprocessing in ArcGIS: ArcGIS 9

USING THE COMMAND LINE WINDOW 225

Executing a tool at thecommand line

1. Type the name of the tooland press the Space key toview the usage.

Note that you can type thefirst few characters of the toolname and press the Spacekey to fill in the rest of thename.

2. Give a value for eachparameter, separating eachone with a space.

The parameter that needs avalue specified for it ishighlighted in bold in theusage.

If the tool takes multipleinputs, type parenthesesaround the inputs and asemicolon (;) between eachinput. If your inputs havespaces in the name, encloseeach name with apostrophes.

3. When all parameters haveappropriate values, pressEnter to execute the tool.

4. Examine the output mes-sages in the messagesection of the Command Linewindow.

Tip

Optional parametersTo use the default value for alloptional parameters, instead oftyping a # or “” in place of avalue, simply leave all optionalparameter values blank.

See Also

See Chapter 4, ‘Working withtoolboxes’, for information onadding toolboxes to the ArcToolboxwindow.

1

2

4

To execute a tool at the com-mand line, the toolbox contain-ing the tool must first be addedto the ArcToolbox window.

To execute a tool you’ll firsttype the tool name followed bya series of parameter values.After typing the tool name, typea space to view the usage forthe tool.

The usage helps you supplyappropriate values for param-eters. Required parametersappear between <>, andoptional parameters appearbetween {} in the usage. Youmust specify a value forrequired parameters, but you donot need to specify a value foroptional parameters. You cansimply type a # or “” in place ofoptional parameter values, andthe default value will be used. u

Page 232: Geoprocessing in ArcGIS: ArcGIS 9

226 GEOPROCESSING IN ARCGIS

You can enter multiple com-mands at one time at thecommand line by pressing theCtrl key then Enter after eachline. Once you have entered allthe commands you want to run,press Enter to execute them.

You can run separate com-mands at one time, or you canstring commands together sothe output from one commandis the input for the next com-mand. In the example, theworkspace is set before runningtools so that the path to inputsand outputs does not have tobe given. Then the output fromthe MakeLayer tool (landuselyr)is used as input to the AddJointool, where a table is joined tothe input layer. The layer is inmemory and will be removedafter the current session hasended, so the CopyFeaturestool copies the layer to afeature class. u

Executing multiplecommands

1. Enter a command you wouldlike to run.

2. Press and hold the Ctrl keyand press Enter to typeanother line.

3. Follow steps 1 and 2 untilyou have entered all thecommands you would like torun.

4. Press Enter to execute thecommands.

5. View the messages producedin the message section of theCommand Line window tocheck for any problems withthe execution of thecommands.

Tip

Clearing messagesTo clear messages from themessage section of the CommandLine window, right-click thewindow and click Clear All.

1

5

Tip

Finding and replacing textRight-click the command line andclick Replace to find and replacetext you have entered.

Page 233: Geoprocessing in ArcGIS: ArcGIS 9

USING THE COMMAND LINE WINDOW 227

Executing a tool usinglayers as input data

1. Click the Add Data button inany ArcGIS Desktop applica-tion with a display and addthe data that will be used asinput parameter values.

2. Click Show/Hide ArcToolboxWindow.

3. Right-click the ArcToolboxwindow and click AddToolbox to add the toolboxcontaining the tool you wantto run.

4. Click Show/Hide CommandLine Window on theStandard toolbar.

5. At the command line, typethe name of the tool, then aspace to view the usage forthe tool.

6. Press the down arrow on thekeyboard to select the layeryou want to use.

7. Press the Space key to seethe next parameter in bold inthe usage, for which a valuemust be specified.

8. Continue adding parametervalues as necessary.

9. Press Enter to execute thetool.

Tip

Working with nonuniquetool namesIf you have tools in the ArcToolboxwindow with the same name, youmust concatenate the toolbox aliasname as a suffix to the tool name,separated by an underscore, forexample clip_analysis, then type aspace to view the usage. See thesection ‘Managing toolboxes’ inChapter 4 for information onsetting and getting the alias name.

Tip

Copying and pastingSelect the current string entered inthe command line, right-click, andclick Copy. In the location you wishto paste the string, click Paste.Alternatively, copy and paste astring into the command line.

8

See Also

See ‘About variables’ later in thischapter for information on creatingvariables for parameter values.

6

1

3

4

2

Page 234: Geoprocessing in ArcGIS: ArcGIS 9

228 GEOPROCESSING IN ARCGIS

Setting values forenvironment settings

1. Type the name of the envi-ronment setting. For example,type “Workspace”, then avalue for the <Workspace orFeature Dataset> parameter(the pathname in this case).

2. Press Enter.

In the example, theworkspace is set to thepathname specified. Thisworkspace will be set as thecurrent workspace in theapplication’s EnvironmentSettings dialog box and usedby all relevant tools.

3. Type the name of the tool andpress the Space key to viewthe usage for the tool.

4. The first parameter after thetool name is usually inputdata. In the example, as thevalue for the workspaceparameter is set to thelocation of the input data,only the name or names ofthe input data need to besupplied.

5. When all parameters haveappropriate values, pressEnter to execute the tool.

In the example, the result(P_100.shp) is placed in thelocation on disk set for theworkspace.

See Also

See Chapter 6, ‘Specifyingenvironment settings’, for informa-tion on specifying values forenvironment settings for theapplication, a model, and a processwithin a model.

4

3

1

Before executing tools and asan alternative to specifying anyrelevant values for environmentsettings in the EnvironmentSettings dialog box for theapplication, you can specifyvalues for environment settingsat the command line. Values setfor environment settings at thecommand line will be passed tothe application’s EnvironmentSettings dialog box and will beused by all tools.

The online help for Environ-ment Settings gives examples ofsetting values for environmentsettings at the command line. u

See Also

When working in an ArcGISDesktop application with a display,such as ArcMap, layers from thetable of contents can be used asinputs to appropriate tools that arerun at the command line. See‘Executing a tool using layers asinput data’ earlier in this chapterfor more information.

Page 235: Geoprocessing in ArcGIS: ArcGIS 9

USING THE COMMAND LINE WINDOW 229

Saving commands to atext file

1. After typing a command or aseries of commands, right-click the command line andclick Save As.

2. Click the Save in dropdownarrow and navigate to thelocation where you want tosave the text file containingthe commands.

3. Click the File name text boxand type a name for the textfile, with a .txt extension.

4. Click Save.

Text you enter at the commandline can be saved to a text fileso you can load the text file at alater date. This is particularlyuseful if you use the samestring of commands on a regularbasis. Saving your commandsto a text file means you cansimply load it at the commandline when you want to run thecommands contained within thetext file, alter parameter valuesthat are set, and rerun thecommands.

Any text entered at the com-mand line can be saved, notonly commands. So if you wantto set up the commands thatyou will run and add notes toyourself or another person,simply type the text into thecommand line, then save thetext to a file. Any text enteredthat is not part of a commandwill have to be removed whenyou load the text back into thecommand line window, but itmay be helpful to have a textfile containing pertinentinformation as well as thecommands you will run. u

See Also

See ‘Loading a text file’ later in thischapter for information on loadingthe commands that you have saved.

1

3

2

4

Page 236: Geoprocessing in ArcGIS: ArcGIS 9

230 GEOPROCESSING IN ARCGIS

Loading a text file

1. Right-click the command lineand click Load.

2. Click the Look in dropdownarrow and navigate to thelocation of the text filecontaining commands youwant to run.

3. Click the text file and clickOpen.

The text is entered at thecommand line.

Any text file (.txt) can be loadedat the command line. However,you’ll likely only load text filesthat you created by savingcommands entered at thecommand line. Any other textentered into a text file that isnot part of a command must beremoved before executing thecommands. u

See Also

See ‘Saving commands to a textfile’ earlier in this chapter forinformation on saving the com-mands you have entered at thecommand line to a text file.

2

3

1

Page 237: Geoprocessing in ArcGIS: ArcGIS 9

USING THE COMMAND LINE WINDOW 231

Reexecuting a tool

1. If a tool has not already beenexecuted, follow steps 1–4 of‘Executing a tool at thecommand line’ earlier in thischapter. Alternatively, run atool using its dialog box orfrom within a ModelBuilderwindow or a script.

2. In the message section of thecommand line, right-click thetool that was executed andclick Open.

A dialog box is opened,enabling you to modifyvalues set for parameters.

3. Modify parameter values asnecessary, then click OK toreexecute the tool.

2

3

When a tool is executed, a copyof the tool is placed inside ahistory model by default, soyou can keep track of the toolsperformed in each session. Formore information on historymodels see the task that followsand ‘Keeping track ofgeoprocessing operations’ inChapter 3.

When you open an executedtool, a copy of the run tool istaken from the history modeland displayed via a dialog box,so you can edit the tool’sparameter values, thenreexecute the tool.

If the option to loggeoprocessing operations to ahistory model is unchecked onthe Geoprocessing tab of theOptions dialog box (accessedvia the Tools menu on the Mainmenu of the application you arerunning), you will not be able toreexecute your tools. u

Tip

Shortcuts for recallingpreviously enteredcommandsDouble-click a previously enteredcommand in the message section ofthe Command Line window to enterthe command at the command line.

At the command line, use the upand down arrows on the keyboardto scroll through previouslyentered commands.

Page 238: Geoprocessing in ArcGIS: ArcGIS 9

232 GEOPROCESSING IN ARCGIS

Tip

Disabling history modelcreationIf you don’t want a history model tobe generated for each session, turnthe option off. Click the Tools menuin the application you are runningand click Options. Click theGeoprocessing tab and uncheck theLog geoprocessing operations to ahistory model check box.

See Also

See ‘Keeping track ofgeoprocessing operations’ inChapter 3 for information onhistory models and alternativeways to keep track of performedgeoprocessing tasks.

Viewing history in thecurrent session

1. If a tool has not already beenexecuted, follow steps 1–4 of‘Executing a tool at thecommand line’ earlier in thischapter. Alternatively, run atool using its dialog box orfrom within a ModelBuilderwindow or a script.

2. Right-click the executionstring and click Show History.

3. A model is opened display-ing tool elements for all toolsrun to date in the session.

4. Double-click a tool elementto view the parameter valuesthat were set.

2

This history model displays the tools run in thesession to date. In this particular session, only onetool was run. By double-clicking the tool element, youcan open the tool’s dialog box to view the parametervalues that were set.

4

After executing tools in asession, then closing thesession, a history model isgenerated in the Historytoolbox in the My Toolboxesfolder. It contains tool elementsthat represent the tools run inthe last session. By double-clicking a tool element to openits dialog box, you can view theparameter values that were setfor the tool.

In the Command Line window,you can view the contents ofthe history model as it is beinggenerated, allowing you to viewthe tools that have been runand parameter values that havebeen set to date in the currentsession.

Page 239: Geoprocessing in ArcGIS: ArcGIS 9

USING THE GEOPROCESSING WINDOW 233

About variables

You can type a text string at the command line for all parametervalues that must be specified for a tool to run. However, forparameters that require more complex values, it is easiest andmost efficient to create a variable—by using a dialog box todefine the parameter value—that can be referenced instead oftyping the parameter’s value each time you run a specific tool.

It’s easy to create variables, and it is recommended to create avariable for a complex parameter value rather than typing acomplicated text string. Once you have created a variable, youcan reuse it again and again, reducing the amount of typing eachtime you reexecute a tool.

There are many times when it is useful to create variables forparameter values when running tools at the command line, suchas:

• To avoid typing the pathname to input data.

Instead of typing the pathname to input data each time yourun a tool, you can create variables for each input dataparameter value using a dialog box to specify the path to theinput data.

• When projecting multiple feature classes.

Creating a variable for the coordinate system parameter valuecan speed up the process of projecting multiple featureclasses. Instead of typing the same text string for the value ofthe coordinate system parameter each time you use theProject tool, you can create a variable using a dialog box toset up the coordinate system information you want to applyfor the parameter value.

• When reclassifying datasets.

Instead of typing the old and new values for the remapparameter as a text string, you can create a variable for thisparameter’s value. When you create a variable it opens adialog box where you can type in the new values, add values,

or delete values in a similar way to using the ArcGIS SpatialAnalyst Reclassify tool.

For information on how to create variables, see the tasks thatfollow.

Page 240: Geoprocessing in ArcGIS: ArcGIS 9

234 GEOPROCESSING IN ARCGIS

CreatingvariablesThere are two ways to createvariables. You can create avariable as you type parametervalues and come across a morecomplex parameter, or you cancreate variables at any timeusing the Variable Manager ifyou know the parameter valuesyou’ll be using.

Once you have created avariable, it will display in adropdown list the next time youencounter the same parameterwhen typing a command.Variables can be distinguishedby their icon in the dropdownlist ( ).

Creating a variable whiletyping parameter values

1. Type the name of the tooland press the Space key toview the usage for the tool.

Note that you can type thefirst few characters of the toolname and press the Spacekey to fill in the rest of thename.

2. Give a value for eachparameter, separating eachwith a space.

The parameter that needs avalue specified for it ishighlighted in bold in theusage.

In the example, the Reclas-sify tool and its parametervalues are entered at thecommand line, using a rasterlayer called Landcover asthe value for the <in raster>parameter and landuse asthe value for the <reclassfield> parameter.

3. When you come across aparameter, such as <remap>and you are not sure whatthe value should be, create avariable.

Right-click the parameterand click Insert Variable orpress F8 on the keyboard.

The Insert Variable dialogbox appears, enabling you todefine the value for the u

See Also

See ‘Saving variables’ in thischapter for information on savingvariables so they can be usedbetween applications or for certainprojects.

3

1 2

Page 241: Geoprocessing in ArcGIS: ArcGIS 9

USING THE COMMAND LINE WINDOW 235

parameter using a dialogbox.

In the example, the remapvalues can be entered.

4. When you have set theparameter definition, clickOK.

A variable with a defaultname is added as theparameter value (remap1 inthe example).

5. Press the Space key andcontinue to fill in the rest ofthe parameter values.

6. Press Enter to execute thetool.

7. Examine the output mes-sages in the messagesection of the Command Linewindow.

When the tool is executed,the first message tells youthat the tool is executing. Youcan see that the parametervalue you defined using adialog box is entered as atext string; in the example, itcontains the text “Agriculture4;Forest 6;”, and so on. Thiswould be the text string youwould have had to type forthis parameter value if youhad not created a variable.You can see how mucheasier and quicker it is tocreate a variable for suchcomplex parameters.

4

5

7

Page 242: Geoprocessing in ArcGIS: ArcGIS 9

236 GEOPROCESSING IN ARCGIS

Creating variables usingthe Variable Manager

1. Right-click in the commandline at any time and clickVariables to open theVariable Manager.

2. Click the Add button.

3. Click the name Variable0 andrename the variable tosomething more meaningful.

In the example, a variable(site1) is to be created for ashapefile stored on disk so itcan be used as input data formultiple tools.

4. Click the data type String andscroll to the appropriate datatype for the variable. In theexample, the data type is aShapefile.

5. Click the value Empty andclick Edit to define the valuefor the variable.

In the example, the path tothe input data is defined.

6. Click OK, then click OK onthe Variable Manager dialogbox.

The next time you comeacross a parameter thataccepts this type of input datafor its value, you’ll be able toselect the variable from thedropdown list. It will save youfrom having to type a textstring each time you need tosupply a value.

1

3

4

5

6

Page 243: Geoprocessing in ArcGIS: ArcGIS 9

USING THE COMMAND LINE WINDOW 237

ManagingvariablesWhen you have created avariable, you may want to alterits properties. You can alter thename of the variable, its datatype, or the value you have setfor the variable using theVariable Manager.

For instance, you may want todrop a different field from atable other than what is definedfor the value of the variable,modify the new values definedfor a remap variable, or changethe coordinate system definedfor a coordinate systemvariable. u

Editing variables

1. Right-click the command lineat any time and click Vari-ables to open the VariableManager.

2. Click the property of thevariable you want to alter—its name, data type, or value.

To alter the name property,click the name and type anew one.

To alter the data type prop-erty, click the data typespecified, then select analternative data type from thedropdown list.

To alter the value specifiedfor the variable, click thevalue, then click the button tothe right of the value to alterthe value set.

3. When you have finishedediting the variable’s proper-ties, click OK.

1

2

3

Page 244: Geoprocessing in ArcGIS: ArcGIS 9

238 GEOPROCESSING IN ARCGIS

Removing variables fromthe Variable Manager

1. Right-click in the commandline at any time and clickVariables to open theVariable Manager.

2. Click to the left of the variablename to select the variableyou want to delete.

3. Click Delete.

4. Click OK.

If you create multiple variableswithin the same application,you’ll eventually want to cleanup the Variable Manager andremove the variables you nolonger use. Variables can beeasily deleted from the VariableManager if they are no longerrequired. u

1

2

34

Page 245: Geoprocessing in ArcGIS: ArcGIS 9

USING THE COMMAND LINE WINDOW 239

Saving variables

1. Right-click the ArcToolboxwindow, point to SaveSettings and click either ToFile or To Default, dependingon whether you want to savesettings to a file that can beloaded later, or you want toset the current settings as thedefault for all applications.

2. If you choose To File, click theSave in dropdown arrow andnavigate to the location inwhich you wish to save thesettings file.

3. Click the File name text boxand type a name for the filewith a .xml extension.

4. Click Save.

Tip

Saving variables by savingthe map documentIf you are working in ArcMap andyou save the map document, allcreated variables will be savedwith the map document, so you donot need to save settings in thiscase.

When variables are created inArcCatalog, they are saved tothe default settings whenArcCatalog is closed, or whenthe settings are saved as thedefault. All applications, whenstarted, use the defaultgeoprocessing settings.

When you are switchingbetween different applicationsor you are working on a certainproject, you may want to savethe variables you have speci-fied to a file so you can quicklyload them when they areneeded. Alternatively, you maysave settings as the default soall other applications will usethem.

The way you save variables isby saving geoprocessingsettings. Along with variables,you’ll also save the state of theArcToolbox window and thestate of the EnvironmentSettings dialog box. See‘Geoprocessing settings’ in u

1

2

3 4

Page 246: Geoprocessing in ArcGIS: ArcGIS 9

240 GEOPROCESSING IN ARCGIS

Loading variables

1. Right-click the ArcToolboxwindow, point to LoadSettings and click either FromFile or From Default, depend-ing on whether you want toload settings from a file, oryou want to load the defaultsettings for all applications.

2. If you choose From File, clickthe Look in dropdown arrowand navigate to the locationof your saved settings XMLfile.

3. Click the XML file and clickOpen.

Your saved variables areloaded so they can bereused at the command line.

2

3

1

Chapter 3 to gain more of anunderstanding of whichgeoprocessing settings will besaved.

Page 247: Geoprocessing in ArcGIS: ArcGIS 9

IN THIS CHAPTER

241

Introducing model building 8The geoprocessing tools in ArcGIS make it easy to process spatial data tomodel aspects of the real world. However, when there are many stepsinvolved in your geoprocessing work flow, it can be difficult to keep track ofthe assumptions, tools, datasets, and other parameter values you have used.

One of the easiest ways to author and automate your work flow and keeptrack of your geoprocessing tasks is to create a model. A model consists ofone process or, more commonly, multiple processes strung together. A processconsists of a tool—a system tool or a custom tool—and its parameter values.Examples of parameter values include input and output data, a clustertolerance, and a reclassification table.

A model allows you to perform a work flow, modify it, and repeat it over andover with a single click.

This chapter introduces you to the concept of building models and the ArcGISsolution for building them. Chapter 9 explains the details of building modelsusing the ModelBuilder window.

• What is a model?

• What is the ModelBuilder window?

• Building models

• A model building example

• Creating a new model

Page 248: Geoprocessing in ArcGIS: ArcGIS 9

242 GEOPROCESSING IN ARCGIS

What is a model?

In general terms, a model is a representation of reality. A modelrepresents only those factors that are important to your work flowand creates a simplified, manageable view of the real world.

In ArcGIS, a model is displayed as a model diagram. Youautomate your work flow by stringing processes together in themodel diagram that will execute in sequence when the model isrun.

The simple model that follows contains one process. The Buffertool is used to create an output of buffer zones that are a certaindistance around the input streams.

A more complex model may combine quantitative information, forexample, how far away something is or how much it costs, withqualitative information, for example, how desirable or importantsomething is.

The model that follows considers population density and thedistance to existing parks as factors in selecting a new park site.Areas of high density that are not close to existing parks on thePotential park sites map are the most suitable locations (shown indark purple). Less suitable areas are shown in lighter shades.Gray areas mark the locations of existing parks. In this model,population density is a more influential factor, that is, has a higherweight, in site selection than distance to parks.

The following model illustrates the preceding work flow.

There are five processes in this model. One process calculates thepopulation density from an input population dataset. A secondprocess calculates the distance to parks from a dataset of existingparks. A third process reclassifies the Population Density output,and a fourth process reclassifies the Distance to Parks output. Thefifth process takes the outputs from the two reclassifications anduses them as inputs to the Weighted Overlay process, where

Potential park sites

u

uThis model findsthe most suitablelocation for a newpark. The modelincorporates aWeighted Overlaytool, whereweights areassigned to eachinput based onhow muchinfluence eachshould have insiting a new park.

Distance to parks

Population density60% influence

40% influence

Input streams Output bufferaround streams

u

Geoprocessingbuffer tool

Page 249: Geoprocessing in ArcGIS: ArcGIS 9

INTRODUCING MODEL BUILDING 243

weights are applied to each input dataset based on the percentinfluence each should have. The output suitability map enablesthe decision maker to identify potential park sites.

Why build models?

Building a model helps you manage and automate yourgeoprocessing work flow. Managing processes and theirsupporting data can be difficult without the aid of a model. Asophisticated model contains a number of interrelated processes.At any time, you may add new processes, delete existingprocesses, or change the relationships between processes. Youmay also change assumptions or parameter values, for example,replace old datasets with newer ones, or consider alternativescenarios in which input factors are prioritized differently.Building a model helps you manage this complexity in a numberof ways:

• It makes processes and the relationships between processesexplicit, and the model you create is dynamically updatedwhenever a change is made.

• It lets you set values for the parameters of each tool, and itrecords this information, making the model output easilyreproducible.

• It lets you edit the structure of the model by adding anddeleting processes or changing the relationships between theprocesses.

• It lets you edit the parameter values defined for tools toexperiment with alternative outcomes.

Page 250: Geoprocessing in ArcGIS: ArcGIS 9

244 GEOPROCESSING IN ARCGIS

The ModelBuilder window is the interface you use to create models in ArcGIS. A ModelBuilder window is displayed immediately whenyou create a new model; see Chapter 5, ‘Working with toolsets and tools’, for details on how to create a new model. The ModelBuilderwindow consists of a display window in which you build a diagram of your model, a Main menu, and a toolbar that you can use tointeract with elements in your model diagram. You can run a model from within the ModelBuilder window or from its dialog box.

There are five pulldown menus on the Main menu. The Model menu contains options for running, validating, viewing messages, saving,printing, importing, exporting, and closing the model. You can also use this menu to delete intermediate data and set properties for themodel. The Edit menu lets you cut, copy, paste, delete, and select model elements. The View menu contains an Auto Layout option thatapplies the settings specified in the Diagram Properties dialog box to your model. It also contains options for zooming in and out. TheWindow menu contains an overview window that you can use to display the entire model while you zoom in on a certain part of themodel in the display window. From the Help menu, you can access the ArcGIS Desktop online Help system and the About ModelBuilderbox.

The toolbar gives you quick access to much of the available functionality in the ModelBuilder menus and more.

What is the ModelBuilder window?

Modeldiagramin thedisplaywindow

ToolbarMain menu

A process

Model elements

ContinuousZoom

Add Data orTools

Save

Print

Cut

Copy

PasteAutoLayout

FullExtent

ZoomIn

ZoomOut

Zoom

Pan Navigate

Select

AddConnection

Run

Page 251: Geoprocessing in ArcGIS: ArcGIS 9

INTRODUCING MODEL BUILDING 245

Building modelsInside a ModelBuilder window, the display window is the workingarea where you build a diagram of your model. The diagram youbuild looks like a flowchart. It consists of processes linkedtogether that will run in sequence when the model is run.

Elements in the model diagram represent tools and their parametervalues. A process consists of a tool element and its parametervalues. In a typical process, elements represent the input dataparameter value, the tool that operates on the input dataparameter value, and the derived data parameter value. Connectorlines indicate the sequence of processing. When you supply avalue for an input data parameter, either within the tool’s dialogbox or by dragging data into the ModelBuilder window, theelement created is a variable that can be shared betweenprocesses. Variables can be created for any parameter, making iteasy to share any parameter value between processes.

There will often be several processes in a model, and they can bechained together so that the derived data from one processbecomes the input data for another process.

The diagram that follows is a conceptual overview of a modelbuilt from three processes.

Each element in a model has a unique symbol.

Project data elements represent the geographic inputdata that exists before the model runs. The datareferenced by these elements is used as inputparameter values for tools in a model. Project dataelements are represented by dark blue ovals and arevariables by default. Variables expose parametervalues so they can be shared between processes.

Tool elements represent the operations to beperformed on input data parameter values. Toolelements are represented as yellow rectangles.

Derived data elements represent the output datacreated by a tool. Data referenced by these elementsdoes not exist until the model is run. The exception iswhen running a tool that updates the project data,such as Add Field. In this case, the derived data isactually the project data, with an additional fieldadded. Derived data from one process can serve asinput data for another process. Derived data

A conceptual overview of a model: A model containsprocesses, and a process contains a tool element andits parameter values. In the example above, project andderived data parameter values are shared betweenprocesses.

Inputvariable Tool

Derived datavariable

Elements in the model

Process

Page 252: Geoprocessing in ArcGIS: ArcGIS 9

246 GEOPROCESSING IN ARCGIS

elements are represented by green ovals and arevariables by default. Variables expose parameter valuesso they can be shared between processes.

Value elements reference nongeographic dataparameter values. Values set for these elements can beused as input to tools in a model where appropriate.Examples include a constant value used to multiply thecell values in a raster dataset or the cluster tolerancevalue for a tool to use. Value (or nongeographic data)elements are represented by light blue ovals.

Derived value elements reference nongeographic dataparameter values that are created by running a tool. Anexample of a derived value is the output value fromrunning the Calculate Default Cluster Tolerance tool.Derived values from one process can serve as inputvalues for other processes. Derived value elements arerepresented by light green ovals.

A connector is a line showing the sequence ofprocessing. Data elements and tool elements areconnected together. The connector arrow shows thedirection of processing.

In addition to the basic model elements, there are text labels,which are graphical elements that place explanatory text in amodel. A label is not part of the processing sequence. The defaulttext for elements can be changed, and labels can be attached toelements or float free in the model diagram.

A model can be simple or complex. The simplest possible modelcontains a single process. In the model that follows, stream datais processed to create a dataset of buffer zones around streams.You can see the flow of project data (Input Streams) into theBuffer tool and from the Buffer tool to the derived data (OutputStreams Buffer).

In the model that follows, the land parcels and the 100-year floodboundary are intersected to identify those land parcels that fallwithin the flood boundary.

Models become more complex as processes are added. The modelbelow has two parallel processes that share the same input data.The model generates two output datasets from one inputelevation dataset.

Page 253: Geoprocessing in ArcGIS: ArcGIS 9

INTRODUCING MODEL BUILDING 247

You can chain processes so that the output of one processbecomes the input to subsequent processes. In the model thatfollows, one process interpolates a continuous elevation surfacefrom an input dataset of measured elevation points. The deriveddata (Output Elevation Grid) is the input data to a second processthat derives elevation contours.

The model below finds suitable residential properties that are forsale. Suitable properties are those that are within an appropriateprice range, less than five miles from a school, and outside theworst crime areas. First, buffer zones are created around schoolsto find residential areas close to schools. Next, crime zones,property parcels for sale, and school buffers are unioned togetherto produce an output dataset. The output features will have theattributes of the input features they overlap. The union output isthen queried using the Make Feature Layer tool to identify thedesired property parcels. The expression used in the MakeFeature Layer tool will select from the Union Output attributetable those property parcels that are appropriately priced, fallinginside the school buffer and outside high crime areas.

Page 254: Geoprocessing in ArcGIS: ArcGIS 9

248 GEOPROCESSING IN ARCGIS

Common spatial modeling questions involve finding a suitablelocation for a specific use, such as the best place to locate abusiness, storage site, pipeline, or park.

The goal

Before creating a model, you should ask, “What is the goal?”

In the following example, the goal is to find the easiest routethrough the landscape from Start to Finish.

Factors influencing the goal

The second question you should ask is, “What factors willinfluence the goal?”

In the example, the route must avoid the locations that can beseen by the people in the two observation towers, it must travelthrough vegetation types that are easiest to traverse, and it musttravel through areas where the terrain is less steep.

Identifying input datasets

Once you have answers to the above two questions, you candecide on the input data you will need to help you achieve yourgoal.

In this example, the following input data is required:

• Elevation data to create a slope dataset that will enable areasof steep terrain to be identified and to create a viewsheddataset that will enable areas that can be seen from theobservation towers to be identified

• Vegetation data to enable vegetation types that are easiest totravel through to be identified

• The location of the starting point for the path

• The location of the finish point for the path

• The location of the observation towers

Deriving datasets

You should decide whether any datasets need to be derived fromyour inputs in order to achieve your goal.

In this example, in order to reclassify a slope dataset to identifyareas suitable for travel, the slope of the terrain needs to bederived from an elevation dataset using the Slope tool.

A model building example

Input elevation Output slope

Slope tool

Areas shaded in red are thelocations with the steepestslopes

The goal: to find the easiest route from Start to Finish

Page 255: Geoprocessing in ArcGIS: ArcGIS 9

INTRODUCING MODEL BUILDING 249

The viewshed from the observation towers also needs to becalculated using the elevation data and the observation towerlocations to identify those areas that can be seen from theobservation towers.

Creating a suitability map

In order to calculate a path through the landscape, the next stepis to calculate how suitable each area (or cell) is to travel through,or how much it will cost to travel through each cell. This process,often referred to as weighted overlay, can be used for any kind ofsite selection or suitability model.

There are two steps involved in this process. First you would usethe Reclassify tool to determine the categories or classes for eachinput factor and assign them a value representing how difficult ordesirable it is to travel through a cell with those characteristics.You would then weight each input dataset by its overallimportance using the Weighted Overlay tool.

Input elevation

Output viewshed

Input observationtowers

Areas shaded inred can be seenfrom theobservationtowers.

Reclassifying derived data

Reclassification involves assigning higher or lower values tomore suitable locations (or cell values). By examining the valueswithin each dataset, you can determine which are more suitable.In this example, suitable values are those that represent ease oftravel. Values for cells that represent grasslands in the inputvegetation dataset will be given a lower value when reclassifyingbecause they are easiest to travel through. If the range of newvalues to assign was from 1–10, values representing grasslandswould be given a new value of 1.

Input vegetation

Input viewshed

Input slope

Reclassifiedviewshed

Reclassifiedslope

Reclassifiedvegetation

Page 256: Geoprocessing in ArcGIS: ArcGIS 9

250 GEOPROCESSING IN ARCGIS

Weighting datasets

By combining the reclassified datasets using the WeightedOverlay tool, a higher influence (or weight) can be assigned tocertain datasets. If all inputs share the same influence, you canassign each of them an equal percentage of influence. However,some datasets might require more influence in the weightedoverlay process. For example, it might be more important to avoidsteep slopes than to pass through vegetation types that areeasiest to travel through.

Reclassifiedvegetation

Reclassifiedviewshed

Reclassifiedslope

Output suitabilitymap

Areas in greenare easiest totravel through

Identifying the path through the landscape

Once the suitability map (or the cost surface) has been created,you can use it to assess the suitability of a location for aparticular purpose. In the output suitability map, areas that areeasiest to travel through are displayed in green, and areas that aremore difficult to pass through are displayed in red.

To calculate the least-cost path through the landscape, use theCost Distance tool. It takes the cost surface created from theWeighted Overlay tool and calculates from each location (cell) theaccumulated cost of traveling from any location back to thestarting point. It also calculates which direction to take from anyparticular location back to the starting point using the least costlyroute.

The last process in this model uses the Cost Path tool andcalculates a path through the landscape from the finish pointalong the least costly path back to the starting point.

Page 257: Geoprocessing in ArcGIS: ArcGIS 9

INTRODUCING MODEL BUILDING 251

Finish point

Easiest paththrough thelandscape

Starting point

Cost surface

Outputdistance raster

Outputdirection raster

A typical geoprocessing work flow. The resultant path takes the easiest route through areas where the terrain is less steepand the vegetation less harsh (areas shaded in green) and avoids those areas (shaded in dark red) that can be seen bythe people in the observation towers.

You can see in the graphic that follows that the path takes the easiest route through areas where the terrain is less steep and thevegetation less harsh (areas shaded in green) and avoids those areas (shaded in dark red) that can be seen by the people in theobservation towers.

Page 258: Geoprocessing in ArcGIS: ArcGIS 9

252 GEOPROCESSING IN ARCGIS

Below is a summary of the series of steps you would take tocreate a new model.

Creating a model

When you create a new model in a toolbox in either theArcCatalog tree or ArcToolbox window, a ModelBuilder windowopens, allowing you to start building your model.

For more information on creating a new tool, see Chapter 5,‘Working with toolsets and tools’.

Building the model

There are multiple ways to add data and tools to a model. Clickthe Add Data or Tools button and add data, or drag input datafrom the ArcCatalog tree or layers from the table of contents ofany ArcGIS Desktop application with a display (such as ArcMap).Alternatively, supply the input data parameter values inside thetool’s dialog box.

Click the Add Data or Tools button and add tools from withintoolboxes on disk, or drag a tool from the ArcCatalog tree or theArcToolbox window.

Double-click the element that represents the tool to supply thenecessary parameter values for that tool. After adding a tool, youcan also drag appropriate input data onto the tool, and the inputdata parameter value in the tool’s dialog box will be suppliedautomatically.

Continue to add data and tools and supply values for parameterswithin each tool’s dialog box. Connect processes until your modeldiagram is complete.

Creating a new model

u

Page 259: Geoprocessing in ArcGIS: ArcGIS 9

INTRODUCING MODEL BUILDING 253

Saving and renaming the model

Once you have built your model, you should rename it to reflectits contents. You can rename the default name given to the modeland its label. The label is the display name for the model. If youare referencing the model at the command line or within a script,you’ll use the name.

You should then save the model. Note that it is good practice toalso save the model as you are building it.

Running the model

You can either run the model from within the ModelBuilderwindow, or you can close the ModelBuilder window and run themodel from its dialog box.

Generally, you’ll run the model from within the ModelBuilderwindow as you are building it to ensure you are getting theresults you expect from each process. You can run the entiremodel, only the processes that have not already run, or individualprocesses.

Setting model parameters

You’ll likely want to set certain parameters as model parameters,so the user of your model can specify values for these parameterswhen running your model from its dialog box. You can do this inthe ModelBuilder window or in the model’s properties dialog box.By setting model parameters you can control which parametervalues the user of the model can specify and which are hardcoded inside the model. For instance, you might want users to beable to specify the input dataset they want to use.

Page 260: Geoprocessing in ArcGIS: ArcGIS 9

254 GEOPROCESSING IN ARCGIS

Once you are happy with the model and have set the requiredparameters as model parameters, save the model and open itsdialog box to view the parameters that are set.

Modifying the model

You can easily modify parameter values in the model to explore“what if” scenarios and obtain different solutions, such asapplying the same model to different geographic areas bychanging the input data.

Documenting the model

You can create documentation for the model, including a summaryof what the model does, an explanation of which input data itaccepts, and a description of the expected results. You caninclude an illustration, parameter information, and example codefor running the model at the command line or inside a script.

Documentation helps the user of your model. It providesinformation about what the model does and describes theparameter values that must be set.

For more information on documenting tools, see Chapter 5,‘Working with toolsets and tools’.

Sharing the model

You can share a model with others by sharing the toolbox thatcontains the model. However, sharing the toolbox does not sharethe data, scripts, Help files, or stylesheets it uses. To be sure youshare all sources of information and that the path to allinformation sources will not have to be repaired, set relativepathnames for your model, then archive your geoprocessing workusing an archiving program. See ‘Sharing your geoprocessingwork’ in Chapter 3 for more information on distributing your work.See ‘Storing relative pathnames’ in Chapter 5 for information onrelative paths.

Sharing a model lets you open your methodology to widerscrutiny and helps you refine and standardize modelingtechniques. Models can be dragged into other models as withany system tool, allowing you to incorporate model componentsthat have been developed by experts in various disciplines.

This chapter has introduced the concept of building models andexplained the process of creating a new model. The next chapterwill explain in more detail the various aspects of building modelsin the ModelBuilder window.

Page 261: Geoprocessing in ArcGIS: ArcGIS 9

IN THIS CHAPTER

255

Using the ModelBuilder window 9The ModelBuilder window provides a graphical environment in which you canbuild models. The previous chapter introduced building models and theModelBuilder window. This chapter explains in more depth how to build andwork with models in the ModelBuilder window.

When you start working with the ModelBuilder window you’ll find that:

• You can build a model by stringing processes together.

• You can construct processes by adding tools and setting values for theparameters of each tool.

• You can share parameter values between processes.

• You can set model parameters inside the ModelBuilder window so that thevalues for these parameters can be set when the model is run from itsdialog box.

• You can change the default diagram properties to change the layout of themodel or the symbology applied to elements.

• You can add text labels to the display window or attach labels to elementsor connector lines.

• You can navigate easily in the model using the zoom or pan tools.

• You can easily repair an invalid parameter value or tool reference.

• You can print your model and generate a report.

• You can import existing models created in ArcView GIS 3, and you canexport models to scripts or graphics.

• Building a model

• Element states

• Running a model

• Working with variables

• About intermediate data

• Controlling the flow of processing

• Using the Select Data tool

• Working with model elements

• Working with diagram properties

• Navigating in the model

• Validating and repairing a model

• Print setup

• Generating a report

• Documenting a process

• Importing and exporting a model

Page 262: Geoprocessing in ArcGIS: ArcGIS 9

256 GEOPROCESSING IN ARCGIS

Building a modelYou use the ModelBuilderwindow to build models. Whenyou create a new model inside atoolbox, the ModelBuilderwindow opens automatically soyou can start to build yourmodel.

You can edit existing models atany time. u

See Also

See Chapter 4, ‘Working withtoolboxes’, for information oncreating toolboxes and Chapter 5,‘Working with toolsets and tools’,for more information on creating anew model inside a toolbox.

Editing a model

1. Right-click a model in atoolbox and click Edit.

The ModelBuilder windowopens so you can add ormodify the processes in themodel.

See Also

See Chapter 8, ‘Introducing modelbuilding’, for more conceptualinformation about building models.

1

Page 263: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 257

Dragging tools into theModelBuilder window

1. In the ArcCatalog tree or theArcToolbox window, open thetoolbox containing the toolyou wish to add.

2. Click and drag the tool intothe ModelBuilder window.

Elements representing thetool and the derived data thetool will create are added tothe display window.

The derived data element isa variable that can beconnected to other processesin the model.

To build processes you addtools into the ModelBuilderwindow, then supply values forthe parameters of each tool.

Both system tools and customtools can be dragged into theModelBuilder window. u

2u

Tip

Embedding a model insideanother modelWhen you drag a model into theModelBuilder window, you canright-click the model and click Editto open the model inside itsModelBuilder window. Embeddingmodels inside other models reducesthe complexity of any one model.

See Also

For more information aboutvariables, see ‘Working withvariables’ in this chapter.

See Also

See ‘Element states’ in this chapterfor more information on thebehavior of elements within amodel.

Page 264: Geoprocessing in ArcGIS: ArcGIS 9

258 GEOPROCESSING IN ARCGIS

Setting values for a tool’sparameters

1. After dragging a tool into aModelBuilder window, right-click the tool and click Open.

2. Supply values for all requiredparameters and for optionalparameters if desired.

Optional parameters havethe word (optional) writtennext to the name of theparameter.

A default value is always setfor output parameters. It canbe modified if desired.

3. Check to be sure there areno icons to the left of anyparameters.

A green circle indicates thata parameter needs a valueset.

A red cross indicates that aninvalid parameter value hasbeen specified.

4. Click OK.

An element is automaticallycreated for the input dataparameter, and it is con-nected to the tool.

The input data element is avariable that can be sharedbetween processes.

The process should now becolored in, meaning it isready to run.

See Also

See ‘Working with variables’ in thischapter for more information oncreating and connecting variablesand setting variables as modelparameters that will display in themodel’s dialog box.

1

4

Values for parameters can be setinside the tool’s dialog box.

If you are working in an ArcGISDesktop application with adisplay, such as ArcMap orArcGlobe, and you have addedlayers to the table of contents,appropriate layers will displayin the input data parameterdropdown list inside a tool’sdialog box. Alternatively, youcan browse to data located ondisk by clicking the Browsebutton next to the parameter.

Values must be supplied forrequired parameters. You canchoose to accept the defaultvalue for optional parameters orchoose to change it. You’llknow if you need to supply avalue for a parameter if a greencircle is present to the left ofthe parameter. If, after supply-ing a parameter value, a redcross appears to the left of theparameter, the value entered isinvalid. u

Page 265: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 259

Dragging and droppingproject data

1. Click the project data thatyou wish to use and drag itinto the ModelBuilderwindow.

Data can be dragged fromthe ArcCatalog tree, or youcan drag layers from thetable of contents of any otherArcGIS Desktop application,such as ArcMap.

An element representing theproject data is added to thedisplay window.

The project data element isan input variable that can beconnected to other pro-cesses in the model.

2. Click Add Connection.

3. Click the input variable.

4. Click the tool you want toconnect it to.

If the value set for thevariable is of the correct inputdata type, the variable willconnect to the tool. When allrequired parameter valuesare set, the process will becolored in.

u

1

2

Instead of supplying the valuefor input parameters inside thetool’s dialog box, you can dragproject data from theArcCatalog tree or from thetable of contents of any otherArcGIS Desktop application,such as ArcMap, into theModelBuilder window. Theelement that is added referencesthe project data on disk and is avariable that can be connectedto tools.

When you connect a projectdata variable to a tool, the valueset for the variable will be usedby the input parameter in thetool’s dialog box. u

Tip

Dragging multiple inputsinto the ModelBuilderwindowYou can drag multiple inputdatasets into the ModelBuilderwindow from the ArcCatalog tree.Click the folder or geodatabasecontaining the datasets, then clickthe Contents tab and click multipledatasets while holding down theCtrl or Shift key. With the datasetsselected, click and drag them intothe ModelBuilder window.

Tip

Adding tools and dataYou can click the Add Data orTools button in the ModelBuilderwindow and browse for data ortools.

3 4

Page 266: Geoprocessing in ArcGIS: ArcGIS 9

260 GEOPROCESSING IN ARCGIS

You can drag data into themodel and place it directly on atool. In doing so, a project datavariable is created and attachedto the tool. The value set forthe variable is used by the inputdata parameter in the tool’sdialog box. This provides aquick way to connect projectdata to a tool.

Project data can be draggedfrom the ArcCatalog tree or fromthe table of contents of anyother ArcGIS Desktop applica-tion, such as ArcMap. u

Dragging project data onto atool

1. Click and drag the projectdata that you want to usedirectly onto a tool in thedisplay window.

An element representing theproject data is added to thedisplay window and isautomatically connected tothe tool.

The project data element is avariable. The value set for thevariable is used by the inputdata parameter in the tool’sdialog box. The variable canbe connected to otherprocesses in the model.

u

1

Tip

Using appropriate valuesfor parametersIf you find you can’t use a particu-lar value for a parameter, the valueyou are trying to use is not of thecorrect data type for the parameter.All inappropriate data types arefiltered out of the Browse dialogbox and the dropdown list for aparameter, and you cannot connecta variable containing an inappro-priate value to a tool using the AddConnection tool.

See Also

You can choose to be prompted toselect the parameter you want toapply a variable’s value to whenconnecting variables to tools. See‘Displaying valid parameters whenconnecting variables’ in thischapter for more information.

Page 267: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 261

Renaming a model

1. Click Model, then click ModelProperties.

2. Click the General tab.

3. Type a name for the model.

This is the name you’ll usewhen running the model atthe command line or whenadding it to a script.

4. Type a label for the model.

This is the display name forthe model. The display nameappears as the name of themodel in its toolbox in theArcCatalog tree or theArcToolbox window.

5. Click OK.

Tip

An alternative way torename a modelRight-click the model in its toolboxin the ArcCatalog tree or theArcToolbox window and clickRename. Note that you should notalter the name of a model this wayif you are currently editing it. Whenthe model is saved, the currentname set in the Model Propertiesdialog box will be applied.

Saving a model

1. Click Model, then click Save.

The model is saved with itsexisting name and label.

1

432

5

1

Tip

Problems saving a modelIf the toolbox that contains yourmodel is read-only, you will not beable to save any changes you havemade to the model. Make thetoolbox writable to save yourchanges.

While building a model byadding processes and connect-ing them together, you shouldsave your model. When yousave a model, any additions orchanges made to the model aresaved.

You can change the displayname and the label for themodel via the Model Propertiesdialog box. It is best to changea model’s default name andlabel to something moremeaningful, so you can easilyfind the model the next time youwant to access it.

Page 268: Geoprocessing in ArcGIS: ArcGIS 9

262 GEOPROCESSING IN ARCGIS

Element states

Each process in a model is in one of three states:

• Not ready to run

• Ready to run

• Has been run

The state of a process depends on the state of its elements. Aprocess is ready to run when each of its elements is ready to run.

By default, elements that are not ready to run are symbolized inwhite. An element is not ready to run if the required parametervalue or values for that element have not been set. When youinitially drag a tool into a ModelBuilder window, the tool is in anot ready to run state because the required parameter valueshave not been specified, as the graphic that follows shows.

Elements that are ready to run are symbolized in color—input (orproject) data elements are blue, tool elements are yellow, andoutput data (derived data) elements are green. A process is readyto run when all elements have been supplied with the requiredparameter values.

This process is not ready to run.

This process is ready to run.

When a process has run successfully, the tool and derived dataelements are displayed with drop shadows, indicating that theprocess has run and the derived data has been generated.

This process has been run.

Page 269: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 263

Running a modelThere are three ways to run amodel from within theModelBuilder window:

• Run the processes that areready to run that have notalready been run.

• Run all processes includingthose that are ready to runand those that have alreadybeen run. u

Running only the ready-to-run processes

1. Click the Model menu andclick Run.

Alternatively, click the Runbutton on the ModelBuilderwindow toolbar.

All processes that are in aready-to-run state will run. Inthe example, only the Selectand Erase tools will run. TheBuffer tool has already beenrun, indicated by the dropshadow around the tool andderived data elements. Thisprocess will not run again.

Running all processes

1. Click the Model menu andclick Run Entire Model.

All processes will run,including those that havealready run, such as theBuffer tool in the example.

See Also

In addition to running a modelwithin a ModelBuilder window, youcan run the model from its dialogbox. See Chapter 5, ‘Working withtoolsets and tools’, for moreinformation. See ‘Setting a model’sparameters’ in this chapter forinformation on setting parametersthat will display on the model’sdialog box.

1

1

Page 270: Geoprocessing in ArcGIS: ArcGIS 9

264 GEOPROCESSING IN ARCGIS

Running a single process

1. Right-click the tool of theprocess you want to run.

2. Click Run.

• Run a particular process inthe model by itself. If theprocess the tool belongs tois linked to a chain ofprocesses, earlier processesin the chain will also run ifthey have not already beenrun. Later processes in thechain of processes will notrun, but if they have alreadyrun, their status will changeto ready to run. u

2

Page 271: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 265

Adding derived data tothe display

1. Either before or after runninga process, right-click thederived data element andcheck Add To Display.

The derived data is added asa layer to the display if theprocess has been run.

If the process has not yetbeen run, the derived datawill be added to the displaythe next time it is run.

By setting the Add To Displayproperty for derived dataelements, the data referencedby these elements will beadded as layers to the table ofcontents of the ArcGIS Desktopapplication you are working inafter their processes have run,provided you are not working inArcCatalog.

The layers added will honor the‘Results are temporary bydefault’ setting in the Optionsdialog box, accessed via theTools menu on the Standardtoolbar.

The Add to Display option onlyapplies to data created byrunning a model within theModelBuilder window. When amodel is run from its dialog box,only data referenced by deriveddata variables that are set asmodel parameters (seen in themodel’s dialog box) will beadded to the display. The userof a model usually only caresabout the final result, not theintermediate data created by themodel. u

1

Page 272: Geoprocessing in ArcGIS: ArcGIS 9

266 GEOPROCESSING IN ARCGIS

See Also

Before running a model, you canvalidate it to check that all the toolreferences and parameter valuesset are valid. Any errorsencountered when validating canbe viewed in the model’s report ora tool’s Messages dialog box withinthe ModelBuilder window. Invalidtool references or parametervalues can be repaired. See‘Validating and repairing a model’in this chapter for moreinformation.

When you run a tool, statusmessages are displayed in theprogress dialog box and also inthe message section of theCommand Line window (pro-vided it is open). The statusmessages give the followinginformation for each tool run:the parameter values specified,the time the tool was run, thestatus of the execution, and thetime the tool finished executing.If errors occur when a tool isexecuting, these messages willalso be displayed.

Status messages produced forall tools in the model can alsobe viewed within theModelBuilder window. You canview messages for all tools orjust the messages that relate toa particular tool.

Viewing all statusmessages

1. After running tools inside theModelBuilder window, clickthe Model menu and clickReport.

2. Check to display a report in atemporary window or to savea report to a file.

If saving a report to a file,click the Browse button andnavigate to the location ondisk into which you want tosave the file. Type a name forthe file and click Save.Alternatively, type the path toa location and type a namefor the XML file (with a .xmlextension).

3. In the temporary window, orafter navigating to thelocation of the XML file youcreated on disk and openingthe XML file using InternetExplorer, scroll to theProcesses section andexpand the contents of oneof the tools.

4. Expand the Messagessection to see messages forthe tool.

5. Click OK.

2

4

3

5

1

Page 273: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 267

Viewing status messagesfor a single tool

1. After running a tool inside theModelBuilder window, right-click the tool for which youwish to see status messagesand click View messages.

Status messages aredisplayed in a Messagesdialog box.

2. Click OK to close the Mes-sages dialog box.

1

2

Page 274: Geoprocessing in ArcGIS: ArcGIS 9

268 GEOPROCESSING IN ARCGIS

Using nonexistent output data

After adding a tool to a ModelBuilder window and supplying itsparameter values, the tool usually knows the properties of thederived data it will create, so you can connect the derived data asinput for the next tool without having to first run the initial tool.

In the following example, the Add Join tool accepts a layer as theinput to which other layers, feature classes, or tables can bejoined. The Make Feature Layer tool knows the properties of theoutput it will create—a layer that is based on the input featureclass on disk and the parameter values specified within the tool.As the properties of the derived data ‘Roads Layer’ are known,the Add Join tool can use this information to provide choices forits input parameter values, such as available fields.

In some cases, if the derived data does not exist (in other words,the preceding tool has not been run), the succeeding tool cannotextract the information it needs in order to populate parameterswith available values. You’ll encounter this when creating amodel. You might come across a parameter for which you expect

to see a choice list displaying available values, such as a list offields. Examples of such cases include when connecting thederived data from a process that runs a script as input for anothertool or when connecting the derived data from a data conversiontool, such as the Import From Interchange File tool, as input foranother tool.

In the example that follows, the Import from Interchange File toolis used to create a coverage from an E00 file of soil types. TheDissolve tool takes the output from the Import From InterchangeFile tool and dissolves the boundaries between soil polygons ofthe same type. As the Import From Interchange File tool has notyet been run, the Dissolve Item parameter in this tool’s dialog boxdoes not know what the available fields are that could be used asthe Dissolve field.

If a tool in your model is not able to set its output propertieswithout being run, this will propagate through all succeedingtools in your model. In the example below, the Index Itemparameter on the Index Item tool has no items available becausethe Import From Interchange File tool has not been run.

Page 275: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 269

If values are known, type values for parameters if availableparameter values are not presented for you in a tool’s dialogbox. In the example, the name of the field in the coveragethat will be used for the dissolve is entered (SOIL011-ID).

When you encounter such a situation, you have two options:

1. If you know the behavior of the tools in your model and knowwhat derived data they will create, you can type the values forparameters in the tool’s dialog box and continue to build yourmodel. In some tool dialog boxes, you can click to add itemsto lists (such as using the Add Field button), then enter thetext for the item.

2. If you are unsure of a tool’s behavior and the next tool in yourmodel requires information from this tool in order to providechoices for its parameter values, simply run the tool. Valueswill appear for parameters in the succeeding tool’s dialog box.This happens because the input parameters are known oncethe preceding tool has been run.

Run the preceding tool (Import From Interchange File in theexample) to populate the available parameter values in thesucceeding tool’s dialog box (Dissolve in the example).

Page 276: Geoprocessing in ArcGIS: ArcGIS 9

270 GEOPROCESSING IN ARCGIS

Working withvariablesYou can think of a variable as a‘container’ that holds a valuethat can be changed. In thecontext of a model, a variablecan be created and its valueused in place of a parametervalue.

Reasons to create variables:

• You may want to share thevalues set for variablesbetween processes. To keepyou from having to supply avalue for a parameter eachtime it is required in a tool’sdialog box, you can simplyuse the value set for thevariable each time it isneeded.

• You may want to createempty variables simply toconstruct a model as a planof the work flow you willfollow.

• You may want to setvariables as model param-eters that will display in themodel’s dialog box. u

Connecting variablesusing the AddConnection tool

1. Click the Add Connectiontool.

2. Click the variable containingthe value that you want toshare between processes.

3. Click a tool to which youwant to connect the variable.

4. Click the variable again.

5. Click the next tool to whichyou want to connect thevariable.

Continue steps 2 and 3 untilyou have shared the variablewith all desired tools.

Connecting variablesusing the parameter’sdropdown list

1. Double-click a tool.

The tool’s dialog box opens.

2. Click the dropdown list forthe parameter and select thevariable.

The variable’s value is usedby the parameter.

3. Click OK.

Continue steps 1–3 until youhave shared the variablewith all desired tools.

15

2

3

4

1

2

3

Tip

Selecting variablesA variable is identified by its iconin a parameter’s list of values.

Page 277: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 271

Displaying validparameters whenconnecting variables

1. Click the Tools menu andclick Options.

2. Click the Geoprocessing tab.

3. Check When connectingelements, display validparameters when more thanone is available.

4. Click OK. u

If you connect a variable to atool and the variable’s value isaccepted by more than onepossible parameter, you mayfind that you’ll have to openthe tool’s dialog box and alterthe parameter values set toapply the value set for thevariable to the correct param-eter.

You can choose to be promptedto select the correct parameterwhen connecting variables totools.

For instance, the Clip tool hastwo input parameters: an InputFeatures parameter and a ClipFeatures parameter. You canchoose to be prompted to applythe value set for the variable tothe correct input parameter forthe Clip tool. u

1

2

3

4

Page 278: Geoprocessing in ArcGIS: ArcGIS 9

272 GEOPROCESSING IN ARCGIS

5. Inside your model, connectthe input variable to a tool.

If the value set for thevariable could be applied tomultiple parameters, theSelect Parameter dialog boxwill display.

6. Click the parameter to whichyou want the variable’s valueto be applied, then click OK.

6

5

Page 279: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 273

Creating a variable for aparameter

1. Right-click the tool and pointto Make Variable.

2. Click From Parameter andclick the parameter for whichyou want to make a variable.

The variable is added as anelement in your model and isautomatically connected tothe tool.

3. Right-click the variable andclick Open.

4. Specify or alter the value forthe variable and click OK.

The variable is colored in,meaning it has a value setand is ready to run.

A variable is created when youdrag data from the ArcCatalogtree onto the ModelBuilderwindow or supply a value forinput dataset parameters insidea tool’s dialog box. The valueset for the variable is the inputdata on disk. Variables areautomatically created for inputand output data because youusually want to connectprocesses in your modeltogether.

All other parameters for a toolmust be set as variables beforethey can be shared betweenprocesses. u

The buffer distance parameter is set as a variable to expose theparameter, so the value set for the parameter can be sharedbetween processes.

2

See Also

See ‘Building a model using emptyvariables’ in this chapter for analternative way to create variables.

The variable is colored in, meaning it is ready to run.

Right-click the created variable, click Open, and set a value for thevariable.

3

4

Page 280: Geoprocessing in ArcGIS: ArcGIS 9

274 GEOPROCESSING IN ARCGIS

You can make a variable from anenvironment setting and havethe value set for the variableused automatically by the tool.For instance, you may want touse a different workspace forthe results of some of yourprocesses.

Rather than setting thisenvironment setting for allprocesses—by right-clickingeach tool, clicking Properties,then clicking the Environmentstab to change the default valueset—you can make a variablefrom an environment setting,give it a value, then connect itto all desired tools. u

Creating a variable for anenvironment setting

1. Right-click the tool, point toMake Variable, then clickFrom Environment and clickthe section of environmentsettings that contains thesetting that you want to makeinto a variable.

2. Click the environmentsetting.

A variable is created for theenvironment setting, and it isautomatically attached to thetool. If a value for the environ-ment setting has beenspecified in the EnvironmentSettings dialog box, it will beused by the variable.

3. Right-click the variable andclick Open, or double-clickthe variable, and specify oralter its value.

4. Click OK.

The variable is colored in,meaning it has a value setand is ready to run.

5. Click the Tools menu andclick Options.

6. Click the Geoprocessing tab.

7. Check When connectingelements, display validparameters when more thanone is available.

8. Click OK. u

See Also

See ‘Building a model using emptyvariables’ in this chapter for analternative way to create variables.

See Also

See Chapter 6, ‘Specifyingenvironment settings’, for informa-tion on the hierarchical nature ofenvironment settings.

1 2

4

3

5

Page 281: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 275

Q

9. Click the Add Connectiontool, click the environmentsetting variable, then clickthe tool.

10. Click the environmentsetting that you want toassociate the variable with,then click OK to connect theenvironment setting variableto another tool in the model.

11. Follow steps 9 and 10 untilthe environment settingvariable has been sharedwith all desired tools.

9

Page 282: Geoprocessing in ArcGIS: ArcGIS 9

276 GEOPROCESSING IN ARCGIS

Connecting variables forenvironment settings viathe EnvironmentSettings dialog box

1. Add a tool into theModelBuilder window eitherby dragging the tool fromthe ArcCatalog tree orArcToolbox window or viathe Add Data or Toolsbutton.

2. Right-click the displaywindow and click CreateVariable.

3. Click the data type you wantto use for the variable.

4. Click OK.

An empty variable iscreated.

5. Double-click the variable togive it a value, then clickOK. u

If you make a variable from anenvironment setting by right-clicking the tool and clickingMake Variable, the variable isautomatically connected to thetool.

There are two ways you canwork with environment settingvariables created by right-clicking the display window andclicking Create Variable.

You can connect the variableusing the Environment Settingsdialog box for a tool added tothe ModelBuilder window, oryou can connect the variabledirectly to a tool using the AddConnection tool. By checkingthe option to display validparameters when connectingvariables (on theGeoprocessing tab of theOptions dialog box, accessedvia the Tools menu on the Mainmenu of the application you areusing), you will be prompted toselect the appropriate environ-ment setting for which youwant to use the value set for thevariable, when you connect thevariable to a tool.

3

4

5

2

Page 283: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 277

6. Right-click the tool and clickProperties.

7. Click the Environments tab.

8. Navigate to the environmentsetting for which you want touse the variable’s value.

9. Check the environmentsetting, then click Values. u

6

9

8

7

Page 284: Geoprocessing in ArcGIS: ArcGIS 9

278 GEOPROCESSING IN ARCGIS

10. Click the dropdown arrow forthe environment setting andclick the variable.

11. Click OK.

12. Click OK on the Propertiesdialog box.

The variable will be con-nected to the tool, and itsvalue will be used by thetool.

W

Q

E

Page 285: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 279

Connecting variables forenvironment settingsusing the AddConnection tool

1. Click the Tools menu andclick Options.

2. Click the Geoprocessing tab.

3. Check When connectingelements, display validparameters when more thanone is available.

4. Click OK. u

1

2

3

4

Page 286: Geoprocessing in ArcGIS: ArcGIS 9

280 GEOPROCESSING IN ARCGIS

5. Click the Add Connectiontool.

6. Click the variable created foran environment setting.

7. Click the tool.

A dialog box displays validenvironment settings.

8. Click the desired environ-ment setting and click OK.

The value set for the variableis used as the environmentsetting for the tool.

5

See Also

Follow steps 1–5 of the task‘Connecting variables for environ-ment settings via the EnvironmentSettings dialog box’ earlier in thischapter to add a tool to theModelBuilder window and to createa variable. 6

78

Page 287: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 281

Variables you have created forenvironment settings do nothave to be attached to tools.After their creation, they can beset in the model’s EnvironmentSettings dialog box so theirvalue applies to all processeswithin the model. This is analternative to right-clicking themodel in its toolbox and clickingProperties, then settingEnvironment Settings. Thedifference is that by creating avariable, you can then make itinto a model parameter so usersof your tool can set the valuefor the environment settingwhen they run your model fromits dialog box. The valuesupplied will be used by allprocesses in the model. u

Setting a variable for anenvironment setting as amodel parameter

1. Right-click a toolbox, point toNew, and click Model. TheModelBuilder window isopened.

Alternatively, if a model hasalready been created, right-click the model and click Edit.

2. Right-click the ModelBuilderdisplay window and clickCreate Variable.

3. Scroll through the list of datatypes and select the datatype, such as Workspace, forthe variable you want tocreate.

4. Click OK.

5. If you want a default value todisplay, double-click thevariable and enter a value,then click OK. u

3

4

2

5

See Also

See ‘Setting a model’s parameters’in this chapter for more informa-tion on setting model parameters.

Page 288: Geoprocessing in ArcGIS: ArcGIS 9

282 GEOPROCESSING IN ARCGIS

6. Click the Model menu andclick Model Properties.

7. Click the Environments tab.

8. Expand the section contain-ing the environment settingfor which you want to use thevalue set for the variable,such as the General Settingssection.

9. Check the environmentsetting you want to apply thevariable’s value to, such asScratch Workspace.

10. Click Values.

11. Click the dropdown arrow forthe section.

12. Click the dropdown arrow forthe environment setting andclick the variable.

13. Click OK, then click OK onthe Model Properties dialogbox. u

6

7

8

9

W

E

R

Page 289: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 283

14. Right-click the variable andclick Model Parameter.

15. Click the Model menu andclick Save.

16. Click the Model menu againand click Close.

17. Right-click the model in itstoolbox and click Open toview the created parameter.

The value entered will beused by all processes in themodel. It can always bealtered by the user of thetool.

18. Click OK.

T

Y

O

I

Page 290: Geoprocessing in ArcGIS: ArcGIS 9

284 GEOPROCESSING IN ARCGIS

You do not need data to createa model in the ModelBuilderwindow. Many times you wantto generate a plan—a work flowof the tasks involved—beforeyou consider where your datawill come from or what otherparameter values you’ll set.

You can build a model to use asa plan of your work flow bycreating empty variables andattaching them to tools. Youcan fill in the values forparameters and environmentsettings later. u

Building a model usingempty variables

1. Right-click a toolbox, point toNew, and click Model. TheModelBuilder window isopened.

Alternatively, if a model hasalready been created, right-click the model and click Edit.

2. Right-click the ModelBuilderdisplay window and clickCreate Variable.

3. Scroll through the list of datatypes and select an appropri-ate data type for the variableyou want to create.

4. Click OK.

5. Drag a tool onto the displaywindow from the ArcCatalogtree or ArcToolbox window.

6. Click Add Connection.

7. Click the input data variable,then click the tool.

The input data variable willbe connected to the tool.

8. Continue creating variables,adding tools, and connectingthem together to createprocesses. Connect theprocesses together until yourmodel is complete.

You now have a plan of yourwork flow. You can supply thevalues for parameters andenvironment settings later.

2

Tip

Setting values for variablesRight-click any variable and clickOpen to set its value.

5u

6

3

4

Page 291: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 285

See Also

See Chapter 5, ‘Working withtoolsets and tools’, for an alterna-tive way to set model parametersand to change their order.

Setting a model’sparameters

1. Right-click the variable andclick Model Parameter.

To set more than onevariable as a model param-eter, select the desiredvariables first.

Notice that variables set asmodel parameters arelabeled with a ‘P’.

2. Click the Model menu andclick Save, then close theModelBuilder window.

3. Right-click the model in theArcCatalog tree orArcToolbox window and clickOpen.

The user of your model cannow specify values for theexposed parameters beforerunning your model.

Note: If you don’t want adefault value to display for aparameter or an environmentsetting, don’t specify a valuefor the variable in the model.

3

1

When you open the dialog boxof a model in the ArcCatalogtree or ArcToolbox window,you’ll see that the dialog box isblank. There are no parametersthat the user can specify valuesfor. Parameters in each processin the model can be exposed asmodel parameters, so the userof your model can supply thevalues for these parameters.

To expose model parameters,the parameters in the relevantprocesses must first be set asvariables.

Input and output parametersare, by default, variables, sotheir values can be sharedbetween processes. Otherparameters can be set asvariables. For more information,see the tasks on connectingvariables and ‘Creating avariable for a parameter’ earlierin this chapter.

After setting a process’sparameter as a variable in yourmodel, you can expose thevariable as a model parameterby right-clicking the variableand clicking Model Parameter.Model parameters will displayin the dialog box of the model.

Page 292: Geoprocessing in ArcGIS: ArcGIS 9

286 GEOPROCESSING IN ARCGIS

About intermediate data

When you run a model, output data is generally created fromeach process in the model. The derived data variables thatreference this output data are, by default, flagged as intermediatedata.

What output data cannot be intermediate?

Variables that are set as model parameters and variables thatreference data that is a derived output (where the output updatesthe input) cannot be set as intermediate.

When a derived data variable is set as a model parameter, theintermediate option on the variable’s context menu is disabled. Bysetting a derived data variable as a model parameter, the user ofyour model will supply a value (a path and a name) for this

parameter in the model’s dialog box, and a result will be producedand saved on disk in the location specified.

For more information on model parameters, see ‘Setting a model’sparameters’ earlier in this chapter.

Tools that have no output parameter create derived outputs forthe purpose of linking processes in a model. The output fromsuch a tool, for example, Add Field, actually updates the input. Itis not desirable for the output from such a tool to be deleted afterthe execution of the tool or after clicking Delete IntermediateData, as it is the updated input that will be deleted. In such cases,the Intermediate option on the derived data variable context menuis unchecked and unavailable, so the output will not be deleted.

Setting a variable as a Model Parameter disablesthe Intermediate option. You’ll generally want to setthe final variable in your model as a ModelParameter so the user of your model can set thevalue for this parameter in the model’s dialog box.

Project(input) datavariables.

All variables created for derived data parameters reference data that isset by default as intermediate. Note that input data is always needed torun the model, so it cannot be set as intermediate.

Derived data variablesset as intermediate bydefault.

A process consists ofinput data, a tool, andoutput data.

Page 293: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 287

The data referenced by deriveddata variables that have theIntermediate option flagged isdeleted by clicking DeleteIntermediate Data.

How is intermediate data handled?

After running a model within the ModelBuilder window, all outputdata remains on disk regardless of whether the Intermediateoption is checked and even after closing the ModelBuilderwindow. This allows the already run state of the model to besaved between sessions so that each time you open a previouslyrun model in its ModelBuilder window, you will not need to rerunthe entire model. The Delete Intermediate Data option allows youto delete all output data that is flagged as intermediate. If youwant to retain a particular output, be sure to first right-click thederived data variable that references the output data and uncheckIntermediate so this output is not deleted when you click DeleteIntermediate Data.

When you run a model from its dialog box or the command line,all derived data flagged as intermediate will automatically bedeleted at the end of the execution of the tool.

If you want intermediate data to be created and saved after themodel has executed from its dialog box, you can either set deriveddata variables inside the model as model parameters or uncheckthe Intermediate option on the context menu of the derived datavariable. It is important to uncheck Intermediate if you have notset your final variable to be a model parameter, so that the finaloutput from running your model from its dialog box or from thecommand line is not deleted.

See ‘Working with intermediate data’ in the section that followsfor directions on how to set variables as intermediate and how toremove intermediate data.

The Intermediate option is unchecked and unavailablefor all variables that reference derived outputs (theinput data for a tool).

Page 294: Geoprocessing in ArcGIS: ArcGIS 9

288 GEOPROCESSING IN ARCGIS

Working withintermediate dataBy default, the Intermediateoption is checked on thecontext menus of all deriveddata variables. When you run amodel from its dialog box or thecommand line, or you clickDelete Intermediate Data withinthe ModelBuilder window,output data referenced byderived data variables with theIntermediate option checkedwill be deleted.

The Intermediate option isunchecked and disabled forderived data variables set asmodel parameters and forderived data variables thatreference output data that isderived output (where the toolupdates the input data).

Intermediate data can bedeleted. In doing so, all outputdata referenced by derived datavariables with the Intermediateoption checked will be deleted.All affected processes withinthe model will return to a ready-to-run state.

Setting output data tointermediate

1. Right-click the derived datavariable and check Interme-diate.

To make multiple variablesintermediate, select themfirst.

When you run the model fromits dialog box or if you clickDelete Intermediate Datawithin the ModelBuilderwindow, output data refer-enced by the derived datavariable will be deleted. Tip

1

See Also

For more information on interme-diate data, see ‘About intermediatedata’ earlier in this chapter.

Deleting intermediatedata

1. After running a model insidethe ModelBuilder window,click the Model menu andclick Delete IntermediateData.

This will delete from disk alloutput data referenced byderived data variables thatare set as intermediate.

1

Page 295: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 289

Controlling theflow ofprocessingThere may be times when youwant to control the flow ofprocessing in a model. You maywant a certain process in yourmodel to run only if a conditionis met.

In the task to the right, ‘Check-ing for a condition’, an exampleis followed. There are tworoutes that can be taken. If therequired field doesn’t exist inthe input feature class’sattribute table, the branch ofthe model is run that creates alayer from the input featureclass, then adds a field so aselection can be made using theattributes in the field. If the fieldexists, the branch of the modelis run that creates the selectionusing the attributes within thefield.

Checking for a condition

1. Create the script that willdetermine which branch ofthe model will be taken.

View the comment lines ingreen in the script to the rightto gain an understanding ofthe workings of the examplescript.

2. Right-click a toolbox, clickAdd, then click Script. u

2

See Also

The script used in the example canbe copied from the ArcGIS Desktoponline Help system. In the Searchtab, type “controlling the flow ofprocessing” and double-click thistitle in the Select topic box. Expandthe section ‘How to control the flowof processing’ and expand the task‘Checking for a condition’. Click‘View an illustration’ under the firststep.

Page 296: Geoprocessing in ArcGIS: ArcGIS 9

290 GEOPROCESSING IN ARCGIS

3. Type a name and a label forthe script.

4. If desired, type a descriptionfor what the script does.

5. Optionally, check Storerelative path names so that ifthe script is moved, the pathto the script will not have tobe repaired.

6. Click Next.

7. Browse or type the path tothe script.

8. Click Next. u

3

4

5

6

7

Page 297: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 291

9. Set up the script parametersand their properties thatcorrespond to the variablesin the script.

In the example, threeparameters need to be set.The input feature classparameter needs to be set sothe tool’s user can input thefeature class to use. Thisparameter relates to the InFCvariable that is set in thescript to equal a user-definedvalue (sys.argv [1]).

The properties for thisparameter are that it is arequired input.

Two Boolean parametersalso need to be set in theexample: Exists and DoesNot Exist.

The properties for both theseparameters are that they areboth derived output. Thismeans that the tool’s user willnot be able to supply a valuefor these parameters in thetool’s dialog box. The valuefor these parameters will beset by the tool. Both Booleanparameters are set to beoutputs, and a default valueof false has been given.

10. Click OK on the script’sdialog box. u

Page 298: Geoprocessing in ArcGIS: ArcGIS 9

292 GEOPROCESSING IN ARCGIS

11. Right-click a toolbox, point toNew, and click Model.

12. Click the created script anddrag it into the new model.

In the example, the FieldExists? script is dragged intothe new model. u

W

E

u

Page 299: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 293

13. Click the tool that should berun if the condition is metand drag it into theModelBuilder window.

In the example, if thecondition is met—that is, ifthe field exists—the Selecttool will run.

14. Right-click the tool that willrun if the condition is metand click Properties.

In the example, this is theSelect tool.

15. Click the Preconditions tab.

16. Select the variable to use forthe precondition.

In the example, this is theExists variable. If the fieldexists in the attribute table ofthe feature class, the Selecttool will run using this field.

17. Click OK.

18. Click the tool that should berun if the condition is not metand drag it into theModelBuilder window.

In the example, if thecondition is not met, that is, ifthe field does not exist, theMake Layer, Add Join, andSelect tools will run.

19. Right-click the tool that willrun if the condition is not metand click Properties. u

u

R

T

U

I

Y

Tip

An alternative way to setpreconditionsClick Tools on the Main menu inthe ArcGIS Desktop applicationyou are working in and clickOptions. Click the Geoprocessingtab and check When connectingelements, display valid parameterswhen more than one is available.You can then use the Add Connec-tion tool within the ModelBuilderwindow to set the preconditions.

Page 300: Geoprocessing in ArcGIS: ArcGIS 9

294 GEOPROCESSING IN ARCGIS

20. Click the Preconditions tab.

21. Select the variable to use forthe precondition.

In the example, this is theDoes Not Exist variable. Ifthe field does not exist in theattribute table of the featureclass, the Make Layer toolwill run, then the Add Jointool will run to join therequired field to the layer.The Select tool will select therequired features using theadded field to select featuresof a certain attribute.

22. When all preconditions havebeen set, right-click the scriptand click Open.

23. Supply a value for anynecessary parameters, thenclick OK.

In the example, a value forthe Input feature classparameter needs to besupplied. This parametercorresponds to the InFCvariable in the script and theInput feature class param-eter defined in the scriptproperties dialog box.

When the model is run, thescript determines whichprecondition has been metand gives a value of True orFalse to each preconditionaccordingly. Based on whichprecondition is set to True, acertain branch in the modelwill execute. u

D

F

Page 301: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 295

24. Click the Add Connectiontool.

25. Link the input data to thetools that will run using theinput data depending onwhether the condition is met.

In the example, if the fieldexists in the input featureclass, the Select tool runs. Ifthe field does not exist, alayer is created and therequired field is added to thelayer. The Select tool thenruns on the layer containingthe required field.

G

Page 302: Geoprocessing in ArcGIS: ArcGIS 9

296 GEOPROCESSING IN ARCGIS

Running certainprocesses before others

1. Create and string togetherthe processes that will runfirst.

2. Create and string togetherthe processes that will runonly after the first set ofprocesses have run.

3. Right-click the tool of theprocess that should run onlyafter the first process has runand click Properties.

4. Click the Preconditions tab.

5. Check the variable to use forthe precondition.

In the example, the Clip toolwill not execute until theoutput from the CreateFeature Dataset tool iscreated.

6. Click OK.

The derived output variableof the process or string ofprocesses that should runfirst is connected to the tool ofthe process or string ofprocesses that should runsecond.

In the example, the creationof the output feature class isdependent on the outputfeature dataset already beingpresent, so the feature classcan be created inside it.

3

4

5

6

Tip

An alternative way to setthe preconditionClick Tools on the Main menu ofthe application you are working inand click Options. Click theGeoprocessing tab and checkWhen connecting elements, displayvalid parameter values when morethan one is available. Click the AddConnection tool in theModelBuilder window and click theoutput element of the process youwant to run first. Click the tool ofthe process you want to runsecond. Click Precondition in theSelect Parameter dialog box, thenclick OK. The second process willonly run if the first process hasrun.

When you need to run certainprocesses before others, youcan control the sequence ofprocessing in your model. Forexample, you might have aprocess in your model thatcreates a personal geodatabaseand a subsequent process thatadds a feature dataset to thatgeodatabase. You might have aprocess that clips a featureclass and places the resultingclipped feature class in thecreated feature dataset. Toplace the result from the Cliptool in the created featuredataset, you must first run theprocess that creates the featuredataset.

Page 303: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 297

Using the SelectData toolWhen building models, theoutput from some tools can be afolder, a geodatabase, a featuredataset, or a coverage intowhich results are placed, suchas feature classes or tables.

To access this data so it can beused in future processing in themodel, you can use the SelectData tool to extract the data youwant to use. This tool is onlyintended for use when buildingmodels.

The input to the Select Datatool can be referred to as theparent, as it may contain otherdatasets, such as tables orfeature classes. These otherdatasets, or children of theparent, are listed in the tool’sdropdown list. If the input is afeature dataset, all the featureclasses within the featuredataset are listed in thedropdown list. The tool’soutput always includes the fullpath to the child dataset.

Selecting the child from theparent using the Select Datatool enables you to continueprocessing your data afterperforming a task where theoutput data is a container suchas a feature dataset and the nexttool in the model requires afeature class.

1. Run the tool that places datain a workspace.

2. In the ArcCatalog tree,examine the data that isplaced in the workspace andmake note of the names ofany data you want to use infuture processing.

3. In the ArcToolbox window,expand the Data Manage-ment Tools toolbox, thenexpand the General toolset.

4. Click and drag the SelectData tool into theModelBuilder window.

5. Click the Add Connectiontool and click the outputvariable of the tool run instep 1.

6. Click the Select Data tool.

The output from the tool runin step 1 is used as the inputdata for the Select Data tool.

7. Double-click the Select Datatool to open it.

8. Type the name of the datacontained within theworkspace that you want toprocess using another tool,or click the dropdown arrowto select the data.

9. Click OK on the Select Datadialog box. u

4

5 6

1

8

9

Page 304: Geoprocessing in ArcGIS: ArcGIS 9

298 GEOPROCESSING IN ARCGIS

10. Follow steps 4–9 until youhave selected all desireddata from the workspace.

11. Click and drag into theModelBuilder window thetool or tools for which youwant to use the data se-lected from the workspaceas input.

12. Click the Add Connectiontool.

13. Click the derived dataelement of the Select Datatool.

14. Click the tool for which youwant to use the derived dataas input.

The derived data element isconnected to the tool, andthe data it references is usedas input for the tool.

15. Double-click the tool tosupply other parametervalues if necessary, thenclick OK.

16. Follow steps 12–15 toconnect all outputs from theSelect Data tools as inputsfor other tools.

Q

E R T

The use of the Select Data tool in a model. Use it to select data from aworkspace in order to continue building a model using the data fromthe workspace as input to other tools in the model.

Page 305: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 299

Working withmodel elements

Copying and pastingelements

1. Click the Select tool.

2. Click the element or ele-ments you want to copy.

3. Click the Copy button.

4. Click the Paste button.

All elements can be cut, copied,pasted, deleted, renamed, anddisconnected from otherelements.

To select an element, click theSelect tool and click theelement. To select multipleelements, drag a box aroundthem with the Select tool orhold the Shift key and clickthem one by one. To select allelements, choose Select Allfrom the Edit menu.

To deselect an element, hold theCtrl key and click the element.To deselect all elements, clickthe display window. You canalso deselect one element thisway if there are no otherelements you want to keepselected. u

1

2

34

Tip

Alternative ways to copy,cut, or paste elementsYou can also access Cut, Copy,Paste, and Delete from the Editmenu or from the display windowcontext menu. Click the Select tool,then click the element or elementsyou want to cut, copy, or delete.Right-click the display window andclick Cut, Copy, or Delete. You canpaste a cut or copied element byclicking Paste on the context menu.

Page 306: Geoprocessing in ArcGIS: ArcGIS 9

300 GEOPROCESSING IN ARCGIS

Elements can be copied andpasted or cut within the samemodel or into another model.

The first time you copy andpaste an element within thesame model, it receives thename of the element copied,plus the value (2), because it isthe second copy. Each subse-quently pasted element receivesthe name of the element copied,plus the value incremented by1.

If you copy and paste a tool orderived data element that isconnected to input data and ina ready-to-run state, the tooland derived data elements areduplicated and connected tothe same input data.

If you delete, or cut, an elementfrom a process that is ready torun or has already run, theremaining elements change tonot ready to run. If you delete,or cut, a process on which otherprocesses depend, the depen-dent processes become notready to run.

If a tool or a derived dataelement is deleted, the tool orthe derived data element it isconnected to is also deleted. u

Deleting elements

1. Click the Select tool.

2. Click the element or ele-ments you want to delete;press the Shift key to selectmultiple elements.

Selected elements have bluehandles.

3. Click the Edit menu and clickDelete.

Alternatively, right-click thedisplay window and clickDelete.

13

Page 307: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 301

Disconnecting variableelements

1. Click the Select tool.

2. Click the connector arrow toselect it, then right-click theconnector arrow and clickDelete.

The variable becomesdisconnected from the tool.The tool and derived datavariables may turn back to anot-ready-to-run state if theywere ready to run, as arequired parameter valuemay now be missing.

All elements can be renamed, soyou can give them a moremeaningful name than the oneprovided by default.

When you change the name forinput or derived data elements,you do not change the name ofthe dataset on disk, only thelabel of the element.

You should rename the defaultelement names given, especiallyfor large, complex models. Whenyou rename the elements tosomething more meaningful,anyone who views the modelcan understand its overall flow.

For variables, a meaningful namemakes it is easier to choose thecorrect variable from aparameter’s dropdown list in atool’s dialog box.

All variables, with the exceptionof derived data variables, can bedisconnected from a tool. If thetool is deleted, the derived datavariable becomes an input datavariable. u

2

1

Renaming elements

1. Right-click the element andclick Rename.

2. Type a new name for theelement.

3. Click OK.

32

1

Page 308: Geoprocessing in ArcGIS: ArcGIS 9

302 GEOPROCESSING IN ARCGIS

You can add text labels as free-floating text, or you can attachthem to elements or connectorlines in your model.

When a label is created, it usesdefault properties. The defaulttext for the label reads “Label”,and it is symbolized with adefault font (10 point black,bold, Microsoft Sans Serif).

Default properties can bealtered in the label’s propertiesdialog box. Commonly changedproperties include:

Name: The text for the label.

ToolTip: The text that appearswhen the mouse pointer isplaced over the label. ToolTipsare useful when you are zoomedout on a larger model.

Font: Click the cell next to theFont property, then click theFont button that appears tochange various font properties.

Background Color: Click thecell next to the BackgroundColor property, then click theColor button that appears tochange the label’s backgroundcolor.

Transparent: Set this propertyto True, and the label will notobscure items that are behindit.

Border Color: This propertysets the color of the borderaround the label and works in u

Adding free-floatinglabels

1. Right-click in theModelBuilder display windowand click Create Label.

A label with a default name isadded to the display window.

2. Double-click the label toenter text.

Adding labels toelements or connectors

1. Right-click the element orconnector line in the displaywindow and click CreateLabel.

A label with a default name isadded to the display window.It is attached to the elementor connector line, so if theelement or connector line ismoved, the associated labelwill move correspondingly.

2. Double-click the label toenter text.

2

1

1

2

Page 309: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 303

Changing the propertiesof a label

1. Right-click the label and clickDisplay properties.

A properties dialog boxopens so you can change theproperties associated withthe label.

Running text to the nextline

1. Right-click the label and clickDisplay properties.

2. Click in the cell to the right ofthe Name property andchange the name for thelabel.

3. Click in the cell to the right ofthe Fit To Name property,click the dropdown list, andclick No Fit.

4. Click the Select tool and clickthe label, then click the bluehandles to resize the label.

Making the label smaller inwidth will force the text to runonto the next line.

1

1

3

2

4

conjunction with the BorderWidth property.

Border Width: Click the cellnext to the Border Widthproperty, then click thedropdown list that appears toselect the border width.

Fit To Name: This propertyspecifies how tightly thebackground property fits to theName property. No Fit lets youalter the Width and Heightproperties for the background.Tight Fit restricts the back-ground to fit tightly around thetext.

Text Justification: Thisproperty changes the way thetext is justified in relation to thebackground—left, center, orright.

Width: This property changesthe width of the background.

Height: This property changesthe height of the background.

Page 310: Geoprocessing in ArcGIS: ArcGIS 9

304 GEOPROCESSING IN ARCGIS

Working with diagram properties

Diagram properties determine the layout of elements andconnector lines in the ModelBuilder window and the symbologyof elements—their size and color. Changes made to the diagramproperties are applied whenever you click Apply on the DiagramProperties dialog box or when you click the Auto Layout buttonon the ModelBuilder window toolbar. The Diagram Propertiesdialog box has three tabs: General, Layout, and Symbology.

General tab options

You can set the Layout Mode to Automatic or Manual. Inautomatic layout mode (the default), the placement of elementsand their alignment is managed automatically. In manual mode,you can make these decisions.

In automatic mode, elements are snapped to an invisible grid sothey can be aligned horizontally and vertically. ModelBuildervertically aligns project data elements with other project dataelements, tool elements with tool elements, and derived dataelements with derived data elements. Horizontal and verticalspacing between elements is constant. Elements are arranged tominimize the number of crossed connector lines.

The effects of automatic layout are applied whenever you clickthe Auto Layout button on the ModelBuilder toolbar.

In manual mode, you can arrange elements in any pattern youlike. This gives you freedom but requires care; layout in manualmode can quickly become jumbled. The Auto Layout tool on theModelBuilder toolbar is disabled when you use manual mode.

The General tab of the Diagram Properties dialog box

This model was created in automatic layout mode.

Page 311: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 305

Orientation

Orientation determines the direction of processing in the model.Orientation can be from left to right (the default), top to bottom,right to left, or bottom to top.

You can start laying out a model in one mode and switch to theother at any time. You cannot, however, return to a particularmanual layout once you have switched to automatic layout modeand changed the layout.

You can check to display a grid in the ModelBuilder window. Ifyou are in automatic mode, this is the grid to which elements willbe snapped. If you are in manual mode, you can use the grid toline up your elements.

Layout tab options

You control specific layout properties with the Layout tab. Alllayout options work only in automatic layout mode.

This model was created in manual layout mode.

The Layout tab of the Diagram Properties dialog box

Left-to-right orientation

Right-to-left orientation

Top-to-bottom orientation

Page 312: Geoprocessing in ArcGIS: ArcGIS 9

306 GEOPROCESSING IN ARCGIS

Incremental layout

With incremental layout active, a kind of compromise is achievedbetween automatic and manual layout. Once an element orconnector has been placed, it will be moved as little as possible,minimizing the amount of reorganization that occurs within theModelBuilder window.

Incremental layout can be turned on and off while you work. Theeffects of incremental layout are applied whenever you click theAuto Layout button on the ModelBuilder window toolbar.

When the option for respecting the flow is checked, the algorithmassigns elements to levels incrementally as much as possible,while respecting the flow of the connector lines. When the optionto reduce crossings is set, the maintenance of the order ofelements within levels is overridden when necessary. Thealgorithm assigns elements to levels incrementally and preservestheir ordering within levels as much as possible, while trying toreduce the number of crossings.

Minimum spacing

You can set the spacing to change spacing between levels andelements. The default is 30 diagram units for each.

Check Variable Level Spacing to adjust the spacing betweenlevels. In models that contain crossed connector lines, thespacing between levels is distributed so that levels with crossedlines are given more space.

Connection routing

Connection routing determines whether or not diagonal, ororthogonal, connector lines can be used. When OrthogonalRouting is checked off (the default), diagonal connector lines canbe used. When Orthogonal Routing is checked on, all connectorlines must be straight lines. When the Orthogonal Routing optionis checked on, you can use the Merge Edge Channels option tomerge the connector lines that connect to the same input element,so all vertical lines meet at the same point. You can also set thevertical and horizontal spacing between connectors.

Variable level spacing is checked on. The additional space between levelsconnected by crossed lines improves the model’s appearance.

Spacing between levels

Spacingbetweenelements

Page 313: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 307

The Minimum Slope option sets the lowest slope value that anydiagonal connector line can have. When the model orientation isvertical, slope is measured by the angle of the connector line froman imaginary horizontal line. When the model orientation ishorizontal, slope is measured by the angle of the connector linefrom an imaginary vertical line.

Slope is measured in percentages: zero percent is flat, and thevalue of a perpendicular slope approaches infinity. In practice,increasing the minimum slope by approximately 300 percent hasno noticeable effect.

Layout quality

The layout quality controls how rigorously the layout adheres tothe layout rules. In draft mode there is the least adherence to thelayout rules—a simpler computation is used—making the layoutof elements in the display window quicker. In proof mode, themaximum amount of adherence to the layout rules is attained. Thedefault is a compromise between draft and proof.

In the model on the left, Orthogonal Routing is turned on, so all connectorlines are straight lines rather than diagonal (the default). In the model onthe right, Orthogonal Routing and Merge Edge Channels are turned on,so vertical lines meet at the same point.

Level constraint

The Level Constraint option determines how the elements indifferent chained processes are aligned. Processes can be alignedtoward the input element or toward the output element.

Level alignment

Level alignment determines how elements align within a level. Theeffects of changing the level alignment are only visible in themodel if you have elements of different sizes.

The Auto Layout tool

The Auto Layout tool on the ModelBuilder toolbar is onlyenabled if you are working in automatic layout mode.

The level constraint is toward the output.

The level constraint is toward the input (the default).

Auto Layout

Page 314: Geoprocessing in ArcGIS: ArcGIS 9

308 GEOPROCESSING IN ARCGIS

When the Auto Layout tool is clicked, it applies the currentlayout preferences to the model.

Symbology tab options

Options on the Symbology tab allow you to control the defaultcolor of elements and the default font properties of element text,and they give you control over how elements are displayed. Toolelements are displayed as rectangles by default, and otherelements are displayed as ovals.

The default symbology applied to elements

By dragging and dropping tools, they can beplaced haphazardly in the display window.

When the AutoLayout tool isclicked, the settingsspecified in theLayout tab of theDiagram Propertiesdialog box areapplied. You can switch the default setting around so tool elements

display as ovals and all other elements display as rectangles.

Page 315: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 309

The default symbology has been altered so tool elements will bedisplayed as ovals and all other elements will be displayed asrectangles. The color for elements has been altered also. Allelements of the same type will display in the colors specified bydefault.

Page 316: Geoprocessing in ArcGIS: ArcGIS 9

310 GEOPROCESSING IN ARCGIS

ChangingdiagrampropertiesDiagram properties affect theappearance of the displaywindow and its elements.

By default, the layout mode isset to automatic. This is thesimplest mode to work inbecause the element alignmentis taken care of for you. Manuallayout mode, however, offersmore flexibility.

By default, a grid is not shownin the display window. Elementsare snapped to the grid whenyou are working in manualmode. u

Changing the layoutmode

1. Click the Model menu andclick Diagram Properties.

2. Click the General tab andclick either Automatic orManual.

3. Optionally, click Apply to seeyour changes in the displaywindow without closing thedialog box.

4. Click OK on the DiagramProperties dialog box.

Displaying a grid in thedisplay window

1. Click the Model menu andclick Diagram Properties.

2. Click the General tab andcheck Show Grid.

3. Check the grid type you wantto display (either Lines orPoints).

4. Type a size for the grid.

5. Optionally, click Apply to seeyour changes in the displaywindow without closing thedialog box.

6. Click OK on the DiagramProperties dialog box.

12

12

3

4

Page 317: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 311

Changing the defaultlayout

1. Click the Model menu andclick Diagram Properties.

2. Click the Layout tab. u

When you’re in automaticlayout mode, which is set onthe General tab of the DiagramProperties dialog box, thedefault layout of the model inthe display window can bealtered in various ways. Forinstance, you may want themodel to flow from right to leftinstead of the default flow fromleft to right, or you might wantto change the default spacingbetween levels and betweenelements. After setting yourpreferred layout options, clickApply to see the changes; oryou can click OK, then click theAuto Layout button on theModelBuilder toolbar.

1

2

Page 318: Geoprocessing in ArcGIS: ArcGIS 9

312 GEOPROCESSING IN ARCGIS

The model after the new layout options have beenapplied

The orientationhas beenchanged to Topto Bottom.

The spacingbetween levelsand elementshas beendecreased.

OrthogonalRouting andMergeConnectionshave beenturned on.

See Also

See ‘Working with diagramproperties’ earlier in this chapterfor information on each layoutoption.

3. Change the options asdesired.

Examples of changes thatcould be applied are shownin the diagram to the right.

4. Optionally, click Apply to seeyour changes in theModelBuilder window withoutclosing the dialog box.

5. Click OK.

Page 319: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 313

Changing the defaultsymbology

1. Click the Model menu andclick Diagram Properties.

2. Click the Symbology tab.

3. Check the style for displayingelements.

Check Style 1 to make toolelements rectangular and allother elements oval. CheckStyle 2 to make all toolelements oval and all otherelements rectangular.

4. Right-click an element andclick Color to change thedefault color for all elementsof that type. u

You can change the symbologythat is applied to elements bydefault. You can change theshape and the color of elementsand the font used for elementtext.

Tip

Resetting changes back tothe defaultIf you make changes and you wishto return to the default settings,simply check Style 1 or Style 2,depending on how you want theelements displayed, then click OKon the Diagram Properties dialogbox.

1

3

4

2

Page 320: Geoprocessing in ArcGIS: ArcGIS 9

314 GEOPROCESSING IN ARCGIS

5. Click a color square from thepalette or define a customcolor to use for the element.

6. Click OK.

7. Right-click an element andclick Font to change thedefault font for all elements ofthat type. u

5

6

7

Page 321: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 315

9

8. Make appropriate changes tothe font.

9. Click OK on the Font dialogbox.

10. Optionally, click Apply on theDiagram Properties dialogbox to see your changes inthe display window withoutclosing the dialog box.

11. Click OK on the DiagramProperties dialog box.

Page 322: Geoprocessing in ArcGIS: ArcGIS 9

316 GEOPROCESSING IN ARCGIS

Navigating in themodelThere are many ways tonavigate in the model, includingzooming and panning, using anoverview window, and navigat-ing through the model using theNavigate tool.

There are several zoom con-trols:

• The Full Extent tool zoomsto the boundaries of themodel.

• The Fixed Zoom In andFixed Zoom Out tools zoomthe view by constantincrements.

• The Zoom tool zooms to thearea of a rectangle you draw.

• The Continuous Zoom toolzooms continuously in orout when the left mousebutton is pressed and themouse is dragged forward orbackward.

• The Custom option on theView menu lets you zoom bya custom percentage. u

Zooming and panning

1. To see part of a larger modelmore clearly, click theContinuous Zoom tool.

2. Click and hold the left mousebutton on the display window.

3. Drag the mouse down tozoom in.

4. Click the Pan tool.

5. Click the display window,hold down the left mousebutton, and move the modeluntil you reach the part youwant to view.

6. To see the entire model, clickthe Full Extent tool.

Tip

An alternative way to panMove the vertical or horizontalscrollbars—or click the arrows—to move to different parts of themodel.

Using any of the zoom in tools, then clickingthe Pan tool, you can move to different parts ofthe model.

Clicking the Full Extent tool displays the entire model.

FullExtent

FixedZoom In

FixedZoomOut

ZoomContinuousZoom

Pan Navigate

Page 323: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 317

Using the overviewwindow

1. Click the Windows menu andclick Overview Window.

2. Drag, shrink, or expand thebox in the Overview windowto zoom/move the model tothe area covered by the box.

• The preset zoom levels onthe View menu (25%, 50%,100%, 200%, 400%) zoom tofixed percentages of theactual size.

To avoid losing track of whereyou are in a large model, youcan open an Overview window.The Overview window displaysthe entire model at all times.Your current location in themodel window is marked by arectangle in the Overviewwindow. When you navigate inthe ModelBuilder window, thisrectangle moves correspond-ingly.

To use the Overview window asa zoom tool, click and drag arectangle in the Overviewwindow. The model windowzooms in to the area covered bythe rectangle. You can click anddrag to create a new zoomrectangle at any time. You canalso resize a rectangle byclicking and dragging its blackselection handles.

To use the Overview window asa pan tool, click inside theexisting rectangle in theOverview window and drag it toa new location.

You can resize the Overviewwindow and move it outside theModelBuilder window. u

1

The display window is zoomed to the area shown by the rectangle inthe Overview window. Dragging the overview window to a newlocation pans the model.

2

Page 324: Geoprocessing in ArcGIS: ArcGIS 9

318 GEOPROCESSING IN ARCGIS

Navigating forwardthrough the model

1. To navigate through themodel, click the Navigatetool.

2. To move forward to the nextelement, click the beginningof the connector line.

3. Continue to follow step 2 tonavigate forward through theentire model.

The Navigate tool allows you tonavigate through the flow of amodel, from one element to thenext, either forward or back-ward. It can be useful if youwant to step through a model,element by element.

To move forward, click thebeginning of a connector line.To move backward, click thearrowhead of a connector line.

Navigating backwardthrough the model

1. To navigate through themodel, click the Navigatetool.

2. To move backward to thepreceding element, click thearrowhead of the connectorline.

3. Continue to follow step 2 tonavigate backward throughthe entire model.

12

1

2

Page 325: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 319

Validating amodelWhen you open an existingmodel inside a ModelBuilderwindow, processes that wererun earlier will retain thatalready run state. However, if aparameter value has beenaltered, such as the dataset thatis referenced, such changes willnot be immediately apparentwhen you open the model.

By validating the entire model,you can verify that all parametervalues are valid before you runthe model. Note that validatingan already run model will returnits processes to a ready-to-runstate. Parameter values maybecome invalid for severalreasons. For example, the inputdataset referenced no longerexists in its location on disk, orit was renamed. Alternatively, aproperty of a dataset mighthave changed, for example, afield has been added or deleted.

After you validate a model, ifany of its processes change toa not-ready-to-run state, one ormore of the parameter values isinvalid and must be repaired.

1. Click the Model menu andclick Validate Entire Model.

All parameter values set foreach element are validated. Ifa parameter value set isinvalid, the element and allthose that depend on it willbecome not ready to run. Youhave to reset the value forinvalid parameters to returnaffected processes to aready-to-run state.

2. After running validation,messages display informa-tion about invalid parametervalues. Right-click anelement and click ViewMessages to identify prob-lems.

1

See Also

See ‘Repairing a model’ in thischapter for information onrepairing parameter values.

2

Page 326: Geoprocessing in ArcGIS: ArcGIS 9

320 GEOPROCESSING IN ARCGIS

Repairing amodelThere are two main reasons torepair a model:

• After validating a model,processes become not readyto run. There is an invalidparameter value set.

• A red ‘x’ ( ) appears overyour model icon in theArcCatalog tree or theArcToolbox window. Theremay be a tool referenced inthe model that no longerexists in its toolbox on disk,or it was renamed. You mayhave a COM tool inside themodel, and the DLL isunregistered. Alternatively, aparameter name for a modelor a script added to themodel might have changed.

To fix invalid parameter values,go back through the model toidentify the first process not ina ready-to-run state. Open thetool of this process and repair u

Repairing the parametervalue for input dataelements

1. Right-click the input dataelement for which you wantto repair the parameter valueand click Open.

Alternatively, right-click thetool element and click Open.

2. Click the Browse button forthe input data parameter.

3. Locate the correct input data,and click Add.

4. Click OK on the input dataelement properties dialogbox or the tool elementdialog box.

The input data element, aswell as any other elementswith valid parameter valuesthat depend on it, willbecome ready to run.

Tip

Automatic repair ofparameter valuesIf you add a model you havecreated to a second model andupdate a parameter value in thefirst model, the parameter valuewill automatically be repaired inthe second model.

1 2

3

Page 327: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 321

Repairing a tool

1. Right-click the invalid tooland click Open.

A browse dialog box willopen.

2. Click the Look in dropdownarrow and navigate to thelocation of the tool.

3. Click Add.

The tool is repaired. Thenext time you right-click thetool and click Open, thetool’s dialog box will opennormally.

the invalid value set for theparameter. Once the parametervalue is valid, the process willreturn to ready-to-run.

You can repair the tool elementby right-clicking it and clickingOpen. This opens a Browsedialog box so you can browseto the tool’s disk location thatthe tool element references.

If the problem is an unregis-tered DLL for a COM tool youhave inside your model,relocating the tool will notsolve this problem. You mustregister the DLL within youroperating system to resolve theproblem.

If parameter names in a model ora script that is added to themodel have changed, clickModel, then Save to update themodel with the changes.

1

3

2

Tip

Setting relative pathsYou can avoid repairing paths in amodel by setting relative pathsbefore sending or moving a model,along with other relevant sources.See ‘Storing relative pathnames’ inChapter 5 and ‘Sharing yourgeoprocessing work’ in Chapter 3for more information.

Page 328: Geoprocessing in ArcGIS: ArcGIS 9

322 GEOPROCESSING IN ARCGIS

Print setup

The Print Setup dialog box lets you set printer options for amodel.

You can print the entire diagram (graph) regardless of whetheryou are zoomed in on the diagram; the current window, which isthe portion of the diagram that is visible in the display window; orthe current selection, which is the currently selected elements orconnection lines within the model diagram.

When the Print Border option is checked, a single-width border,also known as a “neatline”, is drawn along the margin edges. Bydefault, a border will be printed with a border width of 1. Thewidth and color of the line can be altered.

If you need help lining up elements, you can show a grid over themodel diagram. Access the Diagram Properties dialog box via theModel menu. On the General tab, check Show Grid. You canchoose whether or not to print this grid by checking orunchecking the Print Grid check box.

Selected elements and connector linesin the model diagram

Print preview, with PrintCurrent Selection set onthe Print Setup dialog box

Print preview, with the Print Gridoption checked

Page 329: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 323

Scale by

You can scale by pages, by actual size, or by zoom level. If youscale by pages, the model diagram prints on the number of pagesspecified in the page column and page row boxes. If both boxesare set to 1, the entire model diagram will print on one page. Ifboth boxes are set to 2, the model diagram will be scaled to printon four pages. If you scale by actual size, the model diagramprints on as many pages as necessary. If you scale by zoom level,the model diagram will be printed at the scale of the display.

Caption

By default, a caption is printed in the lower right corner of thepage using the model’s display name. You can change the textthat will print by typing the desired text into the text input box,and you can change the position of the text by clicking thePosition dropdown arrow and selecting a position for the text—bottom right, bottom center, bottom left, top right, top center, ortop left. Click the Font button to change the font of the text thatwill be displayed. If you do not want to see a caption displayed,uncheck the Print Caption check box.

Multipage printing

For each printed page you can print the page number and addcrop marks.

Page numbers

When Print Page Numbers is checked, page numbers are printed.No page number appears if the model is printed on a single page.Page numbers are centered in the margins on the sides of pagesthat are adjacent to other pages. Pages are numbered in the form[Row, Column] - Location, where Row is the row page number;Column is the column page number; and Location is top, bottom,left, or right. Page numbers are printed by default. The diagramthat follows shows the location of page numbers.

The model has been printed on four pages. The page displaying theupper left corner of the model is numbered [1,1]; the upper right corner is[1,2]; the lower left corner is [2,1]; and the lower right corner is [2,2]. Thetop, bottom, left, and right edges of adjacent pages are labeled T, B, L,and R.

[1,1] - B [1,2] - B

[2,1] - T

[1,1

] -

R

[1,2] - L

[2,1

] -

R

[2,2] - L

[2,2] - T

Page 330: Geoprocessing in ArcGIS: ArcGIS 9

324 GEOPROCESSING IN ARCGIS

Crop marks help you align models that are printed on several pages.

Crop marks

Crop marks help you align models that are printed on severalpages. They are single-width lines about one-half inch longprinted along the margins of pages that are adjacent to otherpages. They are printed by default. No crop marks appear if themodel is printed on a single page. The following diagram shows amodel printed with crop marks. To align the printed model, youwould cut along the crop marks.

Page setup

Click the Page Setup button to change the default page settings.You can change the orientation of the page (from Portrait toLandscape) and set the paper size and the paper source. Click thePrinter button to change the name of the printer.

Page 331: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 325

Setting up andprinting a modelThe Print Setup dialog box letsyou specify the area to print;the number of pages on whichthe model will print; the widthand color of the border; andother options, such as pagenumbering, crop marks, and acaption.

By default, the model prints ona single page. You can changethis by setting new values inthe Page Columns and PageRows boxes. A setting of 2 by 2,for instance, will print the modelon four pages.

By default, the page margin is0.5 inches. This margin isuniform for all sides of thepage.

To print the model, click the Filemenu and click Print. Here youcan control options, such as thenumber of copies to print andthe page orientation (Portrait orLandscape).

Tip

Setting up print optionsYou can set up print options beforeyou print. On the Print Setup dialogbox, click the Page Setup button tochange the paper size and source,the orientation of the page, the pagemargins, and the printer you wantto use.

1. Click the Model menu andclick Print Setup.

2. Change the default optionsto more appropriate settingsfor your model.

3. Click OK.

4. Click the Model menu andclick Print Preview to seewhat the model will look likewhen it is printed. u

1

3

4

Page 332: Geoprocessing in ArcGIS: ArcGIS 9

326 GEOPROCESSING IN ARCGIS

5. Click Print.

6. Set the options you want inthe Print dialog box.

7. Click OK.

Tip

Printing a modelYou can access the Print dialog boxfrom the Model menu or from thePrint Preview dialog box.

5

7

Page 333: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 327

Generating areportYou can view or save a reportfor your model.

The report documents every-thing contained in the model,including the time and date itwas generated, the variablesused—including their datatypes and values—and theprocesses created.

The documentation for pro-cesses includes the tool nameand the location (source) of thetool used in the process, theparameter values and theirproperties, and any messages.The messages explain the stateof each process. For example,they inform you if a parametervalue is invalid, and theysupply execution messages tolet you know if the process ransuccessfully.

Viewing a report

1. Click the Model menu andclick Report.

2. Check View report in awindow, then click OK.

A Model Report windowopens so you can view thereport.

3. Click OK to close the window.

Tip

Viewing messagesYou don’t have to generate a reportto view messages. You can viewmessages in the message section ofthe Command Line window, or youcan right-click a tool element in themodel and click View Messages toview the messages for a particulartool.

12

3

Page 334: Geoprocessing in ArcGIS: ArcGIS 9

328 GEOPROCESSING IN ARCGIS

Saving a report

1. Click the Model menu andclick Report.

2. Check Save report to a file,then click the Browse button.

3. Click the Save in dropdownarrow and navigate to thelocation at which to save theXML report.

4. Click the File name text boxand type a name for the XMLfile.

5. Click Save.

6. Click OK on the ModelReport dialog box.

You can view the report atany time by opening it fromits location on disk.

12

3

4 5

6

Page 335: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 329

Documenting aprocessProcesses in your model can bedocumented similarly to howyou document tools ortoolboxes.

The documentation you addmight describe what theprocess does. You can addparagraphs, bullet items,hyperlinks, illustrations,subsections, or indented text.The items you add can berearranged in the Contents listusing the up and down buttons,or content can be deleted usingthe Delete button. The order ofthe items in the Contents list isreflected in the Help page.

Adding documentation toa process

1. Right-click the tool of theprocess for which you wantto add documentation andclick Edit Documentation.

The documentation windowopens so you can begin todocument the process.

2. To add a paragraph of text,click the tool name in theContents list and click theParagraph button.

3. Type the text for the para-graph in the right side of thedialog box.

4. Continue adding paragraphs,bullet items, links, illustra-tions, subsections, andindented text as appropriate.

5. Click OK.

See Also

For information on documentingtoolboxes and tools, see ‘Addingdocumentation to toolboxes’ inChapter 4 and ‘Adding documenta-tion to tools’ in Chapter 5.

1

Tip

Indenting itemsAny item can be indented. Click theIndent button to add an Indent itemto the Contents list, click the Indentitem in the Contents list, then clickthe button corresponding to theitem you want indented.

2

5

3

Page 336: Geoprocessing in ArcGIS: ArcGIS 9

330 GEOPROCESSING IN ARCGIS

Viewing documentationfor a process

1. In the ArcToolbox window,right-click the tool containinga documented process andclick Help.

2. Click the Model section toexpand its contents andnavigate to the documentedprocess.

1

2

Page 337: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 331

Importing amodel fromArcView GIS 3You can import existing models,which were created usingArcView GIS 3 ModelBuilder,into the ModelBuilder windowif you have installed the ArcGISSpatial Analyst extension. Each.xmd file can be converted to anArcGIS model.

If you are working in ArcMapand you have an ArcView GIS 3project, import the ArcViewGIS 3 project, then import theArcView GIS 3 model. However,you do not have to import theproject. In any ArcGIS applica-tion with a display, layers addedto the table of contents will bematched to the data referencedin the ArcView GIS 3 model.Layer names need to be thesame as the theme name in theArcView GIS 3 model. If amatching layer is not found forproject data, the model will stillbe created. After importing themodel in any ArcGIS applica-tion, including ArcCatalog, youcan edit the project datavariables to reference theproject data. u

Importing an ArcViewproject

1. Start ArcMap and open ablank document.

2. Click the File menu and clickImport from ArcView project.

3. Navigate to and select theArcView project you wouldlike to import to ArcMap. Ifyou are importing a layout,choose the layout you wouldlike to import from theLayouts dropdown list. Theviews that are in the layoutwill be automatically se-lected. Views that are not inthe selected layout may beselected interactively.

4. Click OK to import the project.The selected import layout isnow the layout view inArcMap. Some graphic andtext adjusting may berequired to get the desiredlook for the map layout. Theimported views are nowseparate data frames in thetable of contents.

2

4

Page 338: Geoprocessing in ArcGIS: ArcGIS 9

332 GEOPROCESSING IN ARCGIS

Importing an ArcViewGIS 3 model

1. Create a new model inside atoolbox.

2. Click the Model menu, pointto Import, and click ArcView 3ModelBuilder.

3. Navigate to the location ofthe .xmd file.

4. Click the file and click Open.

The ArcView GIS 3 model isimported.

Although most functionsconvert directly to ArcGIStools, some functions willchange their name and somewill convert to multiple tools.

Vector Conversion will becomeFeature to Raster. PointInterpolation will become IDWor Spline. DEM Conversion willchange to DEM to Raster.Reclass will become Reclassify.Buffer will become a combina-tion of Euclidean Distance andReclassify. Arithmetic Overlaywill become a combination ofPlus, Minus, Times, Divide, andReclassify.

2

See Also

See ‘Creating models and addingscripts’ in Chapter 5 for informa-tion on creating a new model insidea toolbox.

3

4

Page 339: Geoprocessing in ArcGIS: ArcGIS 9

USING THE MODELBUILDER WINDOW 333

Exporting amodelYou can export a model to ascript or to a graphic.

An easy way to start writingscripts is to export a model youhave created to a script, thenstart to modify the exportedscript.

You can export to three differentscript formats: Python, JScript,and VBScript.

The script can be shared viae-mail or over a network, and itcan be added to a toolbox andrun as any other tool.

In the example, the Buffer toolhas been added to theModelBuilder window and itsparameter values have been set.You may have several inputsthat you need to buffer. Ratherthan using multiple buffer toolsinside the model, you canexport the simple model thatcontains one process to ascript, then modify the script toperform batch processing toinclude a loop that will buffer allthe inputs inside a workspace. u

Exporting a model to ascript

1. Create a model in the displaywindow.

2. Click the Model menu, pointto Export, then To Script, andclick the preferred script type.

3. Click the Save in dropdownarrow and navigate to thelocation to which you want tosave your script.

4. Type a File name for thescript.

5. Click Save.

See Also

See ‘Introducing geoprocessingmethods’ in Chapter 3 for moreinformation on modifying a scriptto perform batch processing.

23

4

5

Page 340: Geoprocessing in ArcGIS: ArcGIS 9

334 GEOPROCESSING IN ARCGIS

Exporting a model to agraphic

1. Create a model in the displaywindow.

2. Click the Model menu, pointto Export, and click ToGraphic.

3. Set the desired options in theSave As Image dialog box.

4. Click OK.See Also

See ‘Adding documentation totools’ in Chapter 5 for moreinformation on attaching a graphicof a model to the model’s documen-tation. See ‘Setting a modifiedstylesheet for a tool’ in Chapter 5for more information on setting agraphic as a background image fora tool.

A model can be exported to agraphic. It can be useful toplace a graphic of the model inthe documentation for themodel, reference the graphicinside a model’s stylesheet sothe graphic of the model isdisplayed on the model’s dialogbox, or place the graphic in areport.

2

4

Page 341: Geoprocessing in ArcGIS: ArcGIS 9

IN THIS APPENDIX

335

Appendix

• How are default stylesheetsapplied?

• Customizing the defaultstylesheets

• Options for customizingstylesheets

The dialog boxes of tools (system tools or custom tools) are similar in stylebecause they have a default Extensible Stylesheet Language (XSL) stylesheetapplied to them—they have the same background image, font, colors, andlayout. Stylesheets are composed of display instructions, or XSL operations,which operate on XML statements. The result of these XSL operations is a setof HTML files that, when displayed, becomes the user interface that isinteracted with whenever a tool is executed via its dialog box.

You can alter the default stylesheets to change the look of your tools,depending on personal preference. Two examples are provided to show youthe types of changes you can make. Note that the code in the XSL files usedin the examples can be copied from the online Help system if desired.

The first example focuses on how the default colors, background, and layoutcan be changed and explains how to add hyperlinks. The second exampleillustrates the creation of an expandable panel for optional parameters. In bothexamples new stylesheets are created that import the ESRI default stylesheetsfor those display characteristics that are not overwritten in the customstylesheets. The alternative is to copy the default stylesheets locally to thelocation of the toolbox, modify your local copy, then override the defaultstylesheet applied to the tool’s dialog box with your local copy by setting thepath. The example in the section ‘Setting a modified stylesheet for a tool’ inChapter 5 describes this process.

Page 342: Geoprocessing in ArcGIS: ArcGIS 9

336 GEOPROCESSING IN ARCGIS

How are default stylesheets applied?

When the dialog box of a tool is opened, the XML statementsrepresenting the user interface elements for the tool are created.The XML statements do not indicate how these elements shouldbe displayed; they only define which elements are involved. TheXML file is called MdElements.xml and is created or re-created inthe Documents and Settings\<user name>\ApplicationData\ESRI\ArcToolbox\Dlg folder each time the dialog box of atool is opened. Unless the tool has been linked to customstylesheets, the default stylesheets are applied to theMdElements.xml file. The following default stylesheets arelocated in your ArcGIS\ArcToolbox\Stylesheets folder on thedrive where you installed ArcGIS:

• MdDlgMain.xsl

• MdDlgContent.xsl

• MdDlgHelp.xsl

These XSL stylesheets transform the XML statements(MdElements.xml) into the set of HTML files that represent thetool’s dialog box. Three HTML files are created or re-created inthe Documents and Settings\<user name>\ApplicationData\ESRI\ArcToolbox\Dlg folder:

• MdDlgMain.htm

• MdDlgContent.htm

• MdDlgHelp.htm

These HTML files are then displayed as the tool’s dialog box.

Customizing the default stylesheets

You can override the default MdDlgContent.xsl andMdDlgHelp.xsl stylesheets that are applied to any tool’s dialogbox, provided the tool does not reside inside a read-only toolbox.

Example 1

In this example, the font, background image, and backgroundcolor are altered for the dialog box of the Standard Distance tooland a hyperlink is added. This tool is located inside the SpatialStatistics system toolbox.

Without customization, the dialog box for the Standard Distancetool resembles the following graphic.

Page 343: Geoprocessing in ArcGIS: ArcGIS 9

APPENDIX 337

Using a custom stylesheet, the look of the dialog box can bealtered dramatically, as the following graphic shows.

The default stylesheet that is applied to a tool’s dialog box can bechanged on the General tab of the tool’s properties dialog box.Right-click the tool and click Properties to open the propertiesdialog box.

A custom stylesheet is used to alter the background image, font,and color of the dialog box and to add a hyperlink.

In this example, the name of a custom XSL file calledSSContent.xsl is entered in the Stylesheet text box on the Generaltab of the tool’s properties dialog box. By simply typing the nameof the custom stylesheet, the path to the location of the defaultstylesheets (ArcGIS\ArcToolbox\Stylesheets) is used. To followthis technique, place your custom stylesheet or stylesheets inthis location.

The contents of SSContent.xsl are displayed in the example thatfollows. In this example, this file is used in place ofMdDlgContent.xsl. It imports the settings of MdDlgContent.xsl ifthey are not changed in SSContent.xsl. There is no need for apath to the default MdDlgContent.xsl file in this example, as both

Page 344: Geoprocessing in ArcGIS: ArcGIS 9

338 GEOPROCESSING IN ARCGIS

SSContent.xsl and MdDlgContent.xsl are placed in the ArcGIS\ArcToolbox\Stylesheets location. The background image (mygraphic.jpg)can be placed in the DLG folder (\Documents and Settings\username000\Application Data\ESRI\ArcToolbox\ Dlg or\WINNT\Profiles\username000\Application Data\ESRI\ArcToolbox\Dlg [on Windows NT]). As this is the default location where theHTML files are generated from the XSL files, the graphic will be found in this location if just the name of the graphic is entered, forexample, url(mygraphic.jpeg). Alternatively, a hard-coded path can be entered to the location of the graphic, such as url(C:/mydata/mygraphic.jpeg). A third alternative is displayed in the code below. The graphic can be placed in a location that is relative to the locationof the Common folder (\ArcGIS\ArcToolbox\Common), such as in the Stylesheets folder.

<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

version="1.0">

<xsl:import href = "MdDlgContent.xsl" />

<xsl:output method="html"/>

<!-- Overwrite Select Variable Definitions -->

<xsl:variable name="BackgroundColor">honeydew</xsl:variable>

<xsl:variable name="BackgroundImage">url(<xsl:value-of select="MdElementDialogInfo/CommonPath"/>/../Stylesheets/mygraphic.jpg)</xsl:variable>

<xsl:variable name="BackgroundPosition">bottom center</xsl:variable>

<xsl:variable name="CaptionFont">arial,verdana</xsl:variable>

<xsl:variable name="CaptionSize">10pt</xsl:variable>

<xsl:variable name="CaptionColor">DarkGreen</xsl:variable>

<xsl:variable name="CaptionWeight">Bold</xsl:variable>

<!-- Add Web link -->

<xsl:template match="MdElementDialogInfo">

<xsl:apply-imports/>

<table border="0" cellspacing="0" cellpadding="0" width="98%"onmousedown="parent.ShowHelpTopic('Intro');">

<tr align="center">

<td><span style="font-family:arial; font-size:7pt;">*This tool is described in</span></td></tr>

Page 345: Geoprocessing in ArcGIS: ArcGIS 9

APPENDIX 339

<tr align="center">

<td><span style="font-family:arial; font-size:7pt;"><i>The ESRI Guide to GIS Analysis</i>,Volume 2.</span></td></tr>

<tr align="center">

<td><span style="font-family:arial; font-size:7pt; color:blue;"><a href="http://gis.esri.com/esripress/display/index.cfm" target="esripress">Other books from ESRI Press</a></span></td></tr>

</table>

</xsl:template>

</xsl:stylesheet>

Variables correspond to the background color, font type, size, color, image, and image position. Display instructions are also appendedto the main MdElementDialogInfo template. Once all other XML elements have been processed, this extra XSL code adds the text, “Thistool is described in The ESRI Guide to GIS Analysis, Volume 2”, and a Web link to ESRI Press.

Page 346: Geoprocessing in ArcGIS: ArcGIS 9

340 GEOPROCESSING IN ARCGIS

Example 2

You can change the stylesheet applied to a dialog box so thatparameters are grouped into expandable sections within the tool’sdialog box.

In the example below, the tool has multiple optional parameters.You can apply a custom stylesheet to group all the optionalparameters into an expandable section.

Note that system tools are read only, but you can still modifythem by first copying them to your own toolbox. See Chapter 4,‘Working with toolboxes’, for information on creating your own

toolboxes, and see Chapter 5, ‘Working with toolsets and tools’,for information on copying a tool from one toolbox to another.

The modified code within a custom stylesheet (expand.xsl) thatcan be applied is displayed in the section that follows. Thisstylesheet only overrides certain settings, and the defaultstylesheet (MdDlgContent.xsl) is imported to take care of the rest.The default stylesheet resides in yourArcGIS\ArcToolbox\Stylesheets folder on the drive where youinstalled ArcGIS, so provided your custom stylesheet is placed inthe same location, you can just type the name of the defaultstylesheet to import, with a .xsl extension within your customstylesheet.

Page 347: Geoprocessing in ArcGIS: ArcGIS 9

APPENDIX 341

<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

version="1.0">

<xsl:import href = "MdDlgContent.xsl" />

<xsl:output method="html"/>

<!-- Overwrite Select Templates -->

<xsl:template match="PropertyGroup">

<TR valign="top"><TD>

<DIV ID="GEN" STYLE="cursor: hand;">

<!-- Process required parameters -->

<xsl:for-each select="Property">

<xsl:choose>

<xsl:when test='not(contains(PropertyLabel,"(optional)"))'>

<xsl:apply-templates select="." />

</xsl:when>

</xsl:choose>

</xsl:for-each>

<!-- Add expanding section for optional parameters -->

<TABLE onclick="parent.clicker({PropertyGroupName},{PropertyGroupName}Image);"STYLE="cursor:hand;" border="0" cellspacing="0" cellpadding="0" width="94%">

<TR valign="top" bgcolor="menu">

<TD colspan="2">

<TABLE border="0" width="100%" cellpadding="0" cellspacing="0">

<TR bgcolor="menu">

<TH align="left">

Page 348: Geoprocessing in ArcGIS: ArcGIS 9

342 GEOPROCESSING IN ARCGIS

<IMG ID="{PropertyGroupName}Image" SRC="{../../CommonPath}/triangle.gif" ALT="*" ALIGN="MIDDLE" BORDER="0" WIDTH="11" HEIGHT="11"/>

<SPAN class="caption" STYLE="color:menutext;">Optional Parameters</SPAN>

</TH>

</TR>

</TABLE>

</TD>

</TR>

<TR valign="top">

<TD colspan="2">

<DIV ID="{PropertyGroupName}" STYLE="display:'none';"onclick="window.event.cancelBubble = true;">

<TABLE border="0" cellspacing="1" cellpadding="4" width="90%">

<xsl:for-each select="Property">

<xsl:choose>

<xsl:when test='contains(PropertyLabel,"(optional)")'>

<xsl:apply-templates select="." />

</xsl:when>

</xsl:choose>

</xsl:for-each>

</TABLE>

</DIV>

</TD>

</TR>

</TABLE>

</DIV>

</TD></TR>

</xsl:template>

</xsl:stylesheet>

Page 349: Geoprocessing in ArcGIS: ArcGIS 9

APPENDIX 343

In this example, the stylesheet expand.xsl is specified in theStylesheet text box on the General tab of the tool’s propertiesdialog box. Since there is no path, this file should be saved in thelocation \ArcGIS\ArcToolbox\Stylesheets.

By opening the tool’s dialog box you’ll see the appliedstylesheet. Notice how the optional parameters are collected intothe Optional Parameters expandable section.

Clicking the arrow to the left of Optional Parameters expands thesection to allow values for optional parameters to be supplied.

Page 350: Geoprocessing in ArcGIS: ArcGIS 9

344 GEOPROCESSING IN ARCGIS

If you examine the code for expand.xsl, you’ll notice that itoverwrites the PropertyGroup template of MdDlgContent.xsl anduses <xsl:choose> statements to process optional and requiredparameters differently.

Options for customizing stylesheets

There are a number of options you can implement so others willsee your stylesheet customizations when you distribute yourtools, including the options that follow.

Option 1

• Copy the default stylesheets—MdDlgContent.xsl,MdDlgHelp.xsl, or both—from your\ArcGIS\ArcToolbox\Stylesheets folder to another location onyour local drive. This is usually the same location as thetoolbox or the geodatabase if the toolbox is stored inside ageodatabase.

• Modify the stylesheets as desired, then use them in place ofthe default stylesheets by specifying the location to the filesin the Stylesheet text box on the General tab of the tool’sproperties dialog box. For more information on specifyingcustom stylesheets in the Stylesheet text box, see ‘Setting amodified stylesheet for a tool’ in Chapter 5.

• Set relative paths on the General tab of the tool’s propertiesdialog box.

• Zip the folder containing the toolbox and the data, then sendthe ZIP file. Refer to ‘Sharing your geoprocessing work’ inChapter 3 for more information on archiving your work.

Option 2

• Type the name of your custom stylesheet or stylesheets in theStylesheets text box on the General tab of the tool’s propertiesdialog box.

• Put your custom stylesheets in the same location on disk asthe default stylesheets: \ArcGIS\ArcToolbox\Stylesheets.

Page 351: Geoprocessing in ArcGIS: ArcGIS 9

APPENDIX 345

• Instruct users of your tools to place your custom stylesheetsin the Stylesheets folder on their machine. From then on, yourstylesheets will always be applied when your tools are run.

Option 3

• Type the name and the path to your custom stylesheet orstylesheets in the Stylesheets text box on the General tab ofthe tool’s properties dialog box.

• Set relative paths on the General tab of the tool’s propertiesdialog box.

• In your custom stylesheet files, hard code the location toimport the default stylesheet from—for example, <xsl:importhref = "C:\Program Files\ArcGIS\ArcToolbox\Stylesheets\MdDlgContent.xsl" />. This path may have to be modified byreceivers of your tool if they installed ArcGIS in a differentlocation.

Page 352: Geoprocessing in ArcGIS: ArcGIS 9
Page 353: Geoprocessing in ArcGIS: ArcGIS 9

347

12aliasIn geoprocessing, an alternate name for a toolbox. Toolbox aliases can be used to avoid confusionwhen working with tools with the same name that are stored in different toolboxes. For example,tools in the Analysis Tools toolbox can be differentiated from similar tools in the Spatial AnalystTools toolbox by adding “_analysis” to their names at the command line, as in “clip_analysis.”

AMLSee ARC Macro Language (AML).

ARC Macro Language (AML)A proprietary high-level algorithmic language for generating end user applications in ArcInfoWorkstation. Features include the ability to create onscreen menus, use and assign variables,control statement execution, and get and use map or page unit coordinates. AML includes anextensive set of commands that can be used interactively or in AML programs (macros) as well ascommands that report on the status of ArcInfo environment settings.

ArcCatalog treeSee Catalog tree.

ArcSDE geodatabaseA remote geodatabase in a relational database management system (RDBMS) served to clientapplications by ArcSDE. An ArcSDE geodatabase can be used as a workspace for geoprocessingtasks.

ArcToolbox windowA dockable window used to display, manage, and use the contents of toolboxes in ArcGIS. Itprovides a shortcut to frequently used tools contained within toolboxes that may be stored infolders or geodatabases on disk.

batch processingExecuting a series of noninteractive jobs at the same time. In geoprocessing, these system toolsallow for batch processing: the Feature Class to Geodatabase tool, the Feature Class to Shapefiletool, the Table to Geodatabase tool, and the Table to dBASE tool.

CAD datasetSee CAD feature dataset.

Glossary

Page 354: Geoprocessing in ArcGIS: ArcGIS 9

348 GEOPROCESSING IN ARCGIS

CAD drawing datasetThe pictorial representation of an entire CAD file that can beviewed in any ArcGIS application with a display. The CADdrawing dataset is a vector data source of a mixed feature type inwhich the symbology is set to mimic that of the originating CADapplication. The graphic properties of a CAD drawing dataset’sobjects can be identified, but the dataset is not usable for featureclass-based queries or analysis.

CAD feature classA read-only member of a CAD feature dataset, comprised of oneof the following: polylines, points, polygons, multipatch, orannotation. The feature attribute table of a CAD feature class is avirtual table comprised of select CAD graphic properties and anyexisting field attribute values.

CAD feature datasetThe feature representation of a CAD file in a geodatabase-enforced schema. A CAD feature dataset is comprised of fiveread-only feature classes: points, polylines, polygons, multipatch,and annotation. Formats supported in ArcGIS include DWG(AutoCAD), DXF (AutoDesk Drawing Exchange Format), andDGN (the default MicroStation file format).

CAD fileThe digital equivalent of a drawing, figure, or schematic createdusing a CAD system. CAD files are the data source for CADdrawing datasets, feature datasets, and feature classes. ArcGISsoftware-supported formats include DWG (AutoCAD), DXF(AutoDesk Drawing Exchange Format), and DGN (the defaultMicroStation file format). A CAD file is represented in ArcCatalogwith a CAD feature dataset and a CAD drawing dataset.

Catalog treeIn ArcCatalog, a hierarchical view of folder connections thatprovides access to GIS data stored on local disks or shared on a

network, and allows users to manage connections to databasesand GIS servers.

cell sizeThe area on the ground covered by a single cell in an image,measured in map units.

cluster toleranceIn geodatabase feature classes, a definition for the minimumtolerated distance between vertices in the topology. Vertices thatfall within the set cluster tolerance will be snapped togetherduring the validate topology process.

COMSee Component Object Model (COM).

commandAn instruction to a computer program, usually one word orconcatenated words or letters, issued by the user from a controldevice, such as a keyboard, or read from a file by a commandinterpreter.

command lineAn onscreen interface in which the user types in commands at aprompt. In geoprocessing, any tool added to the ArcToolboxwindow can be run from the command line.

Command Line windowIn geoprocessing, a window that provides a command line forrunning tools, and a message window for viewing the statusmessages created when running those tools.

Component Object Model (COM)A binary standard that enables software components tointeroperate in a networked environment regardless of thelanguage in which they were developed. Developed by

Page 355: Geoprocessing in ArcGIS: ArcGIS 9

GLOSSARY 349

Microsoft, COM technology provides the underlying services ofinterface negotiation, life cycle management (determining whenan object can be removed from a system), licensing, and eventservices (putting one object into service as the result of an eventthat has happened to another object).

compressionA reduction of file size for data handling and storage. Examples ofsuch methods include quadtrees, run-length encoding, andwavelet.

connectorA visual representation of the relationship between elements in amodel. Connectors join elements together to create processes.Typical processes connect an input data element, a tool element,and a derived data element.

coordinate systemA fixed reference framework superimposed onto the surface of anarea to designate the position of a point within it; a referencesystem consisting of a set of points, lines, and/or surfaces; and aset of rules, used to define the positions of points in space ineither two or three dimensions. The Cartesian coordinate systemand the geographic coordinate system used on the earth’ssurface are common examples of coordinate systems.

coverageA data model for storing geographic features using ArcInfosoftware. A coverage stores a set of thematically associated dataconsidered to be a unit. It usually represents a single layer, suchas soils, streams, roads, or land use. In a coverage, features arestored as both primary features (points, arcs, polygons) andsecondary features (tics, links, annotation). Feature attributes aredescribed and stored independently in feature attribute tables.

coverage feature classIn ArcInfo, a classification describing the format of geographicfeatures and supporting data in a coverage. Feature classesinclude point, arc, node, route system, route, section, polygon,and region. One or more coverage features are used to modelgeographic features; for example, arcs and nodes can be used tomodel linear features, such as street centerlines. The tic,annotation, link, and boundary feature classes providesupporting data for coverage data management and viewing.

current workspaceA user-specified path to a container for file-based geographicdata, set in the Environment Settings dialog box. Data from thecurrent workspace can be accessed from any tool dialog box,including script or model dialog boxes, or the command linesimply by typing its name.

See also scratch workspace.

custom toolIn geoprocessing, a tool created by a user and added to a toolsetor a toolbox. Custom tools may only be added to custom toolsetsor toolboxes.

custom toolsetIn geoprocessing, a subset of a toolbox created by a user to holdcustom tools or a group of frequently used tools.

dataAny collection of related facts arranged in a particular format;often, the basic elements of information that are produced, stored,or processed by a computer.

data sourceAny geographic data. Data sources may include coverages,shapefiles, rasters, or feature classes.

Page 356: Geoprocessing in ArcGIS: ArcGIS 9

350 GEOPROCESSING IN ARCGIS

data typeThe attribute of a variable, field, or column in a table thatdetermines the kind of data it can store. Common data types arecharacter, integer, decimal, single, double, and string.

database management system (DBMS)A set of computer programs that organizes the information in adatabase according to a conceptual schema and provides toolsfor data input, verification, storage, modification, and retrieval.

datasetAny organized collection of data with a common theme.

DBMSSee database management system (DBMS).

derived dataData created by running a geoprocessing operation on existingproject data. Derived data from one process can serve as inputdata for another process.

derived valueNongeographic data created by running certain geoprocessingtools. Derived values from one process in a model can serve asinput values for other processes in the model.

See also intermediate data.

dialog boxIn geoprocessing, a form consisting of a tool’s parameters.

Documentation EditorIn geoprocessing, the interface used to write documentation fortools, toolsets, toolboxes, and processes within a model.

double precisionThe level of coordinate exactness based on the possible numberof significant digits that can be stored for each coordinate.Datasets can be stored in either single or double precision.Double-precision geometries store up to 15 significant digits percoordinate (typically 13 to 14 significant digits), retaining theaccuracy of much less than one meter at a global extent.

See also single precision.

elementA component of a model. Elements can be variables, such asinput and derived data, or tools.

environment settingsSettings that can apply to all tools within the application, all toolswithin a model or script, or a particular process within a model orscript. Environment settings include current workspace, outputspatial reference, output spatial grids, cell size, and tile size. Theyare generally set before running tools.

extentThe coordinate pairs defining the minimum bounding rectangle(xmin, ymin and xmax, ymax) of a data source. All coordinates forthe data source fall within this boundary.

feature classA collection of geographic features with the same geometry type(such as point, line, or polygon), the same attributes, and thesame spatial reference. Feature classes can stand alone within ageodatabase or be contained within shapefiles, coverages, orother feature datasets. Feature classes allow homogeneousfeatures to be grouped into a single unit for data storagepurposes. For example, highways, primary roads, and secondaryroads can be grouped into a line feature class named “roads”. In ageodatabase, feature classes can also store annotation anddimensions.

Page 357: Geoprocessing in ArcGIS: ArcGIS 9

GLOSSARY 351

feature datasetA collection of feature classes stored together that share thesame spatial reference; that is, they have the same coordinatesystem and their features fall within a common geographic area.Feature classes with different geometry types may be stored in afeature dataset.

folderA location on a disk containing a set of files, other folders, orboth.

geodatabaseAn object-oriented data model introduced by ESRI thatrepresents geographic features and attributes as objects and therelationships between objects, but is hosted inside a relationaldatabase management system. A geodatabase can store objects,such as feature classes, feature datasets, nonspatial tables, andrelationship classes.

geodatabase raster bandSee raster dataset band.

geodatabase raster datasetSee raster.

geographic information system (GIS)An arrangement of computer hardware, software, and geographicdata that people interact with to integrate, analyze, and visualizethe data; identify relationships, patterns, and trends; and findsolutions to problems. The system is designed to capture, store,update, manipulate, analyze, and display the geographicinformation. A GIS is typically used to represent maps as datalayers that can be studied and used to perform analyses.

geoprocessingA GIS operation used to manipulate data stored in a GISworkspace. A typical geoprocessing operation takes an inputdataset, performs an operation on that dataset, and returns theresult of the operation as an output dataset. Commongeoprocessing operations are geographic feature overlay, featureselection and analysis, topology processing, and dataconversion. Geoprocessing allows for definition, management,and analysis of information used to form decisions.

geoprocessing settingsAny settings that affect working with or running tools.Geoprocessing settings include the state of the ArcToolboxwindow, the state of the Environment Settings dialog box, andvariables that have been created at the command line. In ArcMap,geoprocessing settings are saved with a map document. InArcCatalog, geoprocessing settings are persisted with theapplication.

geostatistical layer filesA layer file created by the Geostatistical Analyst extension. Thefiles can be exported to ESRI GRID for further geoprocessing.

GISSee geographic information system (GIS).

history modelA model created, dated, and saved when the application is closedto document the tools and parameter values used for eachsession. The history model is contained within the Historytoolbox and can be viewed when the application is reopened.

See also model.

Page 358: Geoprocessing in ArcGIS: ArcGIS 9

352 GEOPROCESSING IN ARCGIS

hyperlinkA reference (link) from some point in one electronic document orresource to some point in another document or resource oranother place in the same document. Activating the link, usuallyby clicking it with the mouse, causes the browser to display thetarget of the link.

input dataData that is entered into a computer, device, program, or process.

intermediate dataAny data, not set up as a model parameter, that is referenced byderived data variables in a model. Such data is part of a processand is not saved once the model has been successfully run fromits dialog box. Input data is not classified as intermediate databecause it existed before the model was executed.

See also derived data.

layerA set of references to data sources such as a coverage,geodatabase feature class, raster, and so on that defines how thedata should be displayed on a map. Layers can also defineadditional properties, such as which features from the data sourceare included. Layers can also be used as inputs to geoprocessingtools. Layers can be stored in map documents (.mxd) or savedindividually as layer files (.lyr).

m-value1. Vertex attributes that are stored with x,y point coordinates in

ESRI’s Geometry Engine. Every type of geometry (point,polyline, polygon, and so on) can have attributes for everyvertex.

2. In linear referencing, measure values that may be added tolinear features to perform dynamic segmentation. In linearreferencing, m-values are used on vertices to imply a

measurement along a linear feature. The m-value allows alocation along a line to be found.

map projectionSee projection.

maskA means of performing raster analysis on a selected set of cells ina raster dataset. Cells that fall within the extent of the mask areprocessed. All other cells are characterized as NoData.

measure valueSee m-value.

metadataInformation about the content, quality, condition, and othercharacteristics of data. Metadata for geographical data maydocument its subject matter; how, when, where, and by whom thedata was collected; accuracy of the data; availability anddistribution information; its projection, scale, resolution, andaccuracy; and its reliability with regard to some standard.Metadata consists of properties and documentation. Propertiesare derived from the data source—for example, the coordinatesystem and projection of the data—while documentation isentered by a person (for example, keywords used to describe thedata).

modelA set of rules and procedures for representing a phenomenon orpredicting an outcome. In geoprocessing, a model consists of oneprocess or a sequence of processes connected together. It iscreated in a toolbox and built in a ModelBuilder window. A modelcan be exported to a script file.

Page 359: Geoprocessing in ArcGIS: ArcGIS 9

GLOSSARY 353

model parameterA type of parameter exposed in a model that displays in a model’sdialog box and allows for input.

ModelBuilder windowThe interface used to build and edit models in ArcGIS.

My Toolboxes folderIn ArcCatalog, a folder that contains nonsystem toolboxescreated in the ArcToolbox window or directly in the MyToolboxes folder in the ArcCatalog Tree. The My Toolboxesfolder points to a location on disk that can be changed in theGeoprocessing tab of the Options dialog box.

output dataData that is the result of a program or process.

See also input data.

parameterIn geoprocessing, a characteristic of a tool. Values set forparameters define a tool’s behavior during run time.

personal geodatabaseA geodatabase that stores data in a single-user relationaldatabase management system. A personal geodatabase can beread simultaneously by several users, but only one user at a timecan write data into it.

precisionRefers to the number of significant digits used to store coordinatevalues. Precision is important for accurate feature representation,analysis, and mapping. ArcInfo supports single and doubleprecision.

processA tool and its parameter values. One process, or multipleprocesses connected together, creates a model.

project dataGeographic input data that exists before a geoprocessing tool isrun.

projectionA method by which the curved surface of the earth is portrayedon a flat surface. This generally requires a systematicmathematical transformation of the earth’s graticule of lines oflongitude and latitude onto a plane. It can be visualized as atransparent globe with a light bulb at its center casting lines oflatitude and longitude onto a sheet of paper. Generally, the paperis either flat and placed tangent to the globe (a planar or azimuthalprojection) or formed into a cone or cylinder and placed over theglobe (cylindrical and conical projections). Every map projectiondistorts distance, area, shape, direction, or some combinationthereof.

pyramidIn raster datasets, a reduced resolution layer that copies theoriginal data in decreasing levels of resolution to enhanceperformance. The coarsest level of resolution is used to quicklydraw the entire dataset. As the display zooms in, layers with finerresolutions are drawn; drawing speed is maintained becausefewer pixels are needed to represent the successively smallerareas.

rasterA spatial data model that defines space as an array of equallysized cells arranged in rows and columns. Each cell contains anattribute value and location coordinates. Unlike a vectorstructure, which stores coordinates explicitly, raster coordinates

Page 360: Geoprocessing in ArcGIS: ArcGIS 9

354 GEOPROCESSING IN ARCGIS

are contained in the ordering of the matrix. Groups of cells thatshare the same value represent geographic features.

raster bandSee raster dataset band.

raster catalogA collection of raster datasets defined in a table of any format, inwhich the records define the individual raster datasets that areincluded in the catalog. A raster catalog is used to displayadjacent or overlapping raster datasets without having to mosaicthem together into one large file.

raster datasetSee raster.

raster dataset bandOne layer in a raster dataset that represents data values for aspecific range in the electromagnetic spectrum, such asultraviolet, blue, green, red, infrared, or radar, or other valuesderived by manipulating the original image bands. A rasterdataset can contain more than one band. For example, satelliteimagery commonly has multiple bands representing differentwavelengths of energy from along the electromagnetic spectrum.

relative pathIn computing, the location of a computer file given in relation tothe current working directory. For example, in ArcMap, a path tothe data source of a layer contained in a map document (.mxd file)may be set relative to the location of the map document; ingeoprocessing, a path to a source of information referenced by atool in a toolbox may be set relative to the location of the toolbox.

scratch workspaceA path to a container for file-based geographic data that can beset in the Environment Settings dialog box or at the commandline, into which all automatically generated outputs will be placed.

scriptA set of instructions in plain text, usually stored in a file andinterpreted, or compiled, at run time. In geoprocessing, scriptscan be used to automate tasks, such as data conversion, orgenerate geodatabases and can be run from their scriptingapplication or added to a toolbox. Geoprocessing scripts can bewritten in any COM-compliant scripting language, such asPython, JScript, or VBScript.

SDC datasetA collection of Smart Data Compression (SDC) feature classessharing attribute information with different geometries. SDCformat is used by ESRI to provide StreetMap™ data. An SDCdataset is stored in a set of related files and contains multiplefeatures classes.

SDC feature classA highly compressed, read-only data structure that can storespatial geometry (points, lines, and polygons) and attribute data.The SDC structure supports geocoding, routing, and most spatialoperations. SDC is the core data structure used in StreetMap,ArcIMS® RouteServer, RouteMAP™, IMS, ArcGIS BusinessAnalyst, and BusinessMAP®.

shapefileA vector data storage format for storing the location, shape, andattributes of geographic features. A shapefile is stored in a set ofrelated files and contains one feature class.

Page 361: Geoprocessing in ArcGIS: ArcGIS 9

GLOSSARY 355

single precisionRefers to a level of coordinate exactness based on the number ofsignificant digits that can be stored for each coordinate. Single-precision numbers store up to seven significant digits for eachcoordinate, retaining a precision of ±5 meters in an extent of1,000,000 meters. Datasets can be stored as either single- ordouble-precision coordinates.

See also double precision.

snap rasterAn option in the Environment Setting dialog box that ensuresthat the cell alignment of the extent will match accurately with anexisting raster. This is done by snapping the lower left corner ofthe specified extent to the lower left corner of the nearest cell inthe snap raster, and snapping the upper right corner of thespecified extent to the upper right corner of the nearest cell in thesnap raster.

spatial domainFor a spatial dataset, the defined precision and allowable rangefor x and y coordinates and for m-values and z-values if present.The spatial domain must be specified by the user when creating ageodatabase feature dataset or standalone feature class.

spatial gridA two-dimensional grid system that spans a feature class. It isused to quickly locate features in a feature class that might matchthe criteria of a spatial search.

spatial referenceThe coordinate system used to store a spatial dataset. For featureclasses and feature datasets within a geodatabase, the spatialreference also includes the spatial domain.

stylesheetA file or form that provides style and layout information, such asmargins, fonts, and alignment, for tagged content within an XMLor HTML document. Stylesheets are frequently used to simplifyXML and HTML document design, since one stylesheet may beapplied to several documents. Transformational stylesheets mayalso contain code to transform the structure of an XML documentand write its content into another document.

syntaxThe structural rules for using statements in a command orprogramming language.

system toolIn geoprocessing, a tool installed with ArcGIS. System tools arestored in system toolsets and can be copied to custom toolsetsand toolboxes.

system toolboxIn geoprocessing, a default toolbox that is installed with ArcGIS.System toolboxes contain system tools, organized into toolsetsfor ease of access.

system toolsetIn geoprocessing, a subset of a toolbox that holds system tools.

tableA set of data elements arranged in rows and columns. Each rowrepresents an individual entity, record, or feature, and eachcolumn represents a single field or attribute value. A table has aspecified number of columns but can have any number of rows.

table viewA representation of tabular data for viewing and editingpurposes. The table view created when a table is added toArcMap is a copy of the actual table data stored in memory.

Page 362: Geoprocessing in ArcGIS: ArcGIS 9

356 GEOPROCESSING IN ARCGIS

TIN datasetA dataset containing a triangulated irregular network (TIN). TheTIN dataset includes topological relationships between pointsand neighboring triangles.

toolAn entity in ArcGIS that performs such specific geoprocessingtasks as clip, split, erase, or buffer. A tool can belong to anynumber of toolsets or toolboxes.

toolboxAn object that contains toolsets and geoprocessing tools. Ittakes the form of a .tbx file on disk, or a table in a geodatabase.

toolsetIn geoprocessing, a group of tools that perform similar tasks.

See also custom tool, system tool.

topology1. In geodatabases, a set of governing rules applied to feature

classes that explicitly define the spatial relationships that mustexist between feature data.

2. In an ArcInfo coverage, the spatial relationships betweenconnecting or adjacent features in a geographic data layer (forexample, arcs, nodes, polygons, and points). Topologicalrelationships are used for spatial modeling operations that donot require coordinate information.

usageThe way in which statements in a command or programminglanguage are actually used. In geoprocessing, usage for a tool orenvironment setting can be viewed at the command line.

valueA measurable quantity which a function may take that is eitherassigned or determined by calculation.

variableA symbol or placeholder that represents a changeable value or avalue that has not yet been assigned. A variable has a quantitythat can be measured, and it can be used to represent differenttypes of data in expressions.

VPFVector Product Format. A U.S. Department of Defense militarystandard that defines a format, structure, and organization forlarge geographic databases. VPF data is read-only in ArcCatalog.

VPF datasetSee VPF.

VPF feature classSee feature class.

workspaceA container for geographic data. A workspace can be a folder thatcontains shapefiles, an ArcInfo workspace that containscoverages, a geodatabase, or a feature dataset.

z-valueThe value for a given surface location that represents an attributeother than position. In an elevation or terrain model, the z-valuerepresents elevation; in other kinds of surface models, itrepresents the density or quantity of a particular attribute.

Page 363: Geoprocessing in ArcGIS: ArcGIS 9

357

12Index A

Abstractadding

to tool Help 160to toolbox Help 115

Add Field button 268Add results to display 90, 265Alias

adding for a toolbox 112defined 347

AMLdefined 347script

adding to a toolbox 141running in ArcGIS 4

Application environment settings 178ARC Macro Language (AML). See AMLArcSDE geodatabase

defined 347described 80

ArcToolbox windowadding toolboxes 107–108defined 347described 71docking 102opening 102saving its state 113

ArcView GIS 3 modelimporting 331

ArcView GIS 3 projectimporting 331

Author informationadding

to tool Help 161to toolbox Help 116

Auto Layout tool 307

B

Batch processingdefined 347

Batch processing (continued)described 77, 141system scripts 1

Bullet itemadding

to tool Help 162to toolbox Help 118

C

CAD drawing datasetdefined 348described 83

CAD feature classdefined 348described 84

CAD feature datasetdefined 348described 83

CAD filedefined 348described 83

Catalog treedefined 348

Cell sizedefined 348setting for output raster datasets 218

CHM files 168Cluster tolerance

defined 348specifying for outputs 199

COMcompliant

scripting language 4, 71, 74, 129, 142defined 349

Commanddefined 348described 224

Command linedefined 348described 72

Page 364: Geoprocessing in ArcGIS: ArcGIS 9

358 GEOPROCESSING IN ARCGIS

Command line (continued)entering multiple commands 226example for tool Help 166introduced 1, 3–5running tools 71–73, 224–232

Command Line windowdefined 348described 221docking 223opening 222

Compiled Help filereferencing 124, 168

Component Object Model (COM). See COMCompression

defined 349setting the type 212

Configuration keywordsetting 206

Connectordefined 349described 246

Constraintsadding to toolbox Help 116applied to a tool 161

Continuous Zoom tool 316Control. See ParameterCoordinate system

defined 349precedence rules 191setting for outputs 191–192

Coveragedefined 349described 82

Coverage feature classdefined 349described 82

Coverage settingslevel of comparison between projection

files 201precision 202–204specifying 200

Coverage toolsunlocking 176

Current workspacedefined 349described 186setting 189

Custom tooldefined 349described 71

Custom toolsetdefined 349described 71

D

Datadefined 349

Data sourcesadding to a model 259–260defined 350supported by tools 79–88

Data typedefined 350

Database management system (DBMS). SeeDBMS

Datasetdefined 350

DBMSdefined 350described 80

Default output z-valuespecifying 193

Derived dataadding to the display 265defined 350element 245

Derived data element. See Element: definedDerived value

defined 350element 246

Diagram propertieschanging 310–311connection routing 306described 304incremental layout 306layout

changing the default 311–312mode 304–305, 310quality 307

levelalignment 307constraint 307

minimum spacing 306orientation 305showing a grid 310symbology 313–315

Dialog boxdefined 350help 169using to run a tool 71–72

Documentationadding

to processes 329to toolboxes 114–122to tools 159–166

exportingfor toolboxes 123for tools 167

viewingfor a process 330for parameters 169for toolboxes 125–126for tools 169–172

Documentation Editordefined 350opening 159

Double precisiondefined 350described 202

Page 365: Geoprocessing in ArcGIS: ArcGIS 9

INDEX 359

E

Elementcopying and pasting 299defined 350deleting 300described 73, 245disconnecting 301renaming 301states 262symbology 308, 313

Environment settingscoverage 200defined 350described 177–180displaying when valid 279general 185geodatabase 205raster analysis 217raster geodatabase 211saving 92specifying

at the command line 224, 228at tool execution time 133for a model 179, 182–183for a process 179, 184for a script 179for the application 178, 181

Executable fileadding to a toolbox 141–143running in ArcGIS 4

Exportmodel

to graphic 333–334to script 333

tool documentation to HTML 167Extent

defined 350specifying for outputs 196–197

F

Feature classdefined 350described 81storing m-values 195storing z-values 194

Feature datasupported 81–85

Feature datasetdefined 351

Folderdefined 351described 79

Full View tool 316Function. See Tool

G

General settingscluster tolerance 199current workspace 186, 189default output workspace 186, 190default output z-value 193extent 196–197output coordinate system 191–192output has m-values 195output has z-values 194snap raster 198specifying 185

Geodatabasedefined 351

Geodatabase settingsoutput CONFIG keyword 206output spatial grid 207specifying 205

Geographic information system (GIS). See GISGeoprocessing

defined 351described 1, 69–70in ArcGIS 1, 69, 71

Geoprocessing (continued)methods 71–78tutorial 9

Geoprocessing settingsaltering 92defined 351loading 93mentioned 108, 113, 178saving 93

Geoprocessing taboptions 90–91

Geostatistical layer filedefined 351described 87

GISdefined 351described 1, 69–70

H

Has been run. See Element: statesHistory model

defined 352viewing 95, 232

Hyperlinkadding

to tool Help 162to toolbox Help 119

defined 352

I

Illustrationadding

to tool Help 165to toolbox Help 120

ImportArcView GIS 3 project 331model from ArcView GIS 3 331–332

Input datadefined 352

Page 366: Geoprocessing in ArcGIS: ArcGIS 9

360 GEOPROCESSING IN ARCGIS

Intermediate datadefined 352deleting 288described 286–287setting 288

J

JScript. See Script

K

Keywordsadding

to tool Help 160to toolbox Help 115

L

Labeladding

for elements and connectors 246, 302free-floating 246, 302

changing properties 303text 303

Layerat the command line 227, 228data

supported 87defined 352described 88file

described 87Level of comparison between projection

files 201Locked tools 175

M

M-domainsetting 210

M-valuedefined 352storing for feature classes 195

Maskapplying to raster outputs 219defined 352

Messagesafter validating a model 319clearing 226from running

tools 3, 95, 133, 142, 266, 327in the Command Line window 222

Metadatadefined 352viewing

for results 95for toolboxes 126for tools 172

Modelbuilding 73, 241, 245–247, 252, 256–261

example 248–250using empty variables 284

creating 71, 129, 140, 252–254defined 352described 242–243diagram

properties 304display name 261documenting 254editing 144, 256environment settings 179exporting

to graphic 333–334to script 74–78, 333–334

importing from ArcView GIS 3 331introduced 1, 4locked 175navigation 316–318

Model (continued)parameter

defined 353removing 156reordering 158setting 4, 74, 145, 253, 285

plan of work flow 284renaming 253, 261repairing 320–321running 72, 74, 253, 263–265saving 253, 261selecting data 297sharing 97–99, 254validating 319–321

ModelBuilder windowadding tools 257–260defined 353described 73, 244, 255opening 256

My Toolboxes folderdefault location 105defined 353

N

Navigate tool 316, 318Not ready to run. See Element: states

O

Online Help 171Output CONFIG keyword 206Output coordinate system 191–192Output data 133

defined 353nonexistent 268

Output has m-values 195Output has z-values 194Output spatial grid 207Overview window 317

Page 367: Geoprocessing in ArcGIS: ArcGIS 9

INDEX 361

P

Pan tool 316Parameter

defined 353displaying if valid 271documenting 163empty 268help 169in a model

adding 145removing 156reordering 158setting as a variable 73

in a scriptadding 143, 146removing 156reordering 158

valuesrepairing 320setting 1–4, 71, 129, 133, 145, 268

Personal geodatabasedefined 353described 80

Precedence rulesfor output coordinate system 191

Precisiondefined 353double

defined 350for output coverages 202–204

Preconditionssetting 289–296

Print setup 322–324Printing models 325Process

building 257chaining 4, 73, 247defined 353described 245documentation 329environment settings 179

Process (continued)flow, controlling 289–296running 263–265

Project datadragging into a model 259dragging onto a tool element 260element 245

Projectiondefined 353validating before running tools 201

Pyramidscreating 214defined 353

Python. See also Scriptinstalling 11

R

Rasterdefined 354

Raster analysis settingscell size 218mask 219specifying 217

Raster catalogdefined 354described 86

Raster datasupported 86

Raster dataset banddefined 354described 86

Raster geodatabase settingspyramids 214specifying 211statistics 215tile size 216

Ready to run. See Element: statesRelative paths 97, 154, 321

defined 354Report

saving 328

Report (continued)viewing 96, 266, 327

Resultsadding to the display 90making permanent 187overwriting 91temporary 90

S

Scratch workspacedefined 354described 186setting 190

Scriptadding to a toolbox 71, 129, 140–143defined 354editing 144environment settings 179example code 75–77example for tool Help 166introduced 1, 4languages 71locked 175parameter

removing 156reordering 158setting 145–149

running 71, 74–78sharing 97–99source 155

SDC datasetdefined 354described 84

SDC feature classdefined 354described 84

Select Data tool 297Shapefile

defined 355described 82

Page 368: Geoprocessing in ArcGIS: ArcGIS 9

362 GEOPROCESSING IN ARCGIS

Single precisiondefined 355described 202

Snap rasterapplying to outputs 198defined 355

Spatial domaindefined 355

Spatial gridsdefined 355setting 207

Spatial queriesincreasing the speed of 207

Spatial referencecoordinate system 191defined 355m-domain 210x,y domain 208z-domain 209

Statisticscalculating 215

Stylesheetsdefined 355modifying for dialog boxes 139, 141,

150–152, 335–345Subsections

adding to toolbox Help 121Summary

adding to a tool 162adding to a toolbox 117adding to a toolset 117

Symbologyfor elements 308

System tooladding

from a DLL 136to a toolbox 135

defined 355introduced 1–2locating 103, 132

System tool (continued)running

from a dialog box 72from the command line 72

System toolboxdefined 355locating 103, 132

System toolsetdefined 355

T

Tabledefined 355described 88

Table datasupported 88

Table viewdefined 356described 89

Temporaryresults 90, 186

Textfinding and replacing 226

Text fileloading and saving 229–230

Tile size 216TIN dataset

defined 356described 87

Toolcopying and pasting 134defined 356deleting 138description 129, 139, 150documentation

adding 159–166exporting 167viewing 169–172

dragging and dropping 134dragging into a ModelBuilder window 257

Tool (continued)element 245environment settings 177finding

in the ArcCatalog tree 173in the ArcToolbox window 174

history 95–96, 232icons 144label 139, 150licensing issues 175model. See Modelname 139, 150nonunique 227opening 132output data 133parameter documentation 169properties

changing 150–154displaying 139

reexecuting 3, 231renaming 138repairing 320results 90running

at the command line 71–73, 224–232on selected set 133via a dialog box 71–72, 133

script. See Scriptsharing 97–99unlocking 175viewing metadata 172working with 132–136

Toolboxadding

a script 71system tools 135to the ArcToolbox window 107–108

alias 112conflicts 111copying and pasting 106creating 104creating models inside 71

Page 369: Geoprocessing in ArcGIS: ArcGIS 9

INDEX 363

Toolbox (continued)default creation location 105defined 356deleting 109described 71, 101documentation

adding 114–122exporting 123viewing 125

dragging and dropping 107finding

in ArcCatalog 173location on disk 112managing 106–110metadata

viewing 126permissions 98referencing a compiled Help file 124refreshing 111removing from the ArcToolbox window 109renaming 110rules of access 127saving with a map document 113setting as read-only 109system

defined 355Toolboxes folder 103Toolset

creating 130defined 356deleting 131described 71, 129documentation

adding 117–122viewing 125

managing 130–131system

defined 355Topology

defined 356Tutorial 9

U

Usagedescribed 72, 224–225introduced 3

Usage tipsadding to tools 164

V

Validate entire model 319–321Value

defined 356element 246

Variableat the command line

creating 234described 73, 233editing 237loading 240managing 237–240removing 238saving 239

connecting 270–285creating

empty 284for a parameter 73, 273for an environment setting 274

defined 356described 245setting as a model

parameter 145, 281, 285, 286VBScript. See ScriptVPF

defined 356described 85

W

Workspacedefined 356described 186–188selecting data 297setting 189–190

X

X,Y domainsetting 208

Z

Z-domainsetting 209

Z-valuedefined 356setting for outputs 193storing by feature classes 194

ZIP files 98Zoom tools 316

Page 370: Geoprocessing in ArcGIS: ArcGIS 9