Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

Thanks for your help!

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
2  
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.