Tuesday, June 23, 2015

GIS Programming: Geoprocessing with Python

Hello,
     This week in programming focuses on using geoprocessing tools within python script. Key objectives associated with this were to identify helping features of arcMAP and Python for working with different tools specific python syntax. Exploring functions and classes within Arcpy and applying them to environment settings through Arcpy. And also working with specific messages generated by tools being ran. These objectives were explored by creating a script which takes a point feature class (Hospitals) of an area, and adding defining its current projection, then adding XY data to the feature class. This allowed the points to be buffered out to 1,000 meters. Then another tool was used to dissolve the areas where the different hospitals buffers overlapped. The buffer tool does have optional inputs to do this dissolving process, however to further explore scripting with Arcpy, two different script tools were used. Below is the result message of the functional script.


The assignment portion of the lab was broken down into three specific functions, adding the XY data, buffering the hospitals, and dissolving overlapping buffer lines. This is reflected in this order in the resulting message blocks. Each segment of script written for an individual tool had messages generated to show its overall progress and success or in-success. Additional background processing is not noted by this screen shot, such as the workspace being set, or defining environment specifics such as the coordinate reference being used for the various feature classes, but all of these were programmed into the script as a part of the lab. All inputs that i used were hard coded to the individual tools, meaning that I was not using particular variables to represent the tool entries first. Overall this was a good exploration of the automation of multiple geoprocessing tools within Python more so than the interactive window within ArcMap. Kudos goes to Arc Help for having detailed examples of different methods to script the tools used! And thank you for your interest and stopping by.


v/r



Brandon

No comments:

Post a Comment