SUM LENGTH OF LINES IN POLYGONS

24264
7
05-23-2011 03:07 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
7 Replies
pernilleparmer
New Contributor II
I got the solution from Dan:

"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 "
ThierryH
New Contributor

Hi,

I have some polygons with some polylines in it (same as above). The polylines divided into three categories (for example: urban street, highways, freeways) I want to understand the sum of each polyline in each of the polygons.

I mean for example I want to know the total length of the urban streets in Polygon A.

I find a boring way for this,First spiliting the roads for each polygone then selecting by attribute, clicking on the attribute table and in the statistics I can see the sum of the selected features. But I am looking for a faster way. I also tried the Spatial Join but this option only gave me the total length of the all types of road in each polygon. I want the total length of each polyline seperately. Something just like this:

sum of urban roads in polygone A: 17526 m

sum of highways in polygone A: 18945 m

sume of freeways in polygone B: 8900 m

etc

Does anyone know the fastest way to find these numbers?

0 Kudos
DanPatterson_Retired
MVP Emeritus

Summarize Within—Help | ArcGIS Desktop 

might be in arcmap, but it is in pro for sure

JosephNaddeo1
New Contributor

Does anyone know how to do this without Summarize Within tool? My ArcMap 10.6.1 does not have this tool. I would like to summarize road lengths by road type within a county.

Thanks in advance!

0 Kudos
WilliamMeyer
New Contributor II

CLASSIFICATION: UNCLASSIFIED

Do you know Python? I so you can use the Python API and write a script to filter your table on road lengths and road types and then use the Pandas and Seaborn libraries to make a histogram. I have also seen a new little set of libraries called plot.ly but I haven't used them yet. If you don't know Phython, I would suggest exporting your table to a CSV file and importing it into Excel and use Excel's plotting tools to make your histogram.

I hope this helps

0 Kudos
JohnYoung5
New Contributor

Easy done in arc desktop.  Use Tabulate Intersection (Analysis Tool Box > Statistics).  This will create a table of the sum of the line within the polygon feature.  The table will hold the polygon id.  Join this table back to the original polgyon layer 

0 Kudos
JohnYoung5
New Contributor

Easy done in arc desktop.  Use Tabulate Intersection (Analysis Tool Box > Statistics).  This will create a table of the sum of the line within the polygon feature.  The table will hold the polygon id.  Join this table back to the original polgyon layer 

0 Kudos