Tuesday, June 16, 2015

GIS Programming: A Look Into Geoprocessing

Hello GIS enthusiasts,
     This week in programming we are finally getting into more of the meat of Python integration with GIS. Geoprocessing is a huge portion of ArcGIS as it is what allows you to perform spatial analysis and modeling, along with automation of certain tasks.This week I looked at a number of different ways to facilitate some common geoprocessing tasks. The main objectives being explored throughout this weeks lab are below:

  • Locate Tools and Toolsets
  • Use batch processing to run a single tool multiple times
  • Create a new toolbox and model
  • Use the ArcMap Python Window to run a geoprocessing script
  • Create a geoprocessing script and script tool
  • Export a model as a script

The objectives above may not make much sense, but in the end they boil down to three main outputs. The creation of a new arctoolbox, which holds a newly created model, and newly created script based off the model. The toolbox housed the model which was exported as a python script, this script was adjusted and imported as a tool back to the toolbox.  So what do the model, script, and script tool do?
All of these were a variation on the same theme, they take a Soils feature class, and clip it to the extent of a basin feature. This new clipped soils feature is then examined for areas of non-suitable farmland. Once the bad farmland is identified, then these selected areas are removed from the clipped soils feature for an all new feature class which only shows prime farmland. The visual result of this geoprocessing is below.


Its not an island chain, its merely as stated above. It is a soils feature with identified areas removed in an incredibly simplistic map. The finalized toolbox which contains the script that generated this feature class along with the model and the host script used to create the script tool were all packaged together in a .zip file. This allows me to be able to share the whole package with whomever might need access. You can take this package and adjust the individual items to suit your purposes, which is one of the amazing things about Geoprocessing as it relates to Python and ArcMAP. Thank you for stopping by this week.

No comments:

Post a Comment