2

I have two geodatabases: one with line layers (pipelines), and one with polygon layers (stripmap). I would like to use model builder to take the first line layer and intersect it with the first polygon layer. Then take the second line layer and intersect it with the second polygon layer, and so on. In my testing each geodatabase has 3 layers.

I have used two iterators to do this, by creating a submodel (see image), but when I run it, the first two output shapeiles do not contain any features. The final layer works correctly. I have run intersect independently on the first line layer and first polygon layer and it does generate a shapefile containing the overlaps.

I have read through similar questions about nesting iterators, but can't seem to find the answer.

enter image description here

  • 1
    Since they are nested, the outer model will run 1 loop and then enter the inner model, which will run 3 times. Back to the outer model for the 2nd loop and then into the inner model for 3 times again. – Paul Feb 23 '17 at 18:23
  • 1
    From your screen shot it looks like the datasets are following standard naming ending with _X, why not use a FOR iterator to build dataset names, so 1 iterator and no sub-modelling? – Hornbydd Feb 23 '17 at 20:45
  • Thanks both for your comments. Paul - that makes sense why it is not giving me the output that I want. I will attempt to build datasets as suggested. – SR_111 Feb 24 '17 at 10:22
1

I had a similar model builder problem as you, but I ended up getting it to work in python since I didn't know what else to try in model builder.

For details on my problem and the one for loop solution that @Midavalo provided using arcpy.da.Walk(): go here

Hopefully that can give you some other options to try if you need them.

For example maybe something like:

for dirpath, dirnames, filenames in arcpy.da.Walk(workspace, datatype='FeatureClass', type=['Polygon', 'Polyline']):

Then see if you can use filenames in arcpy.Intersect_analysis()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.