GIS Programming- Geoprocessing
This week we learned how to complete geoprocessing tasks with python scripts and models. The goal was to create a model in ArcGIS Pro and a python script. The script was to create XY coordinates in a shapefile, then create a 1000 meter buffer around it, and finally dissolve the buffer into a shapefile.
I began this script by establishing my module and environments. I imported the arcpy module and my environment. I based this on previous template scripts. I then established my workspace and shapefile. Next, I created the XY coordinate script. I added the AddXY function and instructed it to print a message when done. To create the buffer, I used the buffer analysis function and established my parameters. I set my buffer to 500 meters so the diameter would be 1000 meters. To create the dissolve buffer script, I used the dissolve function with my input and output. Finally, I inserted two print messages after each function. The first message informs the user what is happening and the second prints the get messages function from ArcGIS pro. I also encountered an error with the buffer function not running because the file already existed. I added the overwriteOutput tool and set it to true to allow overwriting.
The final output is included below:
Comments
Post a Comment