SUM LENGTH OF LINES IN POLYGONS

1032
4
05-23-2011 02:39 AM
pernilleparmer
New Contributor II
Hi.

I have over 10 000 polylines spread over 430 polygons. I would like to sum the length of all polylines within each polygon. Do anyone know how I can do this in ArcGIS 10?

I tried Hawth's Analysis Tools for ArcGIS, but it does not work with ArcGIS 10.

Any help would be great:)

Thanks.
0 Kudos
4 Replies
DanEvans
Occasional Contributor II
If any polylines cross over polygon boundaries, and assuming you want only the lengths of polyline within each polygon to be counted, you will need to first do an intersect of the polylines and polygons, with the output type set to LINE. This will 'slice' each pipe at the borders of the polygons allowing you to get the correct lengths.

Next you would do a spatial join, with the polygons as the target features and the polylines as the join features. Use the JOIN_ONE_TO_ONE join type. In the field map when you do the spatial join, look for the shape_length field of your polylines, right click and set the merge rule to 'sum'.

This will give you a new polygon feature class with the original polygons but with the attributes of the polylines joined onto the end. The shape_length field from the polylines will contain the sum of the lengths of the lines within that polygon.

Hope that helps

Dan
0 Kudos
pernilleparmer
New Contributor II
Hi Dan.

This worked great! Thanks=) It was so simple, still I used days trying to solve it...haha...


I have one more "problem" to solve, maybe you can help me?

I'm trying to find the sum of all polylines (same data) for all neighbor polygons of every polygon in my sample. That is: if polygon 1 is neighbor with polygon 2, 3 and 4, I like to find the sum of all polylines within the polygons 2,3 and 4. I hope to do this for all 430 polygons, so I need a tool to help me. Do you have a solution for this? If not, thanks for all you help anyway.


Pernille
0 Kudos
DanEvans
Occasional Contributor II
Hi Dan.

This worked great! Thanks=) It was so simple, still I used days trying to solve it...haha...


I have one more "problem" to solve, maybe you can help me?

I'm trying to find the sum of all polylines (same data) for all neighbor polygons of every polygon in my sample. That is: if polygon 1 is neighbor with polygon 2, 3 and 4, I like to find the sum of all polylines within the polygons 2,3 and 4. I hope to do this for all 430 polygons, so I need a tool to help me. Do you have a solution for this? If not, thanks for all you help anyway.


Pernille


Hi Pernille,

Glad I could help 🙂

This other problem is a bit more tricky... Maybe someone else has some ideas? I think you'd probably need to use ModelBuilder or write a script.

Dan
0 Kudos
pernilleparmer
New Contributor II
Ok=) I will try to make a new thread=)  Thanks again.

Pernille
0 Kudos