GIS Logo GSP 118 (318): GIS Programming

Assignment: Creating Tools and Accessing Attributes

1. An Attribute Analysis Tool

We use attributes for a wide variety of analysis tasks. Using Python, you can access attributes, compute statistics from them, and combine them with other information in new an exciting ways.

Data needed:

Create a tool for ArcGIS that allows the user to select a Shapefile, a field (attribute) within the shapefile, and computes the: number of values, total of all values, and the mean value. The tool should then display a dialog box with the result.

It's up to you how you structure the script with functions and modules. I highly recommend you try the script with a few shapefiles to make sure it works. Think about potential problems that you may want to provide error checking for.

Your tool will need to:

Note: Remember to place the overall script in a "try/except" block and fully document all files.

 

Turn-in:

  1. Finished Python script with any associated modules I'd need to run it as if I was a user you were giving the script to.
  2. Extra credit: create a histogram and display it in a window.