Description
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.
Syntax
sumlinelengthsinpolys(line, poly, field, [weight], [where], [update]);
| line | the input line feature source | |
| poly | the input polygon feature source | |
| field | the 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. |
Example
sumlinelengthsinpolys(line="C:\data\roads.shp", poly="C:\data\counties.shp", field="ROADLENGTH");
sumlinelengthsinpolys(line="C:\data\roots.shp", poly="C:\data\plots.shp", field="LINESUM", weight="WIDTH");