Showing posts with label GIS 4102 - GIS Programming. Show all posts
Showing posts with label GIS 4102 - GIS Programming. Show all posts

Monday, August 5, 2013

Module 11: Sharing Tools
GIS 4102
 
 
This weeks lab assignment worked with sharing custom tools to others.  The above screenshot is an example of a custom tool that was created to generate random points within a feature class no closer than a specified distance.  The points that were generated were then given buffers as defined by the tool.  All the results were then exported out to a specified destination folder. 
 
Overall, the custom tools section of this class has just been very rewarding to me.  I find that the ability to create custom tools and then share them to others is a huge benefit to me in my line of work.  I also like that passwords can be assigned to these tools that they can only be edited and exported by those that know the passkey.  

Friday, July 26, 2013

Module 10 - Creating Custom Tools
GIS 4102
 
 
This week I learned about creating custom tools from python scripts.  This by far was the most interesting module that I have done.  This module seemed to tie everything together for me and allowed me to understand how I can use these scripts in my workplace.  The above screenshot is of the tool dialog box that I created by defining parameters.  This will allow the user of my tool to type in the data they wish to manipulate, as well as define where that information is stored.  This MultiClip script will allow the user to specify a single feature as the clip boundary, and then select multiple features to clip from.  All of the results are then saved to the Results folder with a unique name that is generated by the tool based off of the clip feature and the feature being clipped.
 

 
 
The above screen shot is the results of a successful run of the tool once the script was modified from its original format.  Here we can see in the Process Summary box messages that the scripts author wanted the user to see.
 
Overall, I enjoyed this module and can't wait to use it in my place of employment.


Thursday, July 25, 2013

Participation #2
 GIS 4102

NFL KICKOFF TO YOUTH FOOTBALL ANALYSIS
 
From 2001 to 2006 youth football in the US increased significantly in regards to participation.  This drew the attention of the National Football League (NFL).  The NFL teamed up with USA Football and the National Recreation and Parks Association (NRPA) to conduct a study identifying the reasons for the increased participation as well as where the NFL could focus funds for improvement.

A technical team was formed to conduct the study utilizing ArcGIS.  Several software tools and programs were used following the Geo-Referenced Amenities Standards Process (GRASP).  The parks and recreation industry has utilized this methodology for many years to gather, manage, analyze, and present information.

Nationwide surveys were conducted and the data was compiled.  A primary database was created from these surveys to be analyzed utilizing GIS.  Due to the large study area, the technical team decided to utilize ESRI’s “StreetMap USA” as a basemap.  To generate reports, tables, and analytic results, the team utilized Python.  Python allowed the team to automate the data processing for this large-scale project with ease.

With the matrix of data that was created, collected, and analyzed through GIS, the NFL will be able to better assess where monies and materials will be best utilized.

Source:  http://www.esri.com/news/arcnews/summer08articles/nfl-puts-gis.html

Wednesday, July 24, 2013

Module 9 - Debugging and Error Handling
GIS 4102
 
This weeks assignment we worked on debugging existing scripts and error handling.  In the above screenshot you will see the results of a script that was originally given to me in with multiple errors.  I was tasked to correct the script and the errors that I found to produce the results you see.  This lab was a bit more challenging for me.  the status bar and error reporting in the interactive window was a huge help in isolating and fixing the errors.

 
In the above screenshot I was again asked to troubleshoot a script that was given to me.  Here I found that several of the errors were found simply by reading through the script and finding misspelled words as well as simple code errors.  I did utilize the debugger tool, but found most of my errors when I ran the program and read the error report in the interactive window.
 
It took a while for me to read through the script and understand exactly what it was trying to do.  I still feel I need to get a better understanding of for loops as well as if then statements. Perhaps a bit more reading and continual use will help me in the process. 


Monday, July 15, 2013

Module 7 - Geometries and Rasters
GIS 4102
 
 
 
PART 1.
 
The above screenshot contains a notepad text file.  It was created using Python and the use of a nested "for" loop.  Using a SearchCursor I was able to identify a polyline object and then using the nested "for" loop extract the information I needed from the feature object.  The arrays within the feature contained multiple points or vertices that are identified above.  Each point has it's coordinates (X, Y) values shown as well as the NAME field from the rivers shapefile that was used.

 
 
PART 2.
 
The above screenshot shows the final result of a raster tiff file that was created working with the elevation and landcover raster files.  Utilizing Spatial Analysis I was able to modify the Forest landcover raster and identify Slopes between 5 and 20 degrees, as well as Aspects between 150 and 270 degrees.  Once all these variables were isolated and identified I utilized a map algebra operator (Boolean "And" function) to classify the combined rasters.  The final raster image is shown above.
 
This module was very robust and covered a lot of data that dealt with nested loops as well as spatial analysis of raster files.  I enjoyed the challenge of this assignment.
 



Tuesday, July 2, 2013

Module 6: Working Spatial Data

Week 7 - Module 6 - Working Spatial Data
GIS 4102
 

 
 
In this weeks module, we were focusing on working with spatial data.  There was a lot to cover, and it was enjoyable learning about functionality available in Python to accomplish different tasks. I discovered how to utilize lists, tuples, directories, as well as different cursors to manipulate and show data to the end user. 
 
The above screenshot was the results of the script I have written.  This script creates a Geodatabase named JBG16.  It then copies all the shapefiles from the Data directory into the newly created GeoDatabase.  Once copied the cities feature class is searched using a search cursor that gathers and populates a directory named countySeats with the NAME and POP_2000 values. Finally, those results are then printed for the user.
 
