Labels

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

Sunday, August 2, 2015

GIS 4102: GIS Programming Module 11

Module 11: Sharing Tools

This week’s lecture covered methods for distributing tools, considering licensing issues when distributing tools, using a standard folder structure for sharing tools, working with paths, finding data and workspaces, creating a geoprocessing package, embedding (importing) script tools, setting tool password protection, and creating documentation for tools.

This week’s assignment involved editing a script tool, embedding the script into the tool, and sharing it. The assignment included:
·         Creating variables with sys.argv[] expressions (instead of GetParametersAsText()) to capture parameters from the tool dialog.
·         Editing the tool’s Item Description to add documentation that shows in the tool dialog.
·         Embedding (importing) the script into the tool.
·         Setting a password to prevent an unauthorized user from viewing, editing or exporting the script.
·         Sharing the Toolbox (without the script as it was embedded into the tool).

Below are screenshots of the Tool’s dialog window in ArcMap and successful map result after running the Tool.




Saturday, August 1, 2015

GIS 4102: GIS Programming Participation Assignment No. 2

Participation Assignment No. 2

GIS as a Job Growth Area for IT Professionals

World of Computer Science and Information Technology Journal (WCSIT)
ISSN: 2221-0741
Vol. 5, No. 6, 98-111, 2015


This study focuses on GIS as a job growth opportunity as companies take advantage of the benefits of geospatial data.  Careers in the field of GIS require knowledge of geography, cartography, and information technology (“IT”).  In addition, geospatial data requires storage, management, analysis, and dissemination.  These skills provide opportunities for IT personnel in the GIS industry as network, database, cloud computing, and development technologies change and grow.

The GIS field has not been known as a growth area to IT professionals, in part because job postings do not clearly match the skills of IT professionals with the skills required for GIS job openings.  This study evaluates job postings in Monster.com, Indeed.com, CareeBuilder.com, GJC.org, and GISJobs.com for four positions in the GIS field.  The postings were rated and compared to similar postings in other job boards. 

The results varied significantly even among similar job postings.  The inconsistency on job postings may mislead prospective candidates into thinking they don’t have the skills required for the position when they often do.  This study highlights the need for the industry to set standard job descriptions and requirements for positions in the GIS field to help those seeking to match their skills set with the job opportunities. 



Tuesday, July 28, 2015

GIS 4102: GIS Programming Module 10

Module 10: Creating Custom Tools

This week’s lecture covered creating custom tools, editing tool code, setting tool parameters, working with tool messages, and customizing the tool progress information.

This week’s assignment involved creating a script tool from a Python script that clips multiple layers at once.  The assignment included:

·         Creating a new custom Toolbox.
·         Adding a Script Tool from the Python script.
·         Setting the parameters of the newly created Tool.
·         Modifying the script to reflect the new Tool parameters.
·         Sharing the Toolbox, Tool and Script.

Below are screenshots of the Tool’s dialog window in ArcMap and successful results window in ArcMap after running the Tool.



Saturday, July 18, 2015

GIS 4102: GIS Programming Module 9

Module 9: Working with Rasters

This week’s lecture covered the use of the List and Describe functions with rasters, using raster objects in geoprocessing, using map algebra in operators, and working with classes to define raster tool parameters. 

This week’s assignment involved writing a script that creates a raster output that identifies areas with a particular set of parameters (slope, aspect, land cover type).  The final raster output highlights areas with the following traits:

·         Forest landcover with classifications 41, 42, and 43.
·         Slope between 5 – 20 degrees.
·         Aspect between 150 – 270 degrees.


Below is a screen shot of the final raster.


Sunday, July 12, 2015

GIS 4102: GIS Programming Module 8

Module 8: Working with Geometries

This week’s lecture covered working with geometry objects, reading and writing geometries, and working with multipart features.

This week’s assignment involved writing a script that creates a .txt file and writes to it the coordinates and Object IDs for vertices in a shapefile by using geometry objects, using a search cursor, and nested loops.


Below is a screen shot of the records written to the .txt file by the script.


Monday, July 6, 2015

GIS 4102: GIS Programming Module 7

Module 7: Explore/Manipulate Spatial Data

This week’s lecture covered checking for, describing, and listing data, working with lists and dictionaries, working with search cursors, update cursors, insert cursors, running SQL queries, and validating table and field names.

This week’s assignment involved writing a script to do the following:

1.     Create a new geodatabase.
2.     Copy all data from a data folder into the new geodatabase.
3.     Populate a dictionary with the names and population of every county seat city in New Mexico.
4.     Printing messages before and after each process.

Below is a screen shot of the results in the Interactive Python window.


Wednesday, June 24, 2015

GIS 4102: GIS Programming Module 6

Module 6: Geoprocessing with Python

This week’s lecture covered using Python for geoprocessing tools, working with toolboxes, using functions and classes, using environment settings, working with tool messages and ArcGIS licenses, and accessing Help for syntax and sample code.

This week’s assignment involved writing a script to do the following:

