Friday, May 30, 2014

Geoprocessing In ArcGIS

For this weeks lab we created a geoprocessing model that was used to create a script that was used to create a tool.  The results of the model can be seen below.  Creating the model was a first a bit confusing. The instructions were very basic, however, it made me think a bit more about what I was doing to get to the desired results. Once I got in the right frame of mind, setting up the model was rather simple.  When written out it seems rather long and complicated, but it is mostly repetitive. 

The model I created was used to: 
1. Clip the Soils layer to the Basin layer
2. Select the Soils that were classified as "Not Prime Farmland"
3. Erase the previously selected soils from the basin layer


Basin soil with non prime farmland removed


The steps I tool to create the model included:
1.       Open ArcMAP
2.       Add basin.shp and soils.shp to the map via the Add Data tool or ArcCatalog
3.       Right click Mod2_jwilliams.tbx (previously created)
4.       Click on Model
5.       Drag the Basin and Soil layers into the Model window
6.       Open ArcToolbox
7.       Expand the Analysis Toolbox and the Extract tool set
8.       Click and drag the Clip tool to the Model window
9.       Click the Connect tool in the Model window
10.   Click on the soils layer and then click the clip tool
11.   Choose Input Feature
12.   Click on the basin layer and then click the clip tool again
13.   Choose Clip Feature
14.   The Clip tool and output feature class shapes will change to solid colors and the output feature class will be renamed to soils_clip.shp
15.   Right click the clip tool and run it – this will populate the output which is necessary for the next step
16.    Go back to the ArcToolbox
17.   Clip and drag the Select to the Model window
18.   Click the Connect tool
19.   Click on the soils_clip.shp  and then click the Select tool
20.   Double click the Select tool and configure the expression as "FARMLNDCL" = 'Not prime farmland'
21.   The Select  tool and output feature class shapes will change to solid colors and the output feature class will be renamed to soils_clip_select.shp
22.   Right click the select tool and run it – this will populate the output which is necessary for the next step
23.   Go back to the ArcToolbox
24.   Expand the Overlay toolset
25.   Click and drag the Erase tool to the Model window
26.   Click the Connect tool
27.   Click the Basin layer and then click the Erase tool
28.   Select Input Feature
29.   Click the  soils_clip_select.shp output and then click the Erase tool
30.   Select Erase Feature
31.   The Select  tool and output feature class shapes will change to solid colors and the output feature class will be renamed to soils_clip_select_erase.shp
32.  Right click the select tool and run it
33.  You can add the layers to the map from the Add Data tool or the ArcCatalog


Friday, May 23, 2014

Intro to Python

Welcome back!  For me, this is the final leg of my GIS Certification journey.  Programming is not something I have ever wanted to do, but over the years I have seen where knowing programming can be beneficial.  I know a little bit of HTML and some SQL and Access proramming, but at this point, that is the extent of my programming knowledge.  Python is an open source programming language that is supplied with ArcGIS.  The current version available with ArcGIS 10/10.1 is Python 2.7.  The textbook is telling me that it is easy to learn, we shall see.  Already I can see that Python is a very helpful language.  Say for example you begin to type a command that begins with the letter P.  Python will prompt you with a list of commands that begin with the P.

One thing I have learned in my brief programming experience has been the importance of syntax.  One missing or misplaced double quote can ruin your whole day.  Something I hope to gain from this course is a greater understanding of the roll scripting can play in GIS and how it can help me in my day to day use of ArcGIS.

Our first assignment was to open, examine and run a script that creates a module folder for each week of our GIS Programming course.  The results of the script can be seen in the image below.