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.
Comments
Post a Comment