Programming Week 4: Geoprocessing
For the first part of this week's lab, we created a model in ArcGIS Pro's ModelBuilder to create a new layer from the exiting soils and basin layers. The model clips soils to the extent of basin, selects the clipped soils records that are classified as "Not prime farmland", and erases these selections from the clipped soils layer. ModelBuilder is a very handy tool that makes it easier to visualize a complex, multi-part process (though it is possible to get confused in its labyrinth!), and it reminds me of the flowcharts we did at the beginning of the course.
The three-part model resulting in a layer called soils_Clip_Select_EraseIn the second part of the lab, we wrote a script in an ArcGIS Pro Notebook that added XY coordinates to a hospitals shapefile, created a 1000 meter buffer around each hospital, and dissolved these buffers into a single feature.
The hospitals_dissolve and hospitals layer
I first created a new map and added the hospitals shapefile so I could see what I was working with. I looked at the Esri documentation for each tool needed to figure out the code and arguments I needed to use. I created input and output variables and assigned them to the appropriate file paths. I ran each of the three steps in separate blocks of code so I could test them individually before consolidating them into one. I also checked my map and the attribute tables after each step to make sure that the output layers were showing up correctly.
Success!
Above is the output messages I got when I ran my code. Although I included the GetMessages() function for every step, there was no informative message besides start and success times for the first two tools. Overall I found this lab pretty easy, and I enjoyed getting to write my own (very basic) code.
Comments
Post a Comment