For our assignment, we created a new Toolbox from ArcCatalog and within that, a Script Tool that will clip shapefiles to the extent of a clip boundary shapefile. The tool allows the user to navigate to the data in its file location.
Figure 1 (below) shows the tool dialog that I created in ArcCatalog,
from the stand-alone Python script.
Figure 1. Clip Tool dialog box, ready for input by the user. |
This dialog has spaces for the input path (with a default provided), single or multiple input features that will be clipped, the Clip feature, and the default output path.
It's also possible in the tool settings to add a description, shown on the right of this example, and Tool Help, including what the script looks like.
Figure 2. Dialog box, after being filled by the ArcMap user. |
Figure 3. Successful Results Message for the Clip Tool, produced in the ArcMap environment |
Although the user need not ever see the actual Python script, the script's progress can be monitored in the foreground of ArcMap,via results messages written into the original script, as shown in Figure 3, left.. These messages indicate the tool's progress (including any errors) to the ArcMap user.
Figure 4. New shapefiles added to ArcCatalog and the ArcMap display |
Finally, after the tool runs, the resulting clipped features are stored in the Results folder, as seen in ArcCatalog, and can be added to the map display in ArcMap (both shown in Figure 4, left).
The light purple area is the clipping boundary shapefile, the State of Durango, Mexico, Roads, railways, rivers and urban areas are the input files, and they are shown in the map display as colored lines, clipped to the extent of the Durango shapefile.
No comments:
Post a Comment