Friday, June 29, 2018

Geoprocessing with Python

This week we focused on executing geoprocessing steps outside of ArcGIS using Python scripting.  While the task for this weeks assignment seemed daunting at first, but when I broke it down and used the ArcGIS help pages to obtain the correct syntax, all the pieces fell into place rather simply and without much need for incessant troubleshooting.  The following steps were used to create the script:

  1. Import arcpy and the env tools
  2. Obtain the proper syntax for AddXY and add that tool to the script, export messages upon completion
  3. Obtain the proper syntax for Buffer and add that tool to the script, export messages upon completion
  4. Obtain the proper syntax for Dissolve and add that tool to the script, export messages upon completion
  5. End script.
The script was literally that easy to create.  Only required parameters were used for this script as well which made it that much easier to write.  Once the script was run, I opened ArcMap and verified that the steps were completed correctly.  Here is a screenshot of the interactive window from PythonWin showing all of the tool messages after I ran the script:


Let me know if you have any questions by using the comment section below!

No comments:

Post a Comment