clip model builder

2842
8
10-06-2011 12:30 AM
PmssS
by
New Contributor II
Hello,

This is continuation of a post from Network analyst that now enter in model builder stage...
A simple question. (or maybe not)
I want to clip the service areas with the limit of the correspondent district... using the model builder.

The layer districts is polygon feature class that includes an attribute Name. I would like to use the each feature of this layer to clip only the correpondent service area of the hospital of its area...

I found an example of this in the internet... but for 9.2, and I am using the 10, and for the previous version its sugested to use the "a series of values" something that I don't have available in the "districts" layer...

I really need help on this
0 Kudos
8 Replies
SebastianSantibanez
New Contributor
Check on "Iterate feature selection"  you could even isolate the name in the table and use it as an in-line variable.
0 Kudos
PmssS
by
New Contributor II
Thank you,

but I never worked with interactors before.

If I put my layer as an input for this interactor and I select the field name frm the input layer, the result layer is the same name of the input layer plus the field name (this was automatic); and the value is 1.

sorry but how should I use this to clip the other layer (service area)???
I have a field in common in this two features
0 Kudos
SebastianSantibanez
New Contributor
This should do

make sure that "NAME" does not contain invalid characters.

The iterator selects each feature in the feature class and keeps the value (of the field that you specify, let say the name of the district in your case) under the variable "Name".
Then the Clip tool uses the output of the iterator (District_NAME) as the cookie cutter, and the feature class you want to clip (your service areas).
Finally the model saves each clip using the variable "Name" as the name of the new feature class.

cheers.
0 Kudos
PmssS
by
New Contributor II
thank you, this worked. However I have in the different districts "clipped parts" of the service areas (SAs) of other districts (Ds)...

I was wondering if it is possbile to do the following, after the clip:

Both Feature classes have an attribute that is the "name" field (used to clip). if  I could  use the select by attribute (ex: "District_1" from the SAs); from previous selection - select by location (Ex: inside the "District_1" from the Ds); switch selection; delete. And then return to step one to do the same to the others?

Any how it was already a very good help.
Thanks
Pedro
0 Kudos
SebastianSantibanez
New Contributor
Pedro,
If I am understanding correctly what you are trying to do, I would put a SELECT (Analysis) before the name.  After the iteration you get the name of each District (which matches a field in the areas to clip) so you could use "Name" as part of the SQL expression.  After the "SELECT" the clipping will be applied just to the elements selected (e.g.  for a district called "distrito1" you would clip the service areas selected as "distrito1".

Good luck and let me know how it goes.
0 Kudos
PmssS
by
New Contributor II
Sebastien
Based on your scheme the select analysis should be applied after the interate feature selection and before clip correct?
0 Kudos
SebastianSantibanez
New Contributor
Correct.   I just realized how poorly written my answer was. Sorry about that.
Regards,
0 Kudos
PmssS
by
New Contributor II
It does not work.
mostly because (as far as I understood) there is a need of having two interactors.
one to go through the "service area" feature classes, and other to through the "Districts" Feature class field.

What I was thinking is (please someone tell me if this is impossible):

Create the Service Areas tool - this tool would do the Service areas feature class for all the 25 features, creating a feature class per feature. (this is done)

Create the Districts tool - This tool creates a new feature class per feature present in the Districts. this is done

(now I have a folder with 25 "service areas" and another with 25 "districts")

my next step would be associate them by the common field "name" and clip the Service area based on the correspondent district.

For the last point I tried to  include the two tools created above and  the interact them based on the common name... and clip... but I don't know how to run a interaction associating fields or Feature classes... if I do the batch of the clip tool manually I can go selecting with feature class I want to be be cliped by which feature class (and it is this that could be good, if it would be possible to associate automatically).

Help anyone?
0 Kudos