Select to view content in your preferred language

Model builder and Clip function

5931
1
01-08-2015 01:56 PM
JormaHuttunen
New Contributor

I have a model builder / clip function questions, and I think the best way to describe my question, and find a solution how to create a functional model is this:

 

Say that I have a (polygon) layer called USA.shp, and one of attributes in the attribute table is "State_ID". Every State_ID would be unique number from 01, 02, 03...50.

 

Then I have three vector layers as follows: 1) a nationwide (Polygon) layer called "Lakes" with related attribute table which represent all the lakes in USA, 2) a nationwide (Point) layer called "Cities" with related attribute table which represent all the cities in USA, and 3) a nationwide (Lines) layer called "Highways" with related attribute table which represent all the highways in USA.

 

Basically, I would like to create a model that, after it's run it course, I would have 50 individual folders that contains all my points, lines and polygons based on their "State_ID".

 

This is just a fictional question but I wanted to keep it simple. My real task is somewhat similar but it requires to clip (and create) multiple individual folders with vector data based on just that region, or "State_ID".

 

How would you start building the model? Do you create first 50 individual folders where the output will go? What would be your input folders and how it can be clipped to 50 different shape-files?

 

Please feel free to change the scenario, or change the attribute table as needed.

0 Kudos
1 Reply
MikeCusi
Occasional Contributor II

I would start with creating an iterator for the field value (in this case State_ID) that is then used to create a selection. The selection is then  made into a temporary feature layer. This will be your clip feature. Use the clip tool to clip the features you want making the Input feature a model parameter. Save the outputs to a file geodatabase while keeping an eye on your naming convention. You can then just save the model and run it as a batch (which is what I would do as I am not very good with model builder) or make another model that will use the first model's output as the clip feature with another feature class iterator that will go through the 3 input features you want. (unfortunately, model builder allows only 1 iterator per model, which is why you need to make 2 models). Someone else might be able to give you a bit more help on this second path.

0 Kudos