[GIS] Model builder: select feature based on attribute, iterator

iteratormodelbuilderselect-by-attribute

This is the data I have:
shapefile with polygons
shapefile with line features

What I eventually want:
line features attributes joined to the polygons that they fall in.
I need to clip each polygon with the lines separately.

These are the steps I want to do:

  • select polygon from a shapefile based on a name
  • use this selected polygon to clip several line features
  • then use spatial join to join these clipped lines to the shapefile with all the polygons based on the location
  • apply summary statistics to get lines length summed per polygon

I can do this for one polygon..the question I have is how can I tell the model builder that has to do this whole process for each polygon. So I guess I have to insert an iterator in front of the select by attribute tool..but I don't really understand how.
Also, it would be great to get the output in one summary statistic and not in hundred different ones…
is that possible?

thanks so much
sandra

Best Answer

The attached model intersects the lines and polygons and creates a multipart featureclass (i.e. all of the line segments contained within a polygon combine). Make sure to select the correct dissolve feature in the Dissolve tool and select the "Create multipart features" checkbox. Also, make sure the output is located in a geodatabase because the line lengths per polygon will be automatically calculated for you.

enter image description here enter image description here

Related Question