Posts

Showing posts from June, 2022

GIS 5103 - Working with Rasters

Image
 The final module for the GIS Programming course, module 6, focused on working with rasters as the title of this blog post suggests. This module taught students how to list and describe rasters, how to use raster object in geoprocessing, how to use map algebra in operators, and how to work with classes to define raster tool parameters.  By this time in the course, as we are drawing to a close, I have definitely become more comfortable with Python. It is now easier for me to put newly learned functions and methods to use, to identify mistakes and to rectify issues that arise. As such, this week's assignment seemingly gave me very minimal issues in comparison to previous assignments. For the assignment we were tasked with utilizing two rasters, elevation and landcover, to create a final raster that meets certain criteria. The criteria included being a forested area, having a slope between 5 and 20 degrees, and having aspect between 150 and 270 degrees. The following images are the ou

GIS 5103 - Working with Geometries

Image
 Module 5 of the GIS Programming course introduced students to working with geometries. Geometries refer to features that are points, lines, polygons or multipart features. We were able to read geometry objects to obtain additional information about them and their properties, we were able to write to the geometry in essence modifying or updating it, and we learned about nested loops which are necessary when working with polylines, polygons and multipart features. The code and functions we learned about take processes that require a long time and provides "shortcuts" making the GIS professional more efficient. This particular module also built on last week's module, requiring us to utilize a search cursor.  The following image is a screenshot of a section of the text file resulting from our assignment.  We were tasked with producing a text file which included a list of the vertices for rivers in a shapefile. Each entry in the list needed to include a feature number, vertex

GIS 5103 - Exploring and Manipulating Data

Image
 The fourth module of GIS Programming got a little more intense than previous weeks. This week introduced students to: The describe function Listing data Lists and dictionaries Search, update and insert cursors And validating table and field names As usual we got to utilize what we learned during the assignment. The following is a flow chart of my process: If you have seen some of my previous blog posts, you can see that this flow chart is more extensive that previous charts posted. The assignment required students to create a geodatabase, copy shapefiles to the geodatabase using a for loop, create a cursor to find the name, population and feature of all cities labelled county seat, create a dictionary and populate the dictionary. The image below shows my results:  Overall, this assignment was a challenge. I had a few issues arise initially, including but not limited to not being able to overwrite an existing file geodatabase and syntax errors. The biggest lesson for me from this assig

GIS 5103 - Geoprocessing

Image
This week's topic is Geoprocessing! After focusing on learning Python for the past two modules, it was nice to see how python is used specifically for GIS and geoprocessing. In the first instance, we got a quick review or crash course (depending on your knowledge base) on utilizing geoprocessing tools, batch processing and model building. While it is possible to utilize a geoprocessing tool to complete one process, batch processing allows you to utilize one tool to process multiple inputs, and model building allows you to utilize many tools to complete a workflow instead of one tool at a time. We then learned how to utilize python script to run a geoprocessing tool or complete a workflow using multiple tools.  For our assignment we were required to add XY coordinates of a hospitals shapefile, create a 1000 meter buffer, and dissolve the buffer into a single feature. Below are my results.   Once the necessary module were added and environment set, I ensured the overwrite option was