Monday, June 29, 2020

Weighted Suitability Analysis


Below is a map comparison of two weighted suitability analysis. To complete this analysis, I used pre-determined suitability criteria for land cover, soil type, slope, proximity to roads and proximity to rivers.  The image on the right uses an equal weight analysis, and the image on the right favors appropriate slope, soils, and land cover, with slope being the most important factor.  All files were converted to raster files and reclassified with the pre-determined criteria in order to create an apples to apples comparison.
The most favorable location are those close to water and roads, with a gentle slope and grassland or agriculture as the current land cover.

Thursday, June 25, 2020

Introduction and Story Map

My name is Reed Welke and I currently live in an RV and work remotely for a flooring company based in Charlotte, NC.  I am enrolled in the GIS Administration program and am on track to graduate in the summer of 2022.  I travel the country with my wife and two dogs and hope to challenge myself and get into a more meaningful line of work with the assistance of this GIS education.  I am sure I will see many familiar faces and I look forward to working with you all again!

Thursday, June 18, 2020

Working with Vector Geometries in Python

This week, we explored vector geometries in Python.  We were given a rivers shapefile with 26 objects and 247 vertices and were tasked with writing a script that would create a new text file, identify the OID, vertex ID number, X coordinate, Y coordinate and feature name, and write those parameters in the newly created text file.  Below is a snippet of the completed text file after the script has been run.

Below are some of my notes related to this project, and a brief pseudocode describing the process.

Start:
Import arcpy catalog
Set environment = S:/GISProgramming/Module6/Data
Overwrite Workspace = True
Create new text file, make file writeable
Specify cursor to search through fields in a shapefile
Create a loop to iterate through fields
                              Nest loop to allow the cursor to find vertices of all points in a multipoint file
                              Write code to text file with following paramaters:
                                             OID, Vertex ID number, X Coordinate, Y Coordinate, and Feature Name
                              Print statement equal to the code that is written to the text file
Close text file
Delete cursor
End                                     
1 I struggled the most with grasping the concept of row[0, 1, 2] as a representation of the Search Cursor parameters. Once I finally grasped this concept (which was very obvious when reading through the arcpy catalog help), I was able to finish the code with relative ease.

2 As with all previous labs, the logic of python becomes obvious once you write a code sequence correctly. It can feel defeating at times, but when you finally have that aha moment, it all comes together and you feel your knowledge of the language take a leap forward.

3 I cannot express enough how helpful it is to have relatively little guidance on the lab assignments because they force you to really think and solve the problems on your own. This makes it difficult, but the learning is increased because of the need to figure it out for yourself with snippets of the solution scattered through the exercises and readings. It makes me feel as though any problem is solvable with Python if you are willing to take the time and solve it.

Saturday, June 13, 2020

Basic Tasks in ArcGIS with Python

This week, we created a geodatabase, copied shapefiles from a folder into the geodatabase, created a searchCursor with a SQL query and a for loop to retrieve the populations of each city listed as a county seat in New Mexico, and then created a dictionary of those values and printed the dictionary.  The results from my code are pasted below:







I had some difficulty when printing the “POP_2000” field in the section where we were listing the County Seat statistics. I kept getting the error that POP_2000 must be string and the logic of where to place the ‘str’ to convert this object from an integer puzzled me for a bit. In hindsight, it was a very simple fix, but I struggled for a while with that. I ultimately realized that the correct location was before the row.getValue function as follows:
print("Population circa 2000: " + str(row.getValue(field2)) + "\n")

I also had issues with finding the correct way to efficiently get the searchCursor set up so that I would be able to retrieve only the cities listed as a “County Seat”. I debated creating a copy and deleting fields so that it could only print the existent fields, but knew it was not the best route. I then realized the SQL query was all too obvious. I used the following line of code to select only the County Seats:
cursor = arcpy.SearchCursor(fc,'"FEATURE" = \'County Seat\'')

My final major hurdle in this experience was in getting the dictionary updated with all of the county seats and their respective population. I kept getting the “NAME” and “POP_2000” as the only populated fields in my dictionary. Again, the solution was very logical and I finally realized the need to input the entire ‘row.getValue’ + the correct field in my update function in order to iterate and populate the dictionary as desired. That line of code resulted as follows:
for row in cursor:
     dictionary.update({row.getValue(field):row.getValue(field2)})


In summation, I found this lab to be the most challenging and most rewarding so far. I am really starting to see how the code fits together and how it gives us the ability to complete complex tasks by stacking the Legos together. The answers are all very logical, but it can be difficult to see the obvious errors until you have experienced them a few times first hand.  The basics of importing catalogs, assigning proper variables and setting the work environment are key to being able to dig into the most difficult problems you are trying to solve. Without the fundamentals in place, one can get bogged down in simple mistakes and issues. A good foundation is paramount.

Sunday, June 7, 2020

Geoprocessing

This week, we built a model that clipped, selected, and erased specified features of a geodatabase.  We then wrote a stand-alone script to add XY coordinates to a layer, create a buffer around those data points of 1000 Meters, and dissolve the buffers into single, combined features when necessary.  We also printed the functionality of the code with a get.Messages function.  The image below shows the results of my final code.


1        My thought process for creating the above script was to examine the basic code descriptions provided by ArcGIS help and get a feel for how each of the tools worked. 
2        I then thought it would be good to start with the basics of setting my environment and allowing files to overwrite.
3        Once I had done that, I pasted a skeleton version of the add XY code and input the correct file paths and adjusted everything according to our desired outcome and the layers we were working with.  I ran the debugger to make sure all of my code worked.
4        I then used the buffer analysis tool with the dissolve option and input the given parameters. I ran the code to make sure it worked.
5        Once I knew the code functioned without error, I created the print statements using the get.Messages function and everything worked.
6        I chose not to add the dissolve tool separately as another piece of code to supplement the add XY and buffer, but used the dissolve abilities of the buffer analysis tool to complete that in one step and achieve the same result.
7        My overall strategy was simply to go step by step, gain as good an understanding as possible of the meaning behind each of my actions, and keep at it until everything worked.

This was a great lab to get a taste of how Python is integrated into everything we do in arcGIS Pro.  I look forward to digging deeper into the world of Python.