Overall, this was the most challenging of all the projects I have done.  I ran into a syntax error that kept me busy for a while, but ultimately was able to discover the problem through script troubleshooting.  Who knew the addition of the letter s at the end of a value could keep me busy for over an hour...



Monday, June 24, 2013

Week 5/6 - Python GeoProcessing
GIS 4102
 
Week 5 - Review
 
Week 6 - Module 5 - Python GeoProcessing
 
This week we worked with Python Script and Geoprocessing.  The screenshot above was taken after a series of code was run to Add XY Coordinates to the hospitals shapefile, then create a 1000 meter buffer around the hospital locations, and finally Dissolve the buffers created into a single feature.  All three of these tasks were completed using python script.  The results were then printed in the interactive window to show that the tools completed their parameters successfully.
 
I can see how a python code can be written to complete routine series of tasks and all that would need to be modified is a few parameters.  I also discovered that using code that was previously written saves both time and cuts down on syntax errors.
 
Overall I definitely am coming away with something that I can use in my current position, and look forward to further growth in Python Script.


Monday, June 10, 2013

Week 4 - Participation 1
GIS 4102
 
GIS can be used in a number of different ways.  The Town of Mooresville, North Carolina utilized GIS to assist them with a stinky situation.  In 2010 the town discovered they were having a problem with an increasing number of overflows and stoppages in their Sanitary Sewer System.

The Mooresville Water/Sewer Maintenance Department (WSMD) reached out to their Engineering Department for a solution to meet the requirement set by the North Carolina Department of Environment and Natural Resources.  This requirement involved the cataloging of the cleaning and maintenance of all sewer lines on a regular basis to identify troubled areas.  Cataloging their findings in Excel spreadsheets, the WSMD logged the cleaning data for the entire month and dates for when the sewer features were cleaned.  They gave each manhole a unique identifier to associate it with a matching manhole on the GIS map.

Then utilizing Python scripting, they were able to simplify the repetition of the steps required to create the cleaning data.  Python script was made available to all ArcGIS users to do analysis on the data which allowed them to determine the number of sewer mains cleaned as well as the total lengths.

The analytical data that was collected was then used to determine “hot spots” that were cleaned seven or more times in the previous year.  This allowed the WSMD staff to work with other departments to isolate and monitor locations that were repeatedly cleaned.  Overall the WSMD saw an increase in productivity by 26% and a decrease of stoppages in gravity main lines throughout town.  This in turn, through the use of technology and teamwork, has saved the WSMD money as well as cut down on overtime.

Town Shapens Proactive Sewer System Management
By Alan Saine, Civil Engineer, Town of Mooresville, North Carolina
ArcNews Fall 2012


Saturday, June 8, 2013

Week 4 - Python Fundamentals II
GIS 4102
 
 
 
This weeks exercises and lab assignments reinforced the use of modules, writing conditional statements, using loop structures, correcting script errors, as well as how to write comments within scripts to help with readability and descriptions.
 
The above results are from this weeks lab assignment where I worked with a script to play a dice game.  The dice game was then followed by a sequential numbering from 0 to 5 utilizing a while loop.  The dice game script itself was provided to me and I was asked to use it as a method to reinforce my ability to identify and correct errors in scripts.  I utilized both my own knowledge of script writing, and the check feature provided to me in the Python Win software application.
 
Overall this weeks lab helped build a strong foundation for my Python skills to improve upon.



Saturday, June 1, 2013

Week 3 - Python Fundamentals I
GIS 4102
 
This week the class looked closely at the foundation and building blocks of Python script.  We looked at using variables, strings, lists, functions, methods, math equations, as well as conditional statements.
 
The screenshot above is the results of a python script that I wrote.  In the script I was tasked with identifying my full name, breaking down that full name string into a list, identifying my last name from that list, and printing the result.  From there the script went on to identify how many characters made up my last name and multiplied that by the value of 3.  The script then printed the results of that equation.
 
The results were:
 
Griswold
24
 
This was a great opportunity to utilize all the Python features we have learned up to this point.  I am excited to see what is next.
 

Friday, May 24, 2013

Week 2 - Geoprocessing in Arc
GIS 4102
 
 
 
This week we worked on ModelBuilder and the functionality of it within ArcGIS.  We also exported Python script from ModelBuilder as well.  These functions were saved within Toolboxes and then compressed to be shared with others.
 
In the above image, I utilized data provided to create a model that would select all the soils that were considered "Not Prime Farmland" and with those results erase portions of the basin shapefile so that the remaining shape excluded those areas identified as "Not Prime Farmland". 
 
Week 2 really expanded my knowledge on ModelBuilder and the capabilities it has within ArcGIS to allow me to return results.  It also gave me my first opportunity to create a working GIS script and generate output from geoprocessing tools.


Friday, May 17, 2013

Intro to Python - Week 1
GIS 4102
 

 
 
The first week of the summer semester at UWF begins with my introduction to Python.  Python is both a scripting language as well as a programming language; however for this class we will be focusing in on the scripting aspect of things.  Our first module provided me with a script that can seen in the screenshot above.  Its results can be seen on top of the scripting window and after being run, created a series of folders that we will be utilizing in the GIS Programming course this semester. 
 
With the script loaded I ran it by clicking on the running man icon, although I could have pressed ctrl-r or browsed to the function by going to File and selecting Run.  The process ran and created the desired output.  In the interactive window I saw that the script was completed as it displayed a text message saying "Process Complete"
 
The use of hotkeys can also speed up the process of writing script.  I am going to make a concerted effort to identify commonly used feature hotkeys for the Python window interfaces used in this semester.