Posts

Showing posts from June, 2022

GIS 4048 - Module 6 Assignment: Working with Rasters

Image
 For module 6 we are to create a raster that displays certain areas with particular parameters of slope, aspect, and land cover type. While I was working on this assignment, I tried to edit my code multiple times as I felt my raster results were not exact to the example in the assignment directions. I decided to submit with my results, as I felt it was the closest, I was going to get to the assignment raster example. Once I zoom in closer to my final raster map, I felt a little more confident as it matched better with the example. (I also have a small computer screen). Final Raster Map: Zoomed Raster Map: Flow Chart: Start print import arcpy from arcpy import env from arcpy.sa import * print env.overwriteOutput = True print set workspace to gdb print create new raster if arcpy.CheckExtension print check out extension print remap value function reclassify tool .save print assign elevation raster variable print create variables for slope and aspect print calculate slope and aspect ca...

GIS 4048 - Module 5 Assignment: Working with Geometries

Image
Working with Geometries The screenshot is a final product of a written script that created a TXT file writing the coordinates and object IDs for specific rivers (vertices) in a shapefile. The screenshot was taken from NotePad++ and consists of a total of 247 vertices.   Screen shot of final TXT file: Flowchart: Process Summary Notes: During this week’s lab I had the most opportunity with the cursor and write( ) portion of the assignment. While trying to construct my code I noticed I was running into the same few errors every time I felt I made progress. Some of the errors I was getting in the IPython window were:  “typeerror: 'point' object is not iterable” “typeerror: 'row' object is not subscriptable” After some guidance and explanation from the wonderful T.A. I realized my mistake. To correct the two errors above I had to correct my field values and my write statement. At the beginning on my script, I added my “fields”. For example, [field=’OID@’, ‘SHAPE@’, and ‘NAME...

GIS 4048 - Module 4 Assignment: Exploring & Manipulating Data

Image
Module 4: This week in Module 4 we had the task of creating a script that creates new geodatabase. Once we create our database, we then need to pull in all feature classes from the module 4 data. We then use these feature class to create a for loop, and then create a search cursor to result in a specific type of cities list. We are pulling in the cities that are 'county_seats' that are found on our attribute table in ArcMaps. We specific the fields we wanted printed (name, feature, and population).  Complete Script: Flow Chart: Notes from the Process Summary: 1          This was a tough module. With time, and patience we made it through and ready for the next. I learned more “new tricks” during this module. For example, using “\n” creates breaks in the printed script for a clearer reading. I should have probably known that already, but I didn’t and found that to be a neat tool! 2          I felt there...

GIS 4048 - Module 3 Assignment: Geoprocessing

Image
For this module we used two different ways to perform geoprocessing analysis. The two tasks we were asked to complete were to create a model using model builder and to write a python script.  The first method we did on this exercise was the model builder in ArcGIS. With this tool we started off using the soils and basin files to clip them together for the start of the model. Next, the select tool was used to separate what soils were compatible for farmland and what soils were not. The last tool, erase, was used to take away the noncompatible soils from the out to give us a map of compatible soils for farming. The overall purpose of designing this model was to display a final map of soils that were prime for farmland. For the second part of the assignment, we are to write a script that creates a map of hospitals that are located in a 1000-meter radius that do not overlap. We are sure the XY coordinates do no overlap because we use the dissolve tool to prevent this from happening whe...

GIS 4048 - Module 2 Assignment: Debugging and Error Handling

Image
Module 2 - Part 1: Script 1 had four errors when I ran the original downloaded script from the (R:) file. I found there were 3 code analysis errors that needed to be corrected for the script to run properly. Some of the errors included correct punctuation errors (to match other parts of the code) and making sure the env.workspace was directed to the correct file location. Once these simple errors were corrected the code can just as it was described. I found it pretty cool that this code was able to print the categories from the .aprx GIS file.    Module 2 - Part 2: Before beginning to work on script 2, opening the .aprx file in ArcGIS was necessary. I had to connect the .shp files in order to have the correct file path. Once this was done, script 2 had numerous small errors in the downloaded script. There were multiple “typos” in script 2, including symbol errors, extra characters in some places, and the addition of characters where they were missing. The first major error I f...