GIS Programming Module 3: Geoprocessing

 


In this week’s module, part of our assignment was to use Spyder to enter script that would add XY coordinates to the attribute table for each point of the Hospital shapefile in the module’s data folder. We also entered script to add a 1000-meter buffer around each hospital point, and then dissolve those buffers into one layer on the map. Going through the exercise, I had some difficulties understanding and executing the script. However, as with Module 2, when I began to work through the assignment, everything made more sense, and my scripts ran successfully. I had some errors while working through the assignment, and they were mostly syntax errors where I hadn’t made a word pleural as it need to be to run the script. I’m learning that the solutions to most of my script problems are quite simple and straightforward, I just need to not over-think too much. 

The ArcGIS Pro help pages linked in the assignment description were very helpful to me this week. Especially for entering the script for the XY coordinates. The help page showed m the step-by-step process and explained what each line of script was accomplishing. 

For example, to assign XY coordinates to a shapefile, first set up the system modules and identify the workspace or file location you’re working from. Then, set the variables and define the “in” data (original shapefile) and features (new shapefile). Next, copy this data to a new dataset so it doesn’t write over the original shapefile and execute the script. For this module, we also added a “GetMessages” function with each script to confirm that the script ran successfully in Spyder.  

A big part of the exercise this week was working in ArcGIS Pro using the Python console and ModelBuilder for Geoprocessing. Up until now, I have only used the Geoprocessing pane to run processing tools in ArcGIS. We used the ModelBuilder to run a Clip Geoprocessing tool. I’ve used the Clip tool often in ArcGIS, and it was very interesting to learn a few new ways to clip shapefiles through the ModelBuilder and Python script. 

The ModelBuilder takes the Geoprocessing pane and turns it into a flowchart so you can see how each tool is connected and control how it appears on your map. The ModelBuilder also allows you to run multiple Geoprocessing tools in one place. After I ran the Clip tool, I ran the Select tool to narrow down the data and then used the Erase tool with the outputs from the first two tools to remove unwanted data from my map. 

Comments