1.     Add XY coordinates to a layer by using the AddXY Tool.
2.     Creating a buffer around features by using the Buffer Tool.
3.     Dissolving the buffer layer into a separate, single feature by using the Dissolve Tool.
4.     Printing the messages after each tool.

Below is a screen shot of the results in the Interactive Python window.



Wednesday, June 17, 2015

GIS 4102: GIS Programming Module 5

Module 5: Geoprocessing in ArcGIS

This week’s assignment covered creating a toolbox, creating a tool using Model Builder, setting Model Parameters, exporting a script from Model Builder, updating that script to work outside of ArcMap and creating a script tool from it.

The tool does the following:

1.  Clips the Soils layer to the Basin features.
2.  Selects Not Prime Farmland from the Clip.
3.  Erases this selection from the original Basin layer.
4.  Creates a new Basin layer without the Not Prime Farmland clipped/selection.

Below is a screen shot of the output shapefile (the new Basin layer without the Not Prime Farmland).



Friday, June 12, 2015

GIS 4102: GIS Programming Participation Assignment

Participation Assignment No. 1

Tracking Hotspots: Putting Sewer Cleaning on the Map, WaterWorld Magazine.


This article discusses the use of ArcGIS and ArcPy in particular to track distressed areas of the sewer system that need frequent cleaning.  A rise in sanitary overflows and sewer stoppages at the Town of Mooresville, NC in 2010, due to an aging infrastructure and the tripling of the population, resulted in the need for distressed spots (hotspots) to be identified for maintenance. 

Monthly data, stored in Excel, containing the manhole location and last time the corresponding sewer main was cleaned needed to be converted into a map to identify anticipated hotspots.  Python scripting was used to process the batch of Excel data to generate a comprehensive dataset.  The resulting dataset was joined with the features of the town’s sanitary sewer system which had been recently created in ArcGIS.  Reports were created by using the ArcPy function in Python to present the results.

Python was used to automate the analysis process in ArcGIS resulting in color coded maps representing cleaning frequency and identifying anticipated hotspots.  With Python, the Analyst Frequency Tool was used to calculate the number of sewer mains and length cleaned in a given month and the process was automatically repeated by Python for each month and merged into a single comprehensive layer.

The resulting map facilitated the identification of areas that require more frequent inspections and increased pumping/cleaning particularly for food service establishments thus remedying problem grease interceptors in multiple occasions.  Productivity increased and main-line stoppages decreased resulting in cost savings including less overtime.

Wednesday, June 3, 2015

GIS 4102: GIS Programming Module 4

Module 4: Debugging and Error Handling

This week’s assignment covered debugging and error handling in PythonWin using the debugger and the try-except statements.  The first and second script contained errors that were identified by running the debugger on a step by step (line by line) to correct the errors based on the error message information and codes provided by PythonWin.  The third script contained errors but the errors were not corrected.  Instead the try-except statements were used to capture the error and to print the error messages thus allowing the code to run with the errors.

Below is are screenshots of the interactive window results for the three scripts.




Tuesday, June 2, 2015

GIS 4102: GIS Programming Module 3

Module 3: Python Fundamentals Part 2

This week’s assignment covered importing modules, correcting script errors, creating while loops and conditional statements, adding script comments, and iterating variables within a loop.  The script performs a little dice rolling game based on the player’s name length, then creates a list with 20 random numbers in it.  The script also creates a conditional statement with a nested while loop that removes all instances of a specified number in the list.

The script imports the random module and uses the following functions and methods:
·         Len function.
·         Random integer method.
·         List append method.
·         List count method.
·         List remove method.

Below is a screen shot of the results of the script.


Saturday, May 23, 2015

GIS 4102: GIS Programming Module 2

Module 2: Python Fundamentals Part 1

This week’s assignment covered the use of variables, strings, lists, functions, methods, math, and conditional statements.  The script prints my last name and a number equal to three times the number of characters in my last name. 

The script creates several variables including:
·         A variable for my full name.
·         A variable to split my full name into a list.
·         A variable to store the length of my last name which is the second item on the list – index position 1.
·         A variable to store the result of the multiplication of the length of my last name times three (3).


The script uses the following functions and methods:
·         split method.
·         len function.

The script prints the values of the last name and result of the multiplication variables.

Below is a screen shot of the results of the script.

Monday, May 18, 2015

GIS 4102: GIS Programming Module 1

Module 1: Introducing Python

This week’s assignment covered the introduction to Python, IDLE and PythonWin.  In PythonWin we reviewed and ran the CreateModuleFolders scripts.  The script created twelve (12) folders with several subfolders (Data, Results, Scripts) in the S:\GISProgramming folder. 

Running the script was simple.  I clicked on the “Run” icon, but there are several other ways to run the script such as File Menu > Run, Control Key –R, or simply doubly clicking on the script file.  The script ran and it returned a process complete message as stated in the script.  The 12 folders and sub-folders were created.

Below is a screen shot of the twelve folders created by the script for my S: drive.