Just as in last week's assignment, geoprocessing is covered albeit with a greater emphasis on using Python. The assignment this week focused on writing a script that performs three geoprocessing tasks: adding coordinates to a layer (
AddXY tool), creating a buffer around features (
Buffer tool), and dissolving the buffered areas into a single feature (
Dissolve tool). The resulting program must also print
messages for each task to show that it was carried out successfully in addition to working within a
set workspace. Each of these tools and tasks reinforced how to use Python for automating geoprocessing.
Writing the code for each tool provided practice not only calling the tools but using the proper syntax for each tool. There are several ways to get help with syntax and they are all convenient and easy to access. If writing code within ArcGIS there are code autocompletion prompts and syntax help in the Python window. ArcGIS Help is also useful in that it provides example code for each tool. It can be accessed using the Search tool (or through your browser of choice). Setting the environment and workspace is an example of using classes in ArcPy.
|
A screenshot displaying the results of a program that runs several geoprocessing tasks and prints messages to show the tool was successfully run. |
Throughout my code I wrote comments to delineate each line or section's purpose. This helped me keep track of what I had accomplished while writing the code. Once I had finished the code, I found the comments useful "bookmarks" for finding my place in the code.
No comments:
Post a Comment