Analytic Techniques

Setting Up YOur Geoprocessnig Environment

It can be fun to fool around with GIS -- you can use tools to transform data and examine the results, we can learn a lot this way. But when setting up the parameters of processing tools and developing loads and loads of derived data becomes a bore, we will be happy to know that there are ways to automate chains tasks so that they can be adjusted and repeated without having to repeat each step. We can use these prescribed workflows (known in ArcGIS as Geoprocessing Models) to document our work. This is a wonderful way to share your work and your data with other people so that they can better understand what you did, and even to extend your work. This way of sharing work and advancing knowledge can be very rewarding for individuals, and is especialy important for organizations that can't afford to start from scratch on work that has already been done!

Background and Deeper Reading

Setting Up your Modeling Laboratory

The tutorial Beginning a GIS Database explains a framework for organizing data for a team of collaborators working on a project. The principles described there provide a framework for organizing project data so that many people can share and contribute to a common base of GIS data, each user having their own workspace in the GIS folder. By careful attention to the use of relative pathnames, this entire project directory tree can be worked on by many different collaborators without conflicts developing between different users trying to develop data in the same location. This tutorial explains how to arrange a working directory so that users can develop and share tools that operate on project data, creating result datasets in that user's scratch and data folders.

Set Up your Working Directory

  • Create your working directory in the GIS folder of the project dataset.
  • Create sub folders for tools, a docs, a scratch folder and a data folder.

Set your Groprocessing Options and Environment

We will make a toolbox that will hold the geoprocessing models that we make. These models will create new data. SOme of the data we create will be intermediate (scratch) layers that may be deleted when the model is through. Other datasets we may want to save when the model is through. The following steps will let us inform ArcMap where we want tour toolboxes to be created and where your scratch and persistent output data will go.

Set your Geoprocessing Options

  • Go to Geoprocessing>Options
  • Check the box next to Overwrite results of geoprocessing options.
  • Check the box next to" When connecting elements, display valid parameters when more than one is available.
  • After clicking Geoprocessing->Environments->Workspace, set:
    1. Workspace = your data folder
    2. Scratch workspace = your scratch folder
  • There are many other geoprocessing environment settings that you may also want to set, you can read about these in the on-line documentation.

Practicing with Geoprocessing Models

The following exercise will introduce the basics of model builder.

  1. Use ArcCatalog to create a new toolbox in your Tools Folder
  2. Open the tools window, right-click and add your new toolbox.
  3. Create a new model in your toolbox
  4. Open the model for editing
  5. Drag in a dataset from your map's table of contents
  6. Locate an interesting tool-wizard by using the Geoprocessing > Search For Tools
  7. Drag the wizard into your model For example, try the Buffer wizard.
  8. Note that you can set environments for individual tools by right-clicking on the tool and setting variables.
  9. Open the wizard and Set the required parameters.
  10. Note that if you just enter a file name for the output shapefile, the wizard automatically puts the data into your scratch directory.
  11. Make some of the parameters and environment variables model parameters.
  12. Run the tool from the model
  13. Right-click the blue oval for your output dataset and note that the default setting for this dataset is Intermediate
  14. If you don;t want your data sets to be deleted when you quit ArcMap, you need to uncheck Intermediate, and also check Make Model Parameter.
  15. While in the right-click menu, check Add to Display to add the resulting dataset to the map.
  16. Under Model->Properties set your model so that it references relative path names
  17. Save the model.
  18. Give the model a memorable name.