Geoprocessing in Arcgis® Copyright © 2001–2004 ESRI All Rights Reserved
Total Page:16
File Type:pdf, Size:1020Kb
ArcGIS® 9 Geoprocessing in ArcGIS® Copyright © 2001–2004 ESRI All rights reserved. Printed in the United States of America. Reprinted 2004. The information contained in this document is the exclusive property of ESRI. This work is protected under United States copyright law and other international copyright treaties and conventions. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, 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 with permission. Some of the illustrations in this work were made from data supplied by Collins Bartholomew Ltd.; IHS Energy; Riley County, Kansas, GIS; and SANDAG. 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. Government acquire greater than RESTRICTED/LIMITED RIGHTS. At a minimum, use, duplication, or disclosure by the U.S. Government is subject to restrictions as 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 Technical Data/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. ESRI, the ESRI globe logo, 3D Analyst, AML, ArcCatalog, ArcEditor, ArcGIS, ArcGlobe, ArcIMS, ArcInfo, ArcMap, ArcReader, ArcScene, ArcSDE, ArcToolbox, ArcView, BusinessMAP, ModelBuilder, RouteMAP, StreetMap, 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 1 06/11/2004, 2:44 PM 1 Introduction 1 Contents Running tools via their dialog boxes 2 Running tools at a command line 3 Building models of your work flow 4 Adding scripts to toolboxes 5 Tips on learning how to perform geoprocessing in ArcGIS 6 2 Quick-start tutorial 9 Exercise 1: Finding coastal sage scrub near proposed roads 12 Exercise 2: Joining fields to the vegetation data 21 Exercise 3: Clipping data to the study area 29 Exercise 4: Finding high-quality habitat patches 39 Exercise 5: Finding habitat patches impacted by proposed roads 61 3 Geoprocessing basics 69 Geoprocessing: The big picture 70 Introducing geoprocessing methods 71 Working with data 79 Results from running tools 90 Geoprocessing settings 92 Saving and loading geoprocessing settings 93 Keeping track of geoprocessing operations 95 Sharing your geoprocessing work 97 4 Working with toolboxes 101 Opening and docking the ArcToolbox window 102 Locating the system toolboxes 103 Creating new toolboxes 104 Managing toolboxes 106 Adding documentation to toolboxes 114 Viewing documentation for toolboxes 125 Rules for working with toolboxes 127 iii Toc.pmd 3 06/14/2004, 11:46 AM 5 Working with toolsets and tools 129 Managing toolsets 130 Working with tools 132 Creating models and adding scripts 140 Setting parameters 145 Changing tool properties 150 Adding documentation to tools 159 Viewing documentation for tools 169 12 Finding tools 173 Understanding tool licensing 175 6 Specifying environment settings 177 About environment settings 178 Specifying environment settings 181 Specifying general settings 185 Working with workspaces 186 Specifying coverage settings 200 About coverage precision 202 Setting precision for coverages 204 Specifying geodatabase settings 205 Specifying raster geodatabase settings 211 Specifying raster analysis settings 217 7 Using the Command Line window 221 Starting the Command Line window 222 Working with the command line 224 About variables 233 Creating variables 234 Managing variables 237 8 Introducing model building 241 What is a model? 242 What is the ModelBuilder window? 244 iv GEOPROCESSING IN A RCGIS Toc.pmd 4 06/14/2004, 11:46 AM Building models 245 A model building example 248 Creating a new model 252 9 Using the ModelBuilder window 255 Building a model 256 Element states 262 Running a model 263 Using nonexistent output data 268 Working with variables 270 About intermediate data 286 Working with intermediate data 288 Controlling the flow of processing 289 Using the Select Data tool 297 Working with model elements 299 Working with diagram properties 304 Changing diagram properties 310 Navigating in the model 316 Validating a model 319 Repairing a model 320 Print setup 322 Setting up and printing a model 325 Generating a report 327 Documenting a process 329 Importing a model from ArcView GIS 3 331 Exporting a model 333 Appendix 335 Glossary 347 Index 357 CONTENTS v Toc.pmd 5 06/14/2004, 11:46 AM Toc.pmd 6 06/14/2004, 11:46 AM Introduction 1 IN THIS CHAPTER Geoprocessing is the processing of geographic information, one of the basic • Running tools via their dialog functions of a geographic information system (GIS). It provides a way to boxes create new information by applying an operation to existing data. Any alteration or information extraction you perform on your data involves a • Running tools at a command line geoprocessing task. It can be a task such as converting geographic data to a different format, or it can involve multiple tasks performed in sequence, such • Building models of your work flow as those that clip, select, then intersect datasets. • Adding scripts to toolboxes Within ArcGIS® you can perform geoprocessing tasks in a number of ways. • Tips on learning how to perform Run a tool using its dialog box. Open a tool’s dialog box, fill in parameter geoprocessing in ArcGIS values, and click OK to run the tool. Run tools at a command line. Type the tool name and its parameter values at 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 work flow. Alter parameter values, then rerun the model with a single click. Create and run a script that runs geoprocessing tools. Use system batch processing scripts for repetitive tasks, such as those that run the same tool on multiple inputs, or create your own scripts that run geoprocessing tools. The next few pages show you some of the geoprocessing tasks that can be performed within ArcGIS, and the quick-start tutorial in Chapter 2 will help you become familiar with the environment. As you start to use ArcGIS to perform your own geoprocessing tasks, you will discover even more. 1 Ch01.pmd 1 06/14/2004, 1:05 PM Running tools via their dialog boxes Your geoprocessing tasks can easily be performed by running the dialog box of a system tool—a tool installed with ArcGIS—or a custom tool—a model or a script you have created. Inside a tool’s dialog box, simply enter parameter values and click OK to run the tool. Use the help available within the tool’s dialog box to help you supply parameter values. Run tools using a dialog box to supply parameter values. In the gas prospecting example, the Kernel Density system tool calculates the density of producing wells. The result from this tool shows areas that have a high density of producing wells, and this is the first step in finding areas similar to an existing gas field. 2 GEOPROCESSING IN A RCGIS Ch01.pmd 2 06/14/2004, 1:05 PM Running tools at a command line Tools 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 press Enter. Usage is displayed as you type, helping you supply appropriate parameter values. You can edit the parameter values for a tool run at the command line in a dialog box, then reexecute the tool. Messages tell you the status of the processing. Run tools at a command line by typing the tool name and its parameter values. In the gas prospecting example, the Near tool is run to assess if the distance to a fault line is significant in the production of gas in the existing field. INTRODUCTION 3 Ch01.pmd 3 06/14/2004, 1:05 PM Building models of your work flow Create a model of your geoprocessing work flow by stringing processes together, then run the model with a single click. By setting model parameters, the user of your model can supply values for these parameters when your model is run via its dialog box or the command line. Build a model by adding tools to a ModelBuilder™ window, setting parameter values for each tool, and stringing processes together. The Arbuckle Prospecting model above locates areas with features similar to those within an existing gas field. The located areas (in red in the display) could have a high probability of being gas-producing areas. 4 GEOPROCESSING IN A RCGIS Ch01.pmd 4 06/14/2004, 1:05 PM Adding scripts to toolboxes Scripts 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 scripting language, such as Python, JScript, or VBScript, or they can be ARC Macro Language (AML™) scripts or executable files.