Posts

Showing posts from June, 2025

Geoprocessing

Image
part 1   part 2     In this week's lab, I learned how to preform geoprocessing tasks with Python. In the first part of the lab, I used the clip tool to clip soils within the basin  shape file. In the second part of the lab, I wrote a Python script that preformed three tasks: adding XY coordinates, creating a buffer, and dissolving.  In Notebooks, I first defined the workspace to be my Module 4 Data folder, and set overwriteOutput to True . After that, I used arcpy.management.AddXY to add XY coordinates for the hospitals shapefile. After that part passed, I then used arcpy.analysis.Buffer to create the 1000 meter buffer around the hospitals. Finally, I used arcpy.management.Dissolve on the hospitals_buffer shapefile to dissolve overlapping buffers. It was interesting to learn how to complete ArcGIS tasks using Python.

Debugging

Image
  Part 1 Part 2 Part 3 For this week's lab, I worked on identifying different types of errors and how to fix them. In part 1, there were two errors to fix. This is were I learned that in order to run Python scripts that involve feature classes or ArcGIS, ArcGIS Pro needs to be initialized, otherwise Python throws an error. Part 1 printed the names of the fields in a shape file attribute table. Part 2 took me a bit longer, since it had more errors to fix. I kept getting OSErrors in this part, but eventually it printed the available shape files in an ArcGIS project, as well as the project's spatial reference. For part 3, I was tasked with making a code run, even with errors. This was done by using a try-except statement were the error was occurring. This allowed the code from part A to run, even with the error, so that part B could run after it. Part A printed an error statement, and part B printed out the name, data source, and spatial reference for each layer. I enjoyed the lab...