Using Model builder in 9.3, how can I determine if a line is intersecting more than one polygon and if so what the lengths would be in each of those polygons? Thank you for any advice.

-best regards

-best regards

Using Model builder in 9.3, how can I determine if a line is intersecting more than one polygon and if so what the lengths would be in each of those polygons? Thank you for any advice.

-best regards

-best regards

- The intersect tool does most of the work for you (when you choose the line and polygon feature classes as input). It chops up your lines into intersecting segments and dissolves them based on the polygon that chopped it. If you're working with a geodatabase feature class, there will be a length field showing you how much of the line intersects which polygon. There will be a field with the line ID and a field with the polygon ID. Then you can use the Summary Statistics Tool to count the number of segments each line was chopped into (to get the number of polygons a line crossed).

For your model, you should just have the intersect tool feeding into the summary statistics tool. The intersect tool does most of the work for you (when you choose the line and polygon feature classes as input). It chops up your lines into intersecting segments and dissolves them based on the polygon that chopped it. If you're working with a geodatabase feature class, there will be a length field showing you how much of the line intersects which polygon. There will be a field with the line ID and a field with the polygon ID. Then you can use the Summary Statistics Tool to count the number of segments each line was chopped into (to get the number of polygons a line crossed).

For your model, you should just have the intersect tool feeding into the summary statistics tool.

Thanks Darren- I will try this. Thank you for the insight.- I have tried using the model builder, using "intersect" and "statistic summary", but I still did not manage to get what i want. How do I display the ID for the line and polygon to identify which intersected segments belong to which line. Aim of the activity: to determine the line distance within each polygon with different types.
- This is a possible solution
- Use "Intersect" to split the lines inside polygons
- Use "Make Feature Layer" to make a feature layer out of resultant layer
- Use "Select Layer By Location" to select lines inside polygons
- Use the "Feature Selection" Iterator to loop thru selected features
- Use "Get Field Value" tool to get the Shape_Length field value

I assume I just need to write a python script that can be added to my model?