In this case, we want it to populate the Input Features field. When you do this, you should be prompted to decide which field (or other input option) the output should be associated with. We can use the connect tool to draw a line from this output to the Clip rectangle. The green oval connected to the Iterate Feature Classes hexagon represents the output of iteration-its name is the first item to be looked at in the iteration (in this case, ONaer.shp). What we need to do is connect the Input feature with the output from the iterator. We can see that this tool requires Input Features (in this case our shapefile data), Clip Features (in this case, we have a shapefile that is the outline of the clip area we want), and the Output Feature Class file path and name. First, it is a good idea to see what the C lip tool inputs are, and so, similar to step 11, double click on the Clip rectangle. Next, we can connect the output of the iterator to the Clip tool. You can now see that the iterator components are coloured in which means that this component’s parameters have been set, and it is ready to run: (For this example, select “ON11” from the c:\Test\Example1 directory) and click on OK when you are done. Left clicking once in the input box next to any field, brings up a helpful description on the right of what is required for that field.įor the Workspace or feature dataset field, browse to and select the folder that you want to iterate through by clicking on the browse folders icon. Double click on the Iterate Feature Classes hexagon.Ĭlick on “yes” if you are asked questions about any run-time errors. Next, we can set the parameters of the iterator. Search for the tool, in this case “clip.” From the list, you can click on the title of the tool you want, in this case Clip(Analysis), and hold down the left button and drag it on to the blank canvas of the model next to the iterator block: Select Windows > Search from within ArcMap. Now let’s add the other tool we need, the Clip tool. They will be filled in “white” until you have set all the parameters. You should see the iterator components in your model now. Select Insert > Iterators > Feature Classes: First we should iterate through a folder of shapefiles that we want to batch clip. (Note: If you double click on it, it will run the model, not open it up for editing.) To open it up, right click on your new model and select Edit. Right click on it and select Rename and give it a name, in this case “BatchClip”. Close it.įind it in the list of models under your toolbox (it should be called “Model”). Right click on your new toolbox and select New > Model. In the browse tree that opens on the right, expand Toolboxes, right click on My Toolboxes, and select New > Toolbox and give it a name. Start ArcMap and open the catalog ( Windows > Catalog): It will iterate through shapefiles in a directory, and clip each one based on another shapefile’s area, and save the new clipped shapefiles to a different directory.įirst we should create a toolbox where we can save our models. This first example model will be used to process a batch clip. For the following examples, these files are extracted into a C:\Test\ directory. All the files needed to follow along and try out the examples are found in the. To illustrate how you would get started and to demonstrate some model builder functionality, let’s work through a couple of examples.
0 Comments
Leave a Reply. |