Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a layer with line segments and a layer of polygons (in this case, buffers around points). I need to create a new field for each polygon that contains the total length of all line segments contained within that polygon, including portions of the line segments with the polygon that straddle the borders.

share|improve this question
Which version of ArcGIS are you using, and are you looking for a point and click solution or a programmatic solution? – blah238 Feb 18 '13 at 21:01
I'm using ArcGIS 10. Either programmatic or point-and-click – Nicholas Tulach Feb 18 '13 at 21:04

A slight modification of the answer linked in the comments would be to do a Summary Statistics to get the SUM of the Shape.Length field of the intersect feature class, using the FID field of the polygons a case field, and then Join Field that back to the polygon feature class.

In the ArcMap 10.1 Python window, these commands worked for me:

intersection = arcpy.Intersect_analysis("RoadCenterline;SchoolTaxDistrict", r"in_memory\intersect")
arcpy.CalculateField_management(intersection, "SHAPE_Leng", "!shape.length!", "PYTHON_9.3")
summary = arcpy.Statistics_analysis(intersection, r"in_memory\statistics", "SHAPE_Leng SUM", "FID_SchoolTaxDistrict")
arcpy.JoinField_management("SchoolTaxDistrict", "FID", summary, "FID_SchoolTaxDistrict")
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.