ArcGIS 9Using ArcGIS Spatial Analyst Copyright 2004 ESRI All 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 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 Quick-start tutorial data: courtesy of the state of Vermont 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, ArcCatalog, ArcGIS, ArcInfo, ArcEditor, ArcView, ArcMap, ArcScene, ArcGlobe, ArcToolbox, ModelBuilder, 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. IN THIS CHAPTER 1 Using the Spatial Analyst tools available with ESRI ArcGIS , you can easily perform spatial analysis on your data. You can provide answers to simple spatial questions, such as How steep is it at this location? or What direction is this location facing? Or you can find answers to more complex spatial questions, such as Where is the best location for a new facility? or What is the least costly path from A to B? The comprehensive set of Spatial Analyst tools within ArcGIS allows you to explore and analyze your spatial data and enables you to find solutions to your spatial problems. You can run tools from the Spatial Analyst toolbox or the command line, accessible via any ArcGIS Desktop application, or you can run tools from the Spatial Analyst toolbar in ArcMap. You can also create your own custom tools (models or scripts) to run a sequence of tools at one time. Tutorial scenario The town of Stowe, Vermont, USA, has experienced a substantial increase in population. Demographic data suggests this increase has occurred due to families with children moving to the region, taking advantage of the many recreational facilities located nearby. It has been decided that a new school must be built to take the strain off the existing schools, and as a town planner you have been assigned the task of finding the potential site. This tutorial will show you how to use many of the available tools and will give you a solid basis from which you can start to think about how to solve your own specific spatial problems. Quick-start tutorial * Exercise 1: Preparing for analysis * Exercise 2: Finding a site for a new school * Exercise 3: Finding an alternate access route to the new school site 2 USING ARCGIS SPATIAL ANALYST It is assumed that you have installed ArcGIS Desktop (ArcView , ArcEditor, or ArcInfo) and the Spatial Analyst extension before you begin this tutorial. In ArcGIS 8 versions, you accessed Spatial Analyst tools from the Spatial Analyst toolbar in ArcMap. In ArcGIS 9, you can still use the Spatial Analyst toolbar, but you can also run tools from the SpatialAnalyst toolbox. Youll access tools in the toolbox from the ArcCatalog tree or the ArcToolboxwindow. The ArcToolbox window can be docked in any ArcGIS Desktop application, meaning you can run Spatial Analyst tools in applications such as ArcCatalog, ArcScene, or ArcGlobe. The data required is included on the ArcGIS Desktop CD. After running the ArcGIS setup, on the Additional Installation Components dialog box, check to install theArcGIS Tutorial Data. In the ArcGIS Tutorial Data Setup wizard, select to install the Spatial data (the default installation path is C:\arcgis\ArcTutor\Spatial). The datasets were provided courtesy of the state of Vermont for use in this tutorial. The tutorial scenario is fictitious, and the original data has been adapted for the purpose of the tutorial. The datasets are: Dataset Description Elevation Raster dataset of the elevation of the area Landuse Raster dataset of the land use types over the area Roads Feature dataset displaying linear road network for the town of Stowe Rec_sites Feature dataset displaying point locations of recreation sites Schools Feature dataset displaying point locations of existing schools Destination Feature dataset displaying the destination point used when finding the best route for a new road This tutorial is divided into exercises and is designed to let you explore the SpatialAnalyst functionality in ArcGIS at your own pace. In Exercise 1, youll prepare for analysis. Youll copy the tutorial data locally and create a folder and a geodatabase to hold your results. Youll learn the location of the Spatial Analyst tools, create a hillshade output, and explore your data. In Exercise 2, youll create a suitability map to help you find the best location for a new school. You will derive datasets of distance and slope, reclassify datasets to a common scale, then weight those that are more important to consider and combine them to find the most suitable locations. Youll then locate the optimal site using the selection tools within ArcMap. In Exercise 3, youll find the least costly route for an alternate access road to the new school site. You will need approximately 50 minutes of focused time to complete the tutorial. Alternatively, you can perform the exercises in sequence one at a time, saving your results along the way when recommended. QUICK-START TUTORIAL 3 Exercise 1: Preparing for analysis In this exercise, youll prepare for analysis by first copying the tutorial data locally, then creating a folder and a geodatabase for your results. Youll locate the Spatial Analyst tools and create a hillshade output to display transparently with your other layers. Youll explore your input data and open the ArcToolbox window. This exercise will take approximately 15 minutes to complete. Organizing your data Before working with SpatialAnalyst tools, youll organize your tutorial data using ArcCatalog. Starting ArcCatalog 1. Start ArcCatalog by either double-clicking a shortcut installed on your desktop or using the Programs list in the Start menu. Locating the tutorial data By connecting to a folder in ArcCatalog, you can quickly see the folders and data sources it contains. Youll now begin organizing your tutorial data by establishing a folder connection to its location. 1. Click the Connect to Folder button. 2. Type the pathname or navigate to the location where you installed the tutorial data; for example, if you installed ArcGIS on your C:\ drive, type C:\arcgis\ArcTutor\Spatial, then click OK to establish a folder connection. 1 1 2 4 USING ARCGIS SPATIAL ANALYST Your new folder connection to the tutorial data is listed in the ArcCatalog tree. Creating a working copy of the tutorial data Youll now copy the tutorial data into a folder on a local disk to maintain the integrity of the original data. Once it has been copied, you will create a connection to the folder containing the data. 1. Click the connection to the tutorial data (for example, C:\arcgis\ArcTutor\Spatial), then click the Contents tab and click the six datasets (schools.shp, roads.shp, rec_sites.shp, destination.shp, landuse, and elevation) contained within the folder. Press and hold the Ctrl key while selecting the datasets to select more than one. 2. Click the Copy button on the Standard toolbar. 3. Right-click the C:\ (or an alternative drive) folder connection in the ArcCatalog tree, point to New, then click Folder. 4. Rename the created folder Spatial, then press Enter. 5. Double-click the Spatial folder and click Paste on the Standard toolbar to paste the copied datasets into it. 12 3 5 QUICK-START TUTORIAL 5 6. Click the Connect to Folder button again, create a connection to your Spatial folder, and click OK. Your new folder connection, for example, C:\Spatial, is now listed in the ArcCatalog tree, as shown in the graphic that follows. You will access this connection many times during this tutorial. Creating a folder and a personal geodatabase for results In the next exercise, youll build a model that will help you locate areas suitable for building a new school. Youll need a folder to hold the majority of your results. Youll also need a personal geodatabase to hold a feature class youll create. By creating a feature class inside a geodatabase, youll be able to use the default area field as part of the analysis. Creating a new folder Youll now create a Results folder. This folder will hold results from your model in the next exercise. 1. Right-click the connection to your Spatial folder in the ArcCatalog tree, point to New, and click Folder. 2. Type Results for the folder name and press Enter. Creating a new personal geodatabase Youll now create a Site.mdb geodatabase within the Results folder. This geodatabase will hold results from your model in the next exercise. 1. Right-click the Results folder, point to New, and click Personal Geodatabase. 2. Right-click the personal geodatabase created and click Rename. 3. Type Site and press Enter. 1 1 3 6 USING ARCGIS SPATIAL ANALYST Locating the Spatial Analyst tools Spatial Analyst tools can be accessed via the Spatial Analyst toolbar in ArcMap or via the Spatial Analyst Tools toolbox. The toolbox is accessed via the Toolboxes folder in the ArcCatalog tree or the ArcToolbox window. The Toolboxes folder is not added to the ArcCatalog tree by default. Youll add the Toolboxes folder so you can view the Spatial Analyst tools that are available. 1. Click Tools on the Main menu and click Options. 2. Click the General tab and check Toolboxes if it is not already checked. 3. Click OK on the Options dialog box. 4. Expand the Toolboxes folder, then expand the System Toolboxes folder. Expand the Spatial Analyst Tools toolbox to view the Spatial Analyst tools that are available. They are organized into functional groups called toolsets to make them easier to locate. The ArcToolbox window can be used in any ArcGIS Desktop application to access Spatial Analyst tools. Youll learn more about the ArcToolbox window and also the Spatial Analyst toolbar in this exercise. 5. Click File on the Main menu and click Exit to end the ArcCatalog session. 1 2 4 5 QUICK-START TUTORIAL 7 Starting ArcMap 1. Start ArcMap by either double-clicking a shortcut installed on your desktop or using the Programs list in the Start menu. 2. Click OK to open a new empty map. Adding data to your ArcMap session 1. Click the Add Data button on the Standard toolbar. 2. Navigate to the folder on your local drive where you copied the tutorial data (for example, C:\Spatial). 3. Click the destination dataset; press and hold down the Shift key; then click elevation, landuse, rec_sites, roads, and schools. 4. ClickAdd. The datasets are added to the ArcMap table of contents as layers. Checking out a Spatial Analyst license 1. Click the Tools menu and click Extensions. 2 1 4 1 8 USING ARCGIS SPATIAL ANALYST 2. Check Spatial Analyst. 3. Click Close. Adding the Spatial Analyst toolbar 1. Click View on the Main menu, point to Toolbars and click Spatial Analyst. The Spatial Analyst toolbar is added to your ArcMap session. Creating a hillshade Youll start out using the SpatialAnalyst toolbar. Youll run the Hillshade tool so you can view and explore the output from this tool with the rest of your input data later in this exercise. A hillshade is a shaded relief raster created by taking an elevation raster and setting an illumination source (for example, the sun) at a user-specified azimuth (the angular direction of the illumination source, in positive degrees from 0 to 360) and altitude (the angle of the illumination source above the horizon). The visual effect of a hillshade can be dramatic when displayed transparently over other layers in your ArcMap display. 1. Click the SpatialAnalyst dropdown arrow, point to SurfaceAnalysis, and click Hillshade. 3 2 1 QUICK-START TUTORIAL 9 2. Click the Input surface dropdown arrow and click elevation. 3. Youll accept the default values set for the Azimuth and Altitude parameters, since these values provide optimal results when using a hillshade for display purposes. 4. Youll also accept the default and not model shadows, so the local illumination of the surface will be calculated whether or not a cell falls in the shadow of another cell. If your x,y and z values are all in the same unit of measure (for example, they are all in meters), you can accept the default Z factor of 1, so the z units are not converted. The x,y units in the elevation data, however, are in meters, and the z values (the elevation values) are in feet. By multiplying the z values by a z factor of 0.3048, they will be converted to meters, since there are 0.3048 meters in one foot. Note: Setting an appropriate z factor is critical for good results if your input surface is stored in a geographic coordinate system (for example, the x,y units are a spherical measurement, such as decimal degrees or decimal seconds). View the online Help for the Hillshade tool for an explanation of suitable z factors. 5. Type a value of 0.3048 for the Z factor parameter. 6. The cell size (value of 30 meters) of the input dataset will be used, as environment settings have not been specified on the Options dialog box (accessed via the Spatial Analyst toolbar context menu). 7. Instead of creating a temporary raster output, click in the Output raster text box and remove the default text . 8. Type the pathname to your results folder (for example, C:\Spatial\Results\) and type hillshd for the name of the output. A permanent result will be created. 9. Click OK to run the tool. 10. In the table of contents, click and drag the hillshade result below landuse. 11. Check the elevation layer off. Displaying and exploring data You will now explore the display capabilities of ArcMap by changing the symbology of one of the layers and applying transparency so you can see the hillshade output you have created underneath your other layers in the display. 3 4 2 5 6 8 9 10 USING ARCGIS SPATIAL ANALYST 1. Right-click landuse in the table of contents and click Properties. 2. Click the Symbology tab. All landuse categories are currently drawn using cell values as the Value Field and in random colors. You will change the Value Field to be more meaningful and change the color of each symbol to show a more appropriate color for each landuse on the map. 3. Click the Value Field dropdown arrow and click Landuse. 4. Double-click each symbol and choose a suitable color to represent each landuse type (for example, water should be blue). 5. Click OK. 1 2 3 4 5 The changes you make are reflected in the table of contents and in the map. 6. Click View on the Main menu, point to Toolbars, and click Effects. 6 QUICK-START TUTORIAL 11 7. Click the Layer dropdown arrow and click landuse. 8. Click the Adjust Transparency button and move the slider to 30 percent transparency. The hillshd layer can now be seen underneath the landuse layer, giving a vivid impression of the terrain. Highlighting a selection on the map Examining the Attribute Table gives you an idea of the number of cells of each attribute in the dataset. 1. Right-click landuse in the table of contents and click Open Attribute Table. Notice that Forest (value of 6) has the largest count, followed by Agriculture (value of 5), then Water (value of 2). The count is the number of cells in the dataset with that value. 2. Click the row representing Wetlands (value of 7). This selected set, all areas where the landuse is Wetlands, is highlighted on the map. 3. Click the Options button on the Attributes of landuse table, then click Clear Selection. 4. Click the Close button to close the Attributes of landuse table. 7 8 1 2 12 USING ARCGIS SPATIAL ANALYST Identifying features on the map 1. Click the Identify tool on the Tools toolbar. 2. Click the Layers dropdown arrow on the Identify Results dialog box and click . 3. Click the Rec_site in the location shown to identify the features in this particular location for all layers. Note: Your display will not be zoomed in this much; this is only to show the location of the recreation site to click. 4. Expand each layer to obtain the value for each layer in this location. 5. Close the Identify Results dialog box. Examining a histogram 1. On the Spatial Analyst toolbar, click the Layer dropdown arrow and click landuse. 2. Click the Histogram button. The histogram displays the number of cells of each type of landuse. Since no cell size has been specified in the Cell Size tab of the Options dialog box, the default takes the cell size of the input25 meters in this case. If the cell size set in the Options dialog box were larger, there would be less cells of each landuse type, but each cell would cover a larger area. 3. Close the histogram. 1 2 3 4 5 1 2 3 QUICK-START TUTORIAL 13 Opening the ArcToolbox window As well as accessing tools from the Spatial Analyst toolbar, you can access similar tools and many more of them from theArcToolbox window. 1. Click the Show/Hide ArcToolbox button on the Standard toolbar of ArcMap to open the ArcToolbox window. The window is placed within the application. Its position may vary depending on the windows you have open. From the ArcToolbox window, you can access all the geoprocessing tools available with ArcGIS. There are more than 450 tools available, including more than 150 Spatial Analyst tools contained within the SpatialAnalyst Tools toolbox. All tools can be run via dialog boxes or a command line. Docking the ArcToolbox window The ArcToolbox window can be placed anywhere in the application or on the desktop outside the ArcMap window. 1. Click and drag the bar at the top of the ArcToolbox window. 2. Place the ArcToolbox window over the ArcMap table of contents, then drop the panel. The outline of the ArcToolbox window helps you place it in the desired position. Saving the map document As the last step in this exercise, youll save the map document. Youll use this map document in the next exercise. 1. Click File, then click Save As. 1 2 1 1 14 USING ARCGIS SPATIAL ANALYST 2. Navigate to your Spatial folder and type Site_Analysis.mxd for the filename. 3. Click Save. In this exercise, you copied the tutorial data locally and explored it, learned how to access Spatial Analyst tools, and learned how to run them from the Spatial Analyst toolbar. In the next exercise, youll build a model by adding tools from the Spatial Analyst Tools toolbox to a ModelBuilder window to run a sequence of tools that will locate the areas that are suitable for building a new school. You can continue on to Exercise 2 or stop and complete the tutorial at a later time. If you do not move on to Exercise 2 now, do not delete your working copy of the tutorial data or the folder connection that accesses it in ArcCatalog. 2 3 QUICK-START TUTORIAL 15 Exercise 2: Finding a site for a new school in Stowe, Vermont In this exercise, you will build a model that finds suitable locations for a new school. The steps to produce such a suitability map are outlined below. Your input datasets in this exercise are landuse, elevation, rec_sites, and schools. You will derive slope, distance to recreation sites, and distance to existing schools, then reclassify these derived datasets to a common scale from 110. You will then weight them according to a percentage influence and combine them with landuse data to produce a map displaying suitable locations for the new school. Youll then select the optimal site for the new school from the alternatives. This exercise will take approximately 20 minutes to com- plete. Setting up If you are continuing on from the previous exercise and have the Site Analysis map document open, skip the next three steps and go to the next section, Creating a new toolbox. 1. Start ArcMap by either double-clicking a shortcut installed on your desktop or using the Programs list in the Start menu. 2. Click C:\Spatial\Site Analysis.mxd in the Browse for maps list to open the map document created in the previous exercise. 3. Click the Show/Hide ArcToolbox button on the Standard toolbar to open the ArcToolbox window if it is not present. Creating a new toolbox Youll first create a new toolbox to hold the models you will create in this exercise and the next one. The default location for new toolboxes created in the ArcToolbox window is generally \Documents and Settings\yourlogin\Application Data\ESRI\ArcToolbox\My Toolboxes. Youll change this path to be your Spatial\Results folder. 1. Click Tools on the Main Menu and click Options. 1 16 USING ARCGIS SPATIAL ANALYST 2. Click the Geoprocessing tab. 3. Type C:\Spatial\Results (or an alternative drive) for the location of the My Toolboxes folder. 4. Click OK. All toolboxes created in the ArcToolbox window within ArcMap will be created in this location. 5. Right-click the ArcToolbox window and click New Toolbox. 6. Change the default name for the toolbox to Site Analysis Tools, then click Enter. 7. Right-click the SiteAnalysis Tools toolbox and click Properties. 8. Check that the location of the toolbox on disk is your Results folder. 9. Click OK. Creating a new model You can perform your Spatial Analyst tasks by simply opening tool dialog boxes, supplying values for parameters, and clicking OK to run each tool, one after another. Alternatively, you can run tools at a command line. For information on running tools at the command line, see Chapter 7 of Geoprocessing in ArcGIS. If you intend to run a sequence of tools, experiment with parameter values to achieve the desired result, or package your methodology so others can apply it to their data, you should build a model. A model is built by stringing tools together inside a ModelBuilder 5 7 3 2 QUICK-START TUTORIAL 17 window. Once your model is created, you can easily experiment with parameter values, use different input data, run the model over and over again, and share it with others. In this exercise, you will create a model to find a suitable location for a new school. 1. Right-click the Site Analysis Tools toolbox, point to New, and click Model. An empty ModelBuilder window will open. Renaming the model 1. Click the Model menu and click Model Properties. 2. Click the General tab. 3. Type find_site in the Name text box and Find location for school in the Label text box. The name is used in scripting and at the command line. The label is the display name for the model. 4. Check Store relative path names so that all paths for sources of information referenced by the tool are saved relative to the location of the toolbox. If the toolbox and its data are moved, paths to data sources will be altered accordingly. 1 1 3 4 2 18 USING ARCGIS SPATIAL ANALYST Specifying environment settings Before you start to perform analysis on your data, you should set up any relevant environment settings. When running tools via the SpatialAnalyst toolbar, youll set environment settings in the Options dialog box (accessed via the Spatial Analyst toolbars context menu). When working with tools via the SpatialAnalyst Tools toolbox, youll set environment settings via the Environment Settings dialog box. Although they have similar properties, the SpatialAnalyst toolbox Options environment settings and the ArcToolbox environment settings do not share information or interact. There are three levels at which you can set environment settings when working with tools in the SpatialAnalyst Tools toolbox. You can specify environment settings for the application that will apply to all tools (right-click the ArcToolbox window and click Environments to access the Environment Settings dialog box).Alternatively, you can set environment settings for a specific model or for a process within a model (right-click the tool element of a process in a model and click Properties to override environment settings for a model or the application). Environment settings for the application are used by default unless they are specified for a model or for a process within a model. Settings for a model will override settings for the application. Settings for a process will override settings for the application and the model to which the process belongs. For more information on environment settings, see Chapter 6 of Geoprocessing in ArcGIS. As your environment settings apply to each process of this model only, youll set environment settings for the model. 1. Click the Environments tab. 2. Expand the General Settings tree. 3. Check Current Workspace, Output Extent, and Scratch Workspace. 4. Expand the Raster Analysis Settings tree. 5. Check Cell Size. 6. Click Values. 1 2 4 6 QUICK-START TUTORIAL 19 7. Expand the General Settings section. 8. In the Current Workspace text box, type the pathname to your Spatial folderfor example, C:\Spatialfor its value. Alternatively, click the Browse button to the right of the Current Workspace text box and navigate to this location. The Current Workspace is the location of your project data. 9. In the Scratch Workspace text box, type the pathname to your Results folderfor example, C:\Spatial\Resultsfor its value.Alternatively, click the Browse button to the right of the Scratch Workspace text box and navigate to this location. The Scratch Workspace will be set by default as the path for outputs from running tools. Youll also set the extent for results from running Spatial Analyst tools to be the same as the elevation data, as this is the approximate boundary of your study area. All results generated will have the same extent as the elevation dataset. 10. Click the Output Extent dropdown arrow and click Same as Layer elevation. 11. Expand the Raster Analysis Settings section. 12. Your elevation dataset has the largest cell size (30 meters). Click the Cell Size dropdown arrow and click Same as Layer elevation. The cell size of your elevation layer will be applied to all subsequent raster outputs. Note: Setting a smaller cell size than your largest input will not mean you have more detailed information in subsequent raster results; you will just have more cells of the same value which may affect your display and calculation speeds. Although the software does not prevent it, it is considered incorrect to set a cell size smaller than your largest input cell size. 13. Click OK on the Environment Settings dialog box. 14. Click OK on the Model Properties dialog box. 15. Click the Model menu and click Save. The models properties are updated. 7 8 9 Q W E R 20 USING ARCGIS SPATIAL ANALYST Deriving datasets In the previous exercise, you added the input datasets that you will use in the model to your ArcMap session. Youve set up environment settings. You are ready to start to process your project data to locate suitable areas for the new school. Youll derive the following from your project data: Slope from elevation Distance from recreation sites Distance from existing schools Deriving slope Since the area is mountainous, you need to find areas of relatively flat land to build on, so you will take into consideration the slope of the land. 1. In the Spatial Analyst Tools toolbox, expand the Surface toolset. 2. Click and drag the Slope tool into the ModelBuilder window. An element that references the Slope tool is created in the display window. 3. Right-click the Slope tool element and click Open. 4. Click the Input raster dropdown arrow and click the elevation layer. Note that layers are denoted with a yellow icon in the dropdown list. 5. Accept the default path and name given for the Output raster parameter value. The default path is set to the scratch workspace you set up earlier in the Environment Settings dialog box. 6. Leave the default for the Output measurement parameter to calculate slope in degrees. 7. As you did when calculating hillshade, type 0.3048 for the value of the Z factor parameter to convert the z values to the same unit of measure as the x,y units (from feet to meters). 8. Click OK. 3 2 u QUICK-START TUTORIAL 21 9. Click the Auto Layout button, then click the Full Extent button to apply the current diagram properties to the elements and place them within the display window. Notice that the process is now colored in, meaning it is ready to run. 10. Right-click the derived data element for the Slope tool and click Rename. 11. Type Slope output and click OK. Note: Renaming an element label does not alter the name of the output on disk. 12. Right-click the Slope output data element again and click Add To Display. With the Add To Display property checked, the derived data referenced by this element will be added to the display each time the model is run from the ModelBuilder window. 13. Right-click the Slope tool element and click Run. 5 6 4 7 8 Q E Auto Layout Full Extent R W 22 USING ARCGIS SPATIAL ANALYST Notice that as the tool of the process runs, its progress is documented in the progress dialog box and the tool element that references the tool is highlighted in red. When the tool has finished running, the tool element and its derived data element become shaded, indicating that it has run and the derived data has been created on disk. 14. Check the Close this dialog when completed successfully check box if the Slope progress dialog box is present, then click Close. 15. Examine the layer added to your ArcMap display. Steep slopes are displayed in red, less steep slopes in green in the output layer. Deriving distance from recreation sites To find locations close to recreation sites, you must first calculate the Euclidean (straight-line) distance from recreation sites. 1. In the Spatial Analyst Tools toolbox, expand the Distance toolset. 2. Click and drag the Euclidean Distance tool into the ModelBuilder window. An element that references the Euclidean Distance tool is created in the display window. 3. Right-click the Euclidean Distance tool element and click Open. 4. Click the Input raster or feature source data dropdown arrow and click the rec_sites layer. 5. Accept the default path for the value of the Output distance raster parameter, but type EucD_rsites for the name. Instead of specifying a set distance from each point to use when calculating the output, youll accept the default value for the Maximum distance parameterthe edge of the output raster is used as the maximum distance. The cell size is taken from the environment setting that you set up previously to be the same as your elevation data. In this exercise, the Output direction raster is not required. 6. Click OK. T 2 u QUICK-START TUTORIAL 23 7. Click the Auto Layout button, then click the Full Extent button to apply the current diagram properties to the elements and place them within the display window. 8. Right-click the EucD_rsites derived data element for the Euclidean Distance tool and click Rename. 9. Type Distance to recreation sites in the Enter new element name text box and click OK on the Rename dialog box. 10. Right-click the Distance to recreation sites derived data element and click Add To Display. 11. Right-click the Euclidean Distance tool element and click Run to run the process. 12. Examine the layer added to your ArcMap display. Distances increase the farther you are from a recreation site. Deriving distance from schools To find locations away from existing schools, you must first calculate the Euclidean (straight-line) distance from schools. 1. In the Spatial Analyst Tools toolbox, expand the Distance toolset. 2. Click and drag the Euclidean Distance tool into the ModelBuilder window. 4 5 6 Q u 2 W 24 USING ARCGIS SPATIAL ANALYST An element that references the Euclidean Distance tool is created in the display window. 3. Right-click the Euclidean Distance (2) tool element and click Open. 4. Click the Input raster or feature source data dropdown arrow and click the schools layer. 5. Accept the default path for the value of the Output distance raster parameter, but type EucD_sch for the name. As with the distance to rec_sites output, instead of specifying a set distance from each point to use when calculating the output, youll accept the default value for the Maximum distance parameterthe edge of the output raster is used as the maximum distance. The cell size is taken from the environment setting that you set up previously to be the same as your elevation data. In this exercise, the Output direction raster is not required. 6. Click OK. 7. Click the Auto Layout button, then click the Full Extent button to apply the current diagram properties to the elements and place them within the display window. 8. Right-click the derived data element for the Euclidean Distance tool and click Rename. 9. Type Distance to schools and click OK. 10. Right-click the Distance to schools derived data element and click Add To Display. 11. Right-click the Euclidean Distance (2) tool element and click Run to run the process. 12. Examine the layer added to your ArcMap display. Distances increase the farther you are from a school. Q W 5 4 6 QUICK-START TUTORIAL 25 Reclassifying datasets After deriving the necessary datasets, you are ready to combine them to locate suitable sites for the new school. It is not possible to combine the datasets you have derived and landuse in their present formfor example, combining a cell value in which slope equals 15 degrees with a cell value in which distance to schools equals 5 miles and one in which the cell value for landuse equals 7 (forest)and get a meaningful answer that you can compare to other locations. To combine the datasets, they need to be set to a common measurement scale. That common measurement scale is what determines how suitable a particular locationeach cellis for building a new school. Using the Weighted Overlay dialog box, you can weight the values of each dataset, then combine them at one time. However, the inputs for the Weighted Overlay tool must contain discrete, integer values. Landuse is already categorized into discrete values; for example, forest equals a value of 7, so you can simply add this dataset directly into the Weighted Overlay dialog box and assign weights to the input cell values. The values in the datasets you derived in previous steps are all floating point, continuous datasets, categorized into ranges, and they must first be reclassified so that each range of values is assigned one discrete, integer value. Potentially, the value given to each range can be any value, provided you note the range that the value corresponds to. This is because you can weight these values within the Weighted Overlay dialog boxthe next step after reclassifying the derived datasets. However, it is easier to weight the cell values for derived datasets while reclassifying. In the Weighted Overlay dialog box, you can accept the default and leave the scale values the same as the input values. You will reclassify each derived dataset to a common measurement scale, giving each range a discrete, integer value between 1 and 10. Higher values will be given to attributes within each dataset that are more suitable for locating the school. Reclassifying slope It is preferable that the new school site be located on relatively flat ground. Youll reclassify the slope output, slicing the values into equal intervals. Youll give a value of 10 to the most suitable range of slopesthose with the lowest angle of slopeand 1 to the least suitable range of slopesthose with the steepest angle of slopeand rank the values in between linearly. 1. In the Spatial Analyst Tools toolbox, expand the Reclass toolset. 2. Click and drag the Reclassify tool into the ModelBuilder window. u 2 26 USING ARCGIS SPATIAL ANALYST An element that references the Reclassify tool is created in the display window. 3. Right-click the Reclassify tool element and click Open. 4. Click the Input raster dropdown arrow and click the variable Slope output. Variables are denoted with blue icons in the dropdown list. When you drag data into a ModelBuilder window or set the data referenced by input or derived data elements within a tools dialog box, the elements created in the ModelBuilder window are variables that can be shared between processes. 5. Accept the default for the Reclass field parameter so the Value field will be used. 6. Click Classify. 7. Click the Method dropdown arrow and click Equal Interval. 8. Click the Classes dropdown arrow and click 10. 9. Click OK. You want to reclassify the slope layer so steep slopes are given low values, since these are least suitable for building. 3 4 5 6 8 7 9 QUICK-START TUTORIAL 27 15. Type Reclassed slope in the Enter new element name text box and click OK. 16. Right-click the Reclassed slope derived data element and click Add To Display. 17. Right-click the Reclassify tool element and click Run to run the process. 18. Examine the layer added to your ArcMap display. Locations with higher valuesless steep slopesare more suitable than locations with lower valuessteeper slopes. 10. Click Reverse New Values so that ranges of values representing less steep slopes receive a higher new value, since these areas are more suitable for building. 11. Accept the default path for the value of the Output raster parameter, but type Rslope for the name. 12. Click OK. 13. Click the Auto Layout button, then click the Full Extent button to apply the current diagram properties to the elements and place them within the display window. 14. Right-click the derived data element for the Reclassify tool and click Rename. T U E Q W I 28 USING ARCGIS SPATIAL ANALYST Reclassifying distance to recreation sites The school should be located as close as possible to a recreational facility. You will reclassify the distance to recreation sites output, giving a value of 10 to ranges of values that represent areas closest to recreation sitesthe most suitable locationsgiving a value of 1 to ranges of values that represent areas far from recreation sitesthe least suitable locationsand ranking the values linearly in between. 1. In the Spatial Analyst Tools toolbox, expand the Reclass toolset. 2. Click and drag the Reclassify tool into the ModelBuilder window. An element that references the Reclassify tool is created in the display window. 3. Right-click the Reclassify (2) tool element and click Open. 4. To connect the output from the Euclidean Distance tool as input for the Reclassify (2) tool, click the Input raster dropdown arrow and click the variable Distance to recreation sites. 5. Accept the default for the Reclass field parameter so the Value field will be used. 6. Click Classify. 7. Click the Method dropdown arrow and click Equal Interval. 8. Click the Classes dropdown arrow and click 10. 9. Click OK. You want the school to be close to a recreational facility, so you will give higher values to ranges of values that represent locations close to recreational facilities, since distances that are close are most desirable. u 2 4 5 6 QUICK-START TUTORIAL 29 10. Click Reverse New Values so that distances close to recreational facilities receive a higher new value, since these areas are more desirable. 11. Accept the default path for the value of the Output raster parameter but change the default name to Rdist_rec. 12. Click OK. 13. Click the Auto Layout button, then click the Full Extent button to apply the current diagram properties to the elements and place them within the display window. 14. Right-click the derived data element for the Reclassify (2) tool and click Rename. 15. Type Reclassed distance to recreation sites and click OK. 16. Click the Reclassed distance to recreation sites derived data element, move the cursor over one of the blue handles surrounding the element, then click and drag to resize the element so all text can be seen. 17. Right-click the Reclassed distance to recreation sites derived data element and click Add To Display. 18. Right-click the Reclassify (2) tool element and click Run to run the process. 19. Examine the layer added to your ArcMap display. Locations with higher valuesareas close to recreation sitesare more suitable than locations with lower valuesareas far from recreation sites. Reclassifying distance to schools It is necessary to locate the new school away from existing schools to avoid encroaching on their catchment areas. You will reclassify the Distance to schools layer, giving a value of 10 to areas farthest from existing schoolsthe most suitable locationsgiving a value of 1 to areas near existing schoolsthe least suitable locationsand ranking the values in between linearly. By doing this, you will find out which areas are near and which areas are far from existing schools. E Q W O 30 USING ARCGIS SPATIAL ANALYST 1. In the Spatial Analyst Tools toolbox, expand the Reclass toolset. 2. Click and drag the Reclassify tool into the ModelBuilder window. An element that references the Reclassify tool is created in the display window. 3. Right-click the Reclassify (3) tool element and click Open. 4. Click the Input raster dropdown arrow and click the Distance to schools variable. 5. Accept the default for the Reclass field parameter so the Value field will be used. 6. Click Classify. 7. Click the Method dropdown arrow and click Equal Interval. 8. Click the Classes dropdown arrow and click 10. 9. Click OK. You want to position the school away from existing schools, so you will give higher values to ranges of values that represent locations farther away, as these locations are most desirable. As the default gives high New values more suitable locationsto high ranges of Old values locations farther away from existing schoolsyou do not need to change any values this time. u 2 4 5 6 QUICK-START TUTORIAL 31 10. Accept the default path for the value of the Output raster parameter, but type Rdist_sch for the name. 11. Click OK. 12. Click the Auto Layout button, then click the Full Extent button to apply the current diagram properties to the elements and place them within the display window. 13. Right-click the derived data element for the Reclassify (3) tool and click Rename. 14. Type Reclassed distance to schools and click OK. 15. Right-click the Reclassed distance to schools derived data element and click Add To Display. 16. Right-click the Reclassify (3) tool element and click Run to run the process. 17. Examine the layer added to your ArcMap display. Locations with higher valuesareas away from existing schoolsare more suitable than locations with lower valuesareas close to existing schools. 18. Click the Model menu and click Save. Weighting and combining datasets You are now ready to combine the derived datasets and landuse to find the most suitable locations. The values of the derived datasets representing slope, distance to recreation sites, and distance to schools have all been reclassified to a common measurement scale (more suitable cells have higher values). The landuse dataset is still in its original form because you can weight the cell values for this dataset as part of the weighted overlay process. Values representing areas of water and wetlands will be restricted. Youll also mark slope values that are less than 4 (the least suitable because they are too steep) as restricted so these values can be excluded. Youll learn more about restricted values and NoData later in this exercise. If all datasets were equally important, you could simply combine them, giving each equal influence; however, you have been Q W U O 32 USING ARCGIS SPATIAL ANALYST informed that it is preferable to locate the new school close to recreational facilities and away from other schools. You will weight all the inputs, giving each a percentage of influence. The higher the percentage, the more influence a particular input will have in the suitability model. You will give the inputs the following percentages of influence: Reclassed distance to rec_sites: 50% Reclassed distance to schools: 25% Reclassed slope: 13% Landuse: 12% 1. In the Spatial Analyst Tools toolbox, expand the Overlay toolset. 2. Click and drag the Weighted Overlay tool into the ModelBuilder window. An element that references the Weighted Overlay tool is created in the display window. 3. Right-click the Weighted Overlay tool element and click Open. The default evaluation scale is from 1 to 9 by 1. A scale of 110 was used when reclassifying datasets, so before adding input rasters to the Overlay tool, youll set the evaluation scale from 1 to 10 by 1. This means you will avoid having to update the scale values after adding your input datasets. 4. Type 1, 10, and 1 in the From, To, and By text boxes. 5. Click the Add Raster Row button to add the input rasters. u 2 3 4 5 QUICK-START TUTORIAL 33 6. Click the Input raster dropdown arrow and click the Reclassed distance to schools variable. 7. Accept the default Input field and click OK. The raster is added to the Weighted Overlay dialog box. The Field column displays the values of the Reclassed distance to schools output. The Scale Value column mimics the Field column because the evaluation scale was set to encompass the range of values in each input raster. You could modify the scale values for each class at this point, but for this input, the values were already weighted appropriately at the time of reclassifying. 8. Click the Add Raster Row button again to add the next input raster. 9. Click the Input raster dropdown arrow and click the Reclassed distance to recreation sites variable. 10. Accept the default value for the Input field parameter and click OK. The raster is added to the Weighted Overlay dialog box. The Field column displays the values of the Reclassed distance to recreation sites output. As with the Reclassed distance to schools input, the Scale Value column mimics the Field column because the evaluation scale was set to encompass the range of values in each input raster. You could modify the scale values for each class at this point, but again, for this input, the values were already weighted appropriately at the time of reclassifying. 11. Click the Add Raster Row button again to add the next input raster. 7 6 9 Q 34 USING ARCGIS SPATIAL ANALYST 12. Click the Input raster dropdown arrow and click the Reclassed slope variable. 13. Accept the default value for the Input field parameter and click OK. The raster is added to the Weighted Overlay dialog box. 14. Scroll down to the Reclassed slope input. Again, for this input, the values were already weighted appropriately at the time of reclassifying. However, you know you definitely do not want to build on slopes greater than about 35 percent, even if all other conditions are perfect. Youll make values from 1 to 3 restrictedsince these values represent slopes from 37.17263985 53.1037712 (the maximum slope). Setting a scale value to restricted assigns a value to that cell in the output weighted overlay result that is the minimum value of the evaluation scale set minus one (zero in this exercise). If there are no inputs to the Weighted Overlay dialog box with cells of NoData, you could use NoData as the scale value to exclude certain values. However, if you have NoData cells in any of your inputs, it is safest and essential to use Restricted instead. Potentially, you could have a result from the Weighted Overlay dialog box that contains cells of NoData that have come from one or more of the inputs (NoData on any input equals NoData in the result) and Restricted areas that you intentionally excluded. NoData and Restricted values should not be confused. Each serves a specific purpose. There may be areas of NoData where you dont know the value but that are actually suitable areas. If you use NoData to exclude certain cell values and there is NoData in one or more inputs, you will not know whether a cell of NoData means the area is restricted from use or there was no input data available in that location. 15. In the Scale Value column for the Reclassed slope raster, click the cell with a value of 1. 16. Click the dropdown arrow and click Restricted. 17. Follow this procedure for scale values of 2 and 3. 18. Click the Add Raster Row button again to add the last input raster. E R I O QUICK-START TUTORIAL 35 19. Click the Input raster dropdown arrow and click the landuse layer. 20. Click the Input field dropdown arrow and click Landuse. 21. Click OK. All input rasters are now added to the Weighted Overlay dialog box. 22. Scroll down to the landuse input. Youll now weight the scale values of the landuse layer so they are comparable with the other inputs. A lower value indicates that a particular landuse type is less suitable for building. The scale values for Water and Wetlands will be set as Restricted, since they cannot be built on and should be excluded. 23. Change the default scale values for the landuse layer to the following values: Brush/transitional5 Barren land10 Built up3 Agriculture9 Forest4 P A S DF 36 USING ARCGIS SPATIAL ANALYST Youll now set the scale values representing Water and Wetlands to Restricted. 24. In the Scale Value column, click the cell next to the landuse type Water. 25. Click the dropdown arrow and click Restricted. 26. In the Scale Value column, click the cell next to the landuse type Wetlands. 27. Click the dropdown arrow and click Restricted. 28. Collapse each raster in the Weighted overlay table. Youll now assign a percentage of influence to each raster, based on how much importance (or weight) each should have in the final suitability map. 29. In the % Influence column, type the following percentages for each of the input rasters: Reclassed distance to schools 25 Reclassed distance to recreation sites 50 Reclassed slope 13 landuse 12 30. Accept the default path for the Output raster parameter value, but type suit_areas for the name. 31. Click OK. G K L Z X C QUICK-START TUTORIAL 37 36. Right-click the Weighted Overlay tool element and click Run to run the process. 37. Examine the layer added to your ArcMap display. Locations with higher values indicate more suitable sitesareas that are on less steep slopes of suitable landuse types, closer to recreational facilities, and away from existing schools. Selecting optimal sites Youll use a conditional expression in the Con tool to extract only the optimal sites. It has been decided that those sites that are considered optimal must have a suitability value of 9 (the highest value in the suit_areas output). In the conditional expression, all areas with a value of 9 will retain their original value (9). Areas with a value of less than 9 will be changed to NoData. 32. Click the Auto Layout button, then click the Full Extent button to apply the current diagram properties to the elements and place them within the display window. 33. Right-click the derived data element for the Weighted Overlay tool and click Rename. 34. Type Suitable Areas and click OK. 35. Right-click the Suitable Areas derived data element and click Add To Display. B N M < 38 USING ARCGIS SPATIAL ANALYST 1. In the SpatialAnalyst Tools toolbox, expand the Conditional toolset. 2. Click the Con tool and drag it into the ModelBuilder window. An element that references the Con tool is created in the display window. 3. Right-click the Con tool element and click Open. 4. Click the Input conditional raster dropdown arrow and click the Suitable Areas variable. 5. Click the Input true raster or constant value dropdown arrow and, again, click the Suitable Areas variable. If the condition youll enter is true of the cells in the Input conditional raster, the value of the cells of the Input true raster or constant value will be applied to the cells of the output raster. 6. Leave the value for the Input false raster or constant value parameter blank. The default will be appliedany value in the Input conditional raster that doesnt meet the condition youll enter will be given NoData in the output raster. 7. Accept the default path for the Output raster parameter value, but change the default name to opt_areas. 8. Type Value = 9 for the value of the Expression parameter. If a cell value in the conditional raster (Suitable Areas) is 9, it will retain its original value (of 9) in the result. If a cell value is not 9, it will be given NoData. This way, you will exclude all areas but those most suitable for locating the school. 9. Click OK. u 2 3 45 6 7 8 9 QUICK-START TUTORIAL 39 10. Click the Auto Layout button, then click the Full Extent button to apply the current diagram properties to the elements and place them within the display window. 11. Right-click the derived data element for the Con tool and click Rename. 12. Type Output optimal areas raster in the Enter new element name text box and click OK on the Rename dialog box. 13. Right-click the Output optimal areas raster derived data element and click Add To Display. 14. Right-click the Con tool element and click Run to run the process. 15. Examine the layer added to your ArcMap display. These are the optimal locations for siting the new school. There are many single cells representing optimal locations. These 30 meter cells are too small for the school site. Youll clean up the result, removing these small areas, using the Majority Filter tool. 16. In the Spatial Analyst Tools toolbox, expand the Generalize toolset. 17. Click the Majority Filter tool and drag it into the ModelBuilder window. An element that references the Majority Filter tool is created in the display window. 18. Right-click the Majority Filter tool element and click Open. W R T O u I 40 USING ARCGIS SPATIAL ANALYST 19. Click the Input raster dropdown arrow and click the Output optimal areas raster variable. 20. Accept the default path for the value of the Output raster parameter, but change the name for the output raster to opt_areasM. 21. Click the Number of neighbors to use dropdown arrow and click EIGHT. This option specifies the number of neighboring cells to use in the kernel of the filter. The kernel of the filter will be the eight nearest neighbors (a 3-by-3 cell window) to the present cell. 22. Accept the default to use the MAJORITY as the replacement threshold. Five out of eight connected cells must have the same value for the present cell to retain its value. 23. Click OK. 24. Click the Auto Layout button, then click the Full Extent button to apply the current diagram properties to the elements and place them within the display window. 25. Right-click the derived data element for the Majority Filter tool and click Rename. 26. Type Output filtered optimal areas raster and click OK. 27. Right-click the Output filtered optimal areas raster derived data element and click Add To Display. 28. Right-click the Majority Filter tool element and click Run to run the process. 29. Examine the layer added to your ArcMap display. Compare it to the layer opt_areas. Many optimal areas that were considered too small in area have been removed. Note: If you want to remove areas of multiple cells, you would use the Nibble tool. P A S D F K J QUICK-START TUTORIAL 41 Setting model parameters After completing your model, you can set variables as model parameters so they will display on the dialog box of your model. If you plan to distribute your model, you should set model parameters so the users of your model can specify the input parameters. In the case of this suitability model, it could be applied to a different area, using different input data, for instance. First, youll rename the input data variables and the final output variable, for these names will become the parameter labels in the models dialog box. 1. Right-click the landuse project data element and click Rename. 2. Type Input landuse raster and click OK. 3. Right-click the elevation project data element and click Rename. 4. Type Input elevation raster and click OK. 5. Right-click the rec_sites project data element and click Rename. 6. Type Input recreation sites feature class and click OK. 7. Right-click the schools project data element and click Rename. 8. Type Input schools feature class and click OK. 9. Right-click Input landuse raster, Input elevation raster, Input schools feature class, and Input recreation sites feature class and click Model Parameter. 10. Right-click the Output filtered optimal areas raster derived data element and click Model Parameter. 11. Click the Model menu and click Save, then click the Model menu again and click Close. Viewing the modeľs dialog box 1. Right-click the Find location for school model in the ArcToolbox window and click Open. 9 1 42 USING ARCGIS SPATIAL ANALYST The variables you made into model parameters are displayed as the parameters on the models dialog box. Users of your model can simply enter their own parameter values to find suitable locations for a school in their area without having to know much information about the underlying workings of the model. They would, of course, have to have the same fields present in the landuse data, understand the methodology of the model, and agree with the assumptions applied. This information can be documented with the tool. Note: a dataset called opt_areasM already exists as you have previously created it. This output cannot be overwritten by default. To change the default behavior so results can be overwritten, click Tools on the Main menu and click Options. Click the Geoprocessing tab and check Overwrite the outputs of geoprocessing operations. 2. Click Cancel on the models dialog box. The Documentation Editor can be used to add documentation to your tools. 3. Right-click the model and click Edit Documentation. For more information on documenting your tools, see Chapter 5 of Geoprocessing in ArcGIS. 4. Click Cancel on the Documentation Editor. Selecting the best site Youve discovered where the optimal sites are for building the new school. All the locations in the opt_areasM layer are suitable. The last step in this exercise is to locate the best site out of the alternatives. The roads layer displays the roads within the town of Stowe. By examining the opt_areasM layer with the roads layer, youll see that there are some suitable areas for the school site that are not close to roads within the town. Youll first exclude these areas by locating suitable sites that are intersected by roads. Then youll locate the best site based on area. An optimal school site is greater than 10 acres, or 40,469 square meters. Youll first convert the opt_areasM raster to a feature class inside a geodatabase so you can use the area field that is generated. Youll then use the selection functionality within ArcMap to select features that are intersected by roads. Then youll identify the optimal site from the alternatives, 2 3 QUICK-START TUTORIAL 43 based on area, and youll create a new feature class from the selection that youll use in the next exercise. 1. In the Conversion Tools toolbox, expand the From Raster toolset. 2. Right-click the Raster to Polygon tool and click Open. 3. Click the Input raster dropdown arrow and click the opt_areasM raster layer. 4. Leave the default for the Field parameter as Value. 5. Click the Browse button, navigate to your C:\Spatial\Results folder, and double-click site.mdb (the personal geodatabase you created in the previous exercise). 6. Type opt_areasM for the name of the feature class to create inside the geodatabase, then click Save. 7. Leave the default checked to Simplify polygons. The polygons will be simplified to reduce the stair-step effect when a raster is converted to a polygon. 8. Click OK. 9. Leave the landuse, elevation, hillshade, destination, rec_sites, schools, and opt_areasM (feature class) layers in the table of contents. Click the rest of the generated layers in the table of contents, right-click, and click Remove. Press and hold the Shift key to select multiple layers. Your ArcMap table of contents and display should resemble the graphic below. 2 3 4 5 7 8 44 USING ARCGIS SPATIAL ANALYST 10. Click Selection on the Main Menu and click Select By Location. 11. Set up the dialog box as shown below. You want to select features from opt_areasM that intersect roads. 12. ClickApply, then click Close. All features that intersect roads are selected in the display. 13. Click Selection on the Main Menu again and click Select By Attributes. 14. Click the Layer dropdown arrow and click the layer opt_areasM. 15. Click the Method dropdown arrow and click Select from current selection. 16. Double-click [Shape_Area] from the Fields list to enter the field in the expression text box. 17. Click the >= button. 18. Type a space, then type 40469. 19. Click Apply, then click Close. R E Y U I O P T Q QUICK-START TUTORIAL 45 ` There is one feature that fits the criteria of being equal to or greater than 10 acres (40469 square meters). 20. Right-click opt_areasM, point to Selection, and click Create Layer From Selected Features. The added layer opt_areasM selection is an in-memory layer that references the opt_areasM feature class. Youll save it as a feature class on disk. 21. In the Data Management Tools toolbox, expand the Features toolset. 22. Right-click the Copy Features tool and click Open. A 23. Click the Input Features dropdown arrow and click the opt_areasM selection layer. 24. Click the Browse button next to the Output Feature Class parameter and navigate to C:\Spatial\Results\Site.mdb. 25. Type final_site for the name of the output feature class and click Save. 26. Click OK to run the tool. A feature class is created and added to the table of con- tents. D F G J 46 USING ARCGIS SPATIAL ANALYST L 27. Click opt_areasM in the table of contents, press the Shift key and click opt_areasM selection. 28. Right-click and click Remove. The final_site layer displays the location of the optimal site for the new school. 29. Click File on the Main menu and click Save to save the map document. You have now completed Exercise 2. You can continue on to Exercise 3, or you can stop and continue later. Optimal site for the new school QUICK-START TUTORIAL 47 Exercise 3: Finding an alternate access route to the new school site In this exercise, you will find the best route for a new access road. The steps you might follow to produce such a path are outlined below. Create the source dataset if necessary. The source is the school site (the final_site feature class) you created in Exercise 2. Create the cost dataset by deciding which datasets are required, reclassifying them to a common measurement scale, weighting them, then combining them. Perform cost distance analysis using the source and cost datasets as inputs. The distance dataset created from this tool is a raster in which the value of each cell is the accumulated cost of traveling from each cell back to the source. To find the least costly path, you need a direction dataset, which can be created as an additional dataset from the Cost Distance tool. This gives you a raster of the direction of the least costly path from each cell back to the source (in this exercise, the school site). Create the destination dataset if necessary. In this exercise, the destination dataset is a point at a road junction. Perform cost path analysis using the distance and direction datasets created from the Cost Distance tool. This exercise will take approximately 15 minutes to com- plete. Setting up If you are continuing on from the previous exercise and have the Site Analysis map document open, skip the next few steps and go to the next section, Creating a new model. 1. Start ArcMap by either double-clicking a shortcut installed on your desktop or using the Programs list in the Start menu. 2. Click C:\Spatial\Site Analysis.mxd in the Browse for maps list to open the map document created in the previous exercise. Creating a new model Youll create a new model inside your Site Analysis Tools toolbox called Find Best Route. This model will calculate the best path through the landscape from the source (the school site) to the destination point, taking into consideration the slope of the land and the type of landuse the path will cross. 1. Right-click the Site Analysis Tools toolbox, point to New, and click Model. 1 48 USING ARCGIS SPATIAL ANALYST An empty ModelBuilder window will open. 2. Click the Model menu and click Model Properties. 3. Type find_route in the Name text box. 4. Type Find Best Route in the Label text box. The name is used in scripting and at the command line. The label is the display name for the model. 5. Check Store relative path names so that all paths for sources of information referenced by the tool are saved relative to the location of the toolbox. If the toolbox and its data are moved, paths to data sources will be altered accordingly. 6. Click the Environments tab and check the same environment settings for this model as you did for the model created in Exercise 2. General Settings section: Check Current Workspace, Scratch Workspace, and Output Extent. Raster Analysis Settings section: Check Cell Size. 7. Click Values. 8. Expand General Settings and set: Current Workspace = C:\Spatial Scratch Workspace = C:\Spatial\Results Output Extent = Same as Layer elevation 9. Expand Raster Analysis Settings and set Cell Size = Same as Layer elevation. 10. Click OK on the Environment Settings dialog box. 11. Click OK on the Model Properties dialog box. 12. Click the Model menu and click Save. 2 3 4 5 W 6 QUICK-START TUTORIAL 49 Creating the cost dataset You created the source dataset in the previous exercise. This is the location of the school site (your final_site layer). Youll create the cost dataset that will identify the cost of traveling over the landscape from any location back to the school, based on the fact that it is more costly to traverse steep slopes and construct a road on certain landuse types. Deriving slope It is difficult to build a road on steep slopes, so youll calculate slope to take into consideration the slope of the land. 1. In the Spatial Analyst Tools toolbox, expand the Surface toolset. 2. Click and drag the Slope tool into the ModelBuilder window. An element that references the Slope tool is created in the display window. 3. Right-click the Slope tool element and click Open. 4. Click the Input raster dropdown arrow and click the elevation layer. 5. Accept the default path for the Output raster parameter value and type slope_ex3 for the name. The default path is set to the scratch workspace (for example, C:\Spatial\Results) you set up earlier in the Environment Settings dialog box. 6. As you did when calculating hillshade in Exercise 1, type 0.3048 for the value of the Z factor parameter to convert the z values to the same unit of measure as the x,y units (from feet to meters). 7. Click OK. 2 u 3 4 5 6 7 50 USING ARCGIS SPATIAL ANALYST 8. Click the Auto Layout button, then click the Full Extent button to apply the current diagram properties to the elements and place them within the display window. The process is now colored in, meaning it is ready to run. 9. Right-click the derived data element for the Slope tool and click Rename. 10. Type Slope output and click OK. 11. Right-click the Slope output derived data element and click Add To Display. 12. Right-click the Slope tool element and click Run to run the process. 13. Examine the layer added to your ArcMap display. Steep slopes are displayed in red, less steep slopes in green in the output layer. Reclassifying slope It is preferable that the new road traverses less steep slopes. You will reclassify the slope layer, slicing the values into equal intervals. Youll give a value of 10 to the most costly slopesthose with the steepest angle of slopeand 1 to the least costly slopesthose with the least angle of slope, and rank the values in between linearly. Q W E Auto Layout Full Extent QUICK-START TUTORIAL 51 1. In the Spatial Analyst Tools toolbox, expand the Reclass toolset. 2. Click and drag the Reclassify tool into the ModelBuilder window. An element that references the Reclassify tool is created in the display window. 3. Right-click the Reclassify tool element and click Open. 4. Click the Input raster dropdown arrow and click the Slope output variable. 5. Accept the default for the Reclass field parameter so the Value field will be used. 6. Click Classify. 7. Click the Method dropdown arrow and click Equal Interval. 8. Click the Classes dropdown arrow and click 10. Note: If you know specific break points between classes, such as 5 percent, 10 percent, 15 percent, and so on, you would enter them in the Break Values text box. 9. Click OK. You want to avoid steep slopes when constructing the road, so steep slopes should be given higher values in the cost dataset. Because the default gives high values to steeper slopes, you do not need to change the default New Values. 5 64 78 9 2 u 52 USING ARCGIS SPATIAL ANALYST 10. Accept the default location for the value of the Output raster parameter, but type Rslope_ex3 for the name. 11. Click OK. 12. Click the Auto Layout button, then click the Full Extent button to apply the current diagram properties to the elements and place them within the display window. 13. Right-click the derived data element for the Reclassify tool and click Rename. 14. Type Reclassed slope and click OK. 15. Right-click the Reclassed slope derived data element and click Add To Display. 16. Right-click the Reclassify tool element and click Run to run the process. 17. Examine the reclassed slope layer added to your ArcMap display. It shows locations that are more costly than others for constructing a roadhigher values indicate the more costly areas that should be avoided. Weighting and combining datasets You will now combine the reclassed slope and landuse datasets to produce a dataset of the cost of building a road from each location in the landscape, in terms of steepness of slope and landuse type. In this model, each dataset has equal weight. W Q Y U QUICK-START TUTORIAL 53 1. In the Spatial Analyst Tools toolbox, expand the Overlay toolset. 2. Click the Weighted Overlay tool and drag it into the ModelBuilder window. An element that references the Weighted Overlay tool is created in the display window. 3. Right-click the Weighted Overlay tool element and click Open. The default evaluation scale is from 1 to 9 by 1. As in Exercise 2, a scale of 110 was used when reclassifying the slope dataset, so before adding input rasters to the Weighted Overlay tool, youll set the evaluation scale from 1 to 10 by 1. This means you will avoid having to update the scale values after adding your input slope dataset. 4. Type 1, 10, and 1 in the From, To, and By text boxes. 5. Click the Add Raster Row button to add the input rasters. 6. Click the Input raster dropdown arrow and click the Reclassed slope variable. 7. Accept the default value for the Input field parameter and click OK. 2 u 5 4 6 7 3 54 USING ARCGIS SPATIAL ANALYST The raster is added to the Weighted Overlay dialog box. The Field column displays the values of the reclassified slope output. The Scale Value column mimics the Field column because the evaluation scale was set to encompass the range of values in each input raster. Youll keep the Scale Value values as they are, since they have already been altered according to suitability. 8. Click the Add Raster Row button again to add the landuse input raster. 9. Click the Input raster dropdown arrow and click the landuse layer. 10. Click the Input field dropdown arrow and click Landuse. 11. Click OK. Youll weight the scale values of the landuse layer so they are comparable with your Reclassed slope derived dataset. A higher value indicates that a particular landuse type is more costly, and therefore, a less suitable location through which to build a road. 12. Type the following scale values: Brush/transitional5 Barren land2 Built up9 Agriculture4 Forest8 Water10 Wetlands10 Higher values indicate higher road construction costs. Note: Take care using Restricted for the scale value when creating a cost surface. Because using Restricted gives a value to the cell that is the minimum value of the evaluation scale minus 1, your restricted areas will appear to be given the lowest cost when they are actually excluded from the analysis. You should instead assign a high cost or set the scale value to NoData for areas you want to exclude from the analysis. If NoData is used, check first that there are no areas of NoData in your input rasters. If there are, it will be difficult to tell whether an area of NoData is there because it was excluded or there was no original information at that location for one of your inputs. E QUICK-START TUTORIAL 55 Youll now assign an equal percentage of influence to each raster, as they are all equally important. 13. Click Set Equal Influence to assign an equal percentage of influence (50 percent each) for landuse and Reclassed slope. 14. Accept the default path for the value of the Output raster parameter, but type cost_surf for the name. 15. Click OK on the Weighted Overlay dialog box. 16. Click the Auto Layout button, then click the Full Extent button to apply the current diagram properties to the elements and place them within the display window. 17. Right-click the derived data element for the Weighted Overlay tool and click Rename. 18. Type Cost surface and click OK. 19. Right-click the Cost surface derived data element and click Add To Display. 20. Right-click the Weighted Overlay tool element and click Run to run the process. 21. Examine the layer added to your ArcMap display. Locations with low values indicate areas that will be the least costly to build a road through. T Y R O A 56 USING ARCGIS SPATIAL ANALYST Performing cost distance You will now run the Cost Distance tool using the cost dataset you just created (which identifies the cost of traveling through each cell) and the final_site layer (the source) you created in Exercise 2. The outputs from this tool are a distance dataset in which each cell contains a value representing the accumulated least cost of traveling from that cell to the source and a backlink dataset that gives the direction of the least costly path from each cell back to the source. This conceptual process is explained in more detail in Chapter 7 of Using ArcGIS Spatial Analyst. 1. In the Spatial Analyst Tools toolbox, expand the Distance toolset. 2. Click and drag the Cost Distance tool into the ModelBuilder window. An element that references the Cost Distance tool is created in the display window. 3. Right-click the Cost Distance tool element and click Open. 4. Click the Input raster or feature source data dropdown arrow and click the final_site layer. 5. Click the Input cost raster dropdown arrow and click the Cost surface variable (the output from the Weighted Overlay tool). 6. Accept the default path for the Output distance raster, but change the name to cost_dist. 7. Type C:\Spatial\Results (or an alternative drive) for the path of the Output backlink raster parameter, and type cost_bklink for the name of the output. 8. Click OK. 9. Click the Auto Layout button, then click the Full Extent button to apply the current diagram properties to the elements and place them within the display window. 2 u 4 5 6 7 8 QUICK-START TUTORIAL 57 10. Right-click the cost_dist derived data element and click Rename. 11. Type Output cost distance and click OK. 12. Right-click the Output cost distance derived data element and click Add To Display. 13. Right-click the cost_bklink derived data element and click Rename. 14. Type Output cost backlink and click OK. 15. Right-click the Output cost backlink derived data element and click Add To Display. With the Add To Display property checked, the derived data referenced by these elements will be added to the display each time the model is run. 16. Right-click the Cost Distance tool element and click Run to run the process. 17. Examine the layers added to your ArcMap display. The cost distance layer (cost_dist) displays the accumulated cost of traveling from any location (or cell) to the source (the school site), but it does not contain information on which way to travel from a particular cell to the source, just how much it will cost to get there, following the least costly path. The cost backlink layer (cost_bklink) shows which way to travel from any cell, following the least costly path back to the source. Finding the least costly path The new road will redirect much of the traffic away from the existing road to the school and provide a back route for school buses and other vehicles. 1. Examine the destination point for the new road (Destination.shp in the table of contents of your ArcMap session). This is the starting point for the new road to the school site. Q U 58 USING ARCGIS SPATIAL ANALYST 2. In the Spatial Analyst Tools toolbox, expand the Distance toolset. 3. Click and drag the Cost Path tool into the ModelBuilder window. An element that references the Cost Path tool is created in the display window. 4. Right-click the Cost Path tool element and click Open. 5. Click the Input raster or feature destination data dropdown arrow and click the layer destination. 6. Click the Input cost distance raster dropdown arrow and click the Output cost distance variable (one of the outputs from the Cost Distance tool). 7. Click the Input cost backlink raster dropdown arrow and click the Output cost backlink variable (one of the outputs from the Cost Distance tool). 8. Accept the default path for the Output raster parameter, but change the name to cost_path. When the input feature destination data is processed, it will be converted temporarily to a grid as part of the processing. There will only be one cell in this grid, because there is only one destination point. So the value for the Path type parameter can be left as EACH_CELL. Only one path will be created, since there is only one cell. 9. Click OK. 10. Click the Auto Layout button, then click the Full Extent button to apply the current diagram properties to the elements and place them within the display window. u3 5 6 7 8 9 QUICK-START TUTORIAL 59 11. Right-click the cost_path derived data element and click Rename. 12. Type Output cost path and click OK. 13. Right-click the Output cost path derived data element and click Add To Display. 14. Right-click the Cost Path tool element and click Run to run the process. 15. Remove the created layers slope_ex3, rslope_ex3, cost_surf, cost_dist, and cost_bklink so you can see the path displayed over the landuse and hillshade layers. 16. Examine the layer added to your ArcMap display. The cost_path layer represents the least costly path from the school site to the destination point. It avoids steep slopes and certain landuse types considered to be more costly for constructing the road. As a last step in your model, youll convert the raster path to a polyline for display purposes. 17. In the Conversion Tools toolbox, expand the From Raster toolset. 18. Click and drag the Raster to Polyline tool into the ModelBuilder window. An element that references the Raster to Polyline tool is created in the display window. 19. Right-click the Raster to Polyline tool element and click Open. W T u O 60 USING ARCGIS SPATIAL ANALYST 20. Click the Input raster dropdown arrow and click the Output cost path variable. 21. Leave the default field as VALUE. 22. Click the Browse button next to the Output polyline features parameter and navigate to your personal geodatabase C:\Spatial\Results\Site.mdb. 23. Type new_route for the name of the feature class and click Save. 24. Accept the defaults for all other parameters and click OK. 25. Click the Auto Layout button, then click the Full Extent button to apply the current diagram properties to the elements and place them within the display window. 26. Right-click the new_route derived data element and click Rename. 27. Type Output route and click OK. 28. Right-click the Output route derived data element and click Add To Display. 29. Right-click the Raster to Polyline tool element and click Run to run the process. 30. Examine the layer new_route that is added to your ArcMap display. The raster path has been converted to a polyline. Z A S F G QUICK-START TUTORIAL 61 Note: You can easily change parameter values to experiment with different outcomes and rerun the model. Only the processes in the model that are dependent on the output of the process altered will need to be rerun. For example, lowering the weight applied to cell values where the landuse is built up from 9 to 1 will alter the potential path for the new road considerablyit will tend to follow existing roads where it can, which may be a cheaper option to consider. Setting model parameters As you did with the Find location for school model, youll rename some of the variables and set them as model parameters so they will display on the models dialog box. 1. Right-click the landuse project data element and click Rename. 2. Type Input landuse raster and click OK. 3. Right-click the elevation project data element and click Rename. 4. Type Input elevation raster and click OK. 5. Right-click the final_site project data element and click Rename. 6. Type Input source and click OK. 7. Right-click the destination project data element and click Rename. 8. Type Input destination and click OK. 9. Right-click Input landuse raster, Input elevation raster, Input source, Input destination, and Output route and click Model Parameter. 10. Click the Model menu and click Save. 11. Click the Model menu again, and click Close. 1 9 Q 62 USING ARCGIS SPATIAL ANALYST Viewing the modeľs dialog box 1. Right-click the Find Best Route model in the ArcToolbox window and click Open, or double-click the tool. The variables you made into model parameters are displayed as the parameters on the models dialog box. Users of your model can simply enter their own parameter values to find suitable routes from point A to point B in their area without having to know much information about the underlying workings of the model. As with the Find location for school model, they would, of course, have to have the same fields present in the landuse data, understand the methodology of the model, and agree with the assumptions applied. 2. Click Cancel on the models dialog box. 1 Saving the map document You have set relative paths for both models created in this tutorial, so if the toolbox containing the models and the data are moved (keeping the same structure between them) to a new location on disk, the paths to the data sources will be set relative to the position of the toolbox. You should also set relative paths for your map document so layers in the table of contents will find their data sources by traversing the relative paths. 2 QUICK-START TUTORIAL 63 1. Click File on the Main menu and click Map Properties. 2. Click Data Source Options. 3. Check Store relative path names and click OK. 4. Click OK on the Site_Analysis.mxd Properties dialog box. 1 5. Click File on the Main menu and click Save. 6. Click File on the Main menu and click Exit. This brings you to the end of this tutorial. You have been introduced to some of the tools available with Spatial Analyst, both through the Spatial Analyst toolbar and the SpatialAnalyst Tools toolbox. Youve learned how to build models that are reusable and can be shared with others. In particular, youve learned how to create a suitability map, and youve learned how to calculate the least costly path across a landscape. The sequences of steps involved can be applied to many different applications. There are many more tools that you can use to help you perform your spatial analysis tasks. Using ArcGIS Spatial Analyst will guide you as you learn how to solve your own specific spatial problems. Explore the online Help system for conceptual help for each toolset and help for each tool in the SpatialAnalyst Tools toolbox, and consult Geoprocessing in ArcGIS for more information on the geoprocessing functionality withinArcGIS. 2 3 4