Geospatial Modelling Environment

sumlinelengthsinpolys (Sum Line Lengths In Polygons)

Sums the lengths of the portions of all lines that intersect each polygon


This tool sums the lengths of the portions of all lines in the specified line data source that intersect each polygon in the polygon data source, and writes the result to a new field in the polygon attribute table. You may optionally also specify a weight field in the line attribute table that is used to weight the line lengths: the length of the line intersecting the polygon is multiplied by the weight value.

This can be a computationally intensive program to run with large datasets. In such cases ensuring that your input data sources have a spatial index built will improve processing efficiency.


sumlinelengthsinpolys(line, poly, field, [weight], [where], [update]);

linethe input line feature source
polythe input polygon feature source
fieldthe output field name
[weight]the name of the field in the line attribute table to weight the line lengths by (default=no weight field)
[where]the selection statement that will be applied to the polygon feature data source to identify a subset of polygons to process (see full Help documentation for further details)
[update](TRUE/FALSE) if TRUE and you specify an existing field, the existing field will be updated rather than generating an error message (default=FALSE); warning: this option will result in overwriting of existing data and is therefore potentially dangerous.


sumlinelengthsinpolys(line=”C:dataroads.shp”, poly=”C:datacounties.shp”, field=”ROADLENGTH”);

sumlinelengthsinpolys(line=”C:dataroots.shp”, poly=”C:dataplots.shp”, field=”LINESUM”, weight=”WIDTH”);


Please consider making a purchase to support the continued development of these tools  Read more...

Tips on how to use this interface efficiently 


Open Source GIS

Copyright © 2001-2014 Hawthorne L. Beyer, Ph.D., Spatial Ecology LLC    Connect on LinkedIn