Labels

Wednesday, June 22, 2022

GIS 5103 Working with Rasters

 For our final lab we learned about working with rasters. We learned how to describe rasters, use raster object in geoprocessing, use map algebra operators and how to work with classes to define raster tool parameters. We were introduced to arcpy.sa (Spatial Analysis) which provides access to a number of geoprocessing tools to work with raster data as we did in this lab as well as with imagery. 

For our lab assignment we were tasked with creating a raster output that identifies areas with a particular set of parameters: slop, aspect, and land cover type. I created  a workflow to help me get organized to create my script in Spyder.




There numerous challenges were encountered in this weeks lab.  Indentation was an ever-present concern especially since we were incorporating an if else statement. We also had to create several variables for our calculations on slop and aspect. This created multiple temporary rasters which we had to combine into one final raster and save. I saved mins as a .tif and fortunately achieved the desire results.


While I am by no means a Python expert, I do feel like this class has given me a better understanding of Python and the workings of the preloaded goeprocessing tools found in ArcGIS Pro. 

 


Wednesday, June 15, 2022

GIS 5103 Working with Geometries

 

This week our focus was on working with geometries. We learned how to read and write geometry objects (vector data) using our ever developing, Python skills. We were introduced to geometry tokens and used SHAPE@ and  OID@ in our lab assignment.  These tokens were used through  search cursor. We also delved deeper into the use for “for loops” by utilizing nested for loops.  In addition, we went over multipart feature and polygons with hole as they require a different approach. In the latter portion of this week’s lesson, we learned how to create/open a text file and enable the write method.

For our lab assignment we were tasked to write a Python script that creates a TXT file, writes the coordinates and object IDs for vertices in our rivers shapefile.

I created a workflow to help me organize my script which is pictured below:





The lab itself was quite challenging. The portion of the scrip containing the nested for loop and, write and print code required several re-writes. Getting the correct indents was the reason for this. Once that was finally corrected I was able to achieve the desire results in my TXT file. As you can see the OID, VertexID, X and Y coordinates are all present.


I have found that all to often you can overthink the process and get bogged down quickly. Stepping back and referring to the workflow diagram is helpful.




Thursday, June 9, 2022

GIS 5103 Explore & Manipulate Data

 

Module 4 cranked up the level of difficulty quite a bit.   We also  covered a ton of material in chapters 6 and 8 of our text. We were taught how to check for, describe, and list data. Then , we went on to lists, tuples, and dictionaries. We discussed how "For" loops can be used to iterate over the elements in a list and that elements in a list can be modified through the use of cursors. We learned that tuples are similar to lists, but their elements are immutable. Dictionaries contain keys and corresponding values.

This assignment tasked us to use Python to create a script that would run without error. Our scripts must create a new geodatabase, copy all data from our Data folder into the new geodatabase, and lastly it had to populate a dictionary with the names and population of every ‘County Seat in New Mexico. We were provided with a template that gave us a very basic framework to assist developing our code.

I ran into numerous pitfalls along the way but eventually was successful. Trying to cram too much into a single line of code was problem for me. Stepping back and breaking it down into smaller segments made things go much smoother. It’s very important to be aware of your workspace and to know when to use arcpy.SearchCursor and when to use arcpy.da.SearchCursor! As with every lab so far and for infinity I can’t stress enough SYNTAX, SYNTAX, SYNTAX!


I did a workflow for the creating and populating dictionary portion of this lab. Below is a simplified version that won't give away code details needed to complete the lab:


Completing that segment was the last hurdle to get over on the road to a successful script.

Here is a screenshot of the first portion of the script output:

The next portion had a much longer output. This is for the Search Cursor portion of the code.

The final portion of the lab was to populate the empty dictionary we created and print it.












Sunday, June 5, 2022

GIS 5103 Geoprocessing Lab

 This week our focus was on Geoprocessing in ArcGIS Pro. We covered where to find the tools in ArcGIS, and how to create our own toolboxes. We were also introduced to ModelBuilder in ArcGIS Pro. This is a wonderful too. It very user friendly and there are some very helpful YouTube videos out there if you are new to ModelBuilder.  In this lab we used ModleBuilder to create a model that clipped all soils to the extent of the basin polygon; selected all soils with a specific classification and erased them from the basin polygon.  Below is a snapshot of my results.



The next section of the lab required us to write a Python script. This was done in Spyder and then once it was error free we ran it from the iPython screen in ArcGIS Pro. The first requirement of our script was for it to add XY coordinates to a shapfile. Next it had to create a buffer of a specific size around our newly created shapefile. From there it has to dissolve that buffer into a separate single feature. Once the tasks were completed the script had to print messages. I made a basic workflow using the ModelBuilder style to help me get organized to write my script.



Three test script later I was able to get the results I needed.

 


This was a tough lab. One of the biggest problems I had was syntax and missing simple errors. 







 

From Fragmented Data to Actionable Intelligence: A GIS Case Study

  Case Study: Building a Centralized GIS Platform for the Cleveland Museum of Natural History Natural Areas Client: Cleveland Museum of Na...