For the lab we were given a stand-alone script and the direction for turning it in to a script tool in ArcMap. The script tool we created clipped multiple files to the same boundary area at one time. This is my very general description of how to create a script tool:
Multi-Clip Script Tool |
1.
Create
stand-alone Python script that performs geoprocessing within ArcMap.
2. In ArcMap create
new Toolbox in the desired folder in the Catalog window (the same folder the script is
saved in).
3.
Add
a new script tool to the new Toolbox. This will open the new script tool window.
4.
Set
the name, description, store relative paths option, and file path to the
stand-alone script in the new script tool window.
Script Tool messages printed to the Results window in ArcMap |
5.
Set
tool parameters for the script tool either in the script tool wizard or in the script
tool properties.
6.
Edit
the stand-alone script to reflect the tool parameters set for the script tool
instead of absolute paths with the arcpy.GetParameter() code.
7.
Within
the stand-alone script change print statement to arpy.AddMessage() statements so the
messages will print in the Results window in ArcMap.
-A note for the final project-
I forgot to add updates about my final project the last few weeks. I decided to work with a large .csv containing crime data points that I downloaded from the San Diego Regional Data Warehouse for my Applications class. There was way too much data to work with in ArcMap initially so I wrote a script to display to the points, save the points as a feature class, clip to points to a particular buffer zone, and then separate the points by year. I presented the script project this week in GISProgramming and I'll be working with the data this weekend to finish my analysis project for Application.
No comments:
Post a Comment