How to determine length of intersecting line?

862
9
04-06-2011 12:38 PM
JoshV
by
Regular Contributor
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
0 Kudos
9 Replies
JoshV
by
Regular Contributor
Also good to note that the Line that intersects the two polygons has the same Unique value in the API column as the two polygons.  So now that I know how to isolate which polygons and line, how can I determine length of the line in each of those polygons and return those values?

I assume I just need to write a python script that can be added to my model?
0 Kudos
DarrenWiens2
MVP Honored Contributor
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.
0 Kudos
JoshV
by
Regular Contributor
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.
0 Kudos
Puay_PingKoh
Emerging Contributor
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.
0 Kudos
SolomonPulapkura
Frequent Contributor
This is a possible solution


  1. Use "Intersect" to split the lines inside polygons

  2. Use "Make Feature Layer" to make a feature layer out of resultant layer

  3. Use "Select Layer By Location" to select lines inside polygons

  4. Use the "Feature Selection" Iterator to loop thru selected features

  5. Use "Get Field Value" tool to get the Shape_Length field value

0 Kudos
Puay_PingKoh
Emerging Contributor
1) I cannot find the "feature selection" iterator and "get field value" from the model builder
2) May I know how to save the model builder and reopen it.
0 Kudos
SolomonPulapkura
Frequent Contributor
Which ArcGIS version are you using? The iterator and get field value are model only tools available at ArcGIS v10. You will find them in the Insert Menu in model builder.
0 Kudos
Puay_PingKoh
Emerging Contributor
Yes. Have found them. But the model builder keeps running non-stop.
And how do I save the model.  I save it under MyTools/modeliii. But each time add data or tool, the icon it shows is only Modeliii, where are all the rectangles? When i double clicks it, it says "this tool has no parameters".
0 Kudos
SolomonPulapkura
Frequent Contributor
You have to right click on the model > Edit to open the model to see the process representations. If the model keeps running it is probably looping endlessly. Something is not wired right. It would be hard to tell without knowing what your model looks like.
0 Kudos