Unsplit Line (Data Management)

License Level:BasicStandardAdvanced

Summary

Merges lines that have coincident endpoints and, optionally, common attribute values.

Illustration

UnsplitLine illustration

Usage

Syntax

UnsplitLine_management (in_features, out_feature_class, {dissolve_field}, {statistics_fields})
ParameterExplanationData Type
in_features

The line features to be aggregrated.

Feature Layer
out_feature_class

The feature class to be created that will contain the aggregated features.

Feature Class
dissolve_field
[dissolve_field,...]
(Optional)

The field or fields on which to aggregate features.

The Add Field button, which is used only in ModelBuilder, allows you to add expected fields so you can complete the dialog box and continue to build your model.

Field
statistics_fields
[[field, {statistic_type}],...]
(Optional)

The fields and statistics with which to summarize attributes. Text attribute fields may be summarized using the statistics FIRST or LAST. Numeric attribute fields may be summarized using any statistic. Nulls are excluded from all statistical calculations.

  • FIRST—Finds the first record in the Input Features and uses its specified field value.
  • LAST—Finds the last record in the Input Features and uses its specified field value.
  • SUM—Adds the total value for the specified field.
  • MEAN—Calculates the average for the specified field.
  • MIN—Finds the smallest value for all records of the specified field.
  • MAX—Finds the largest value for all records of the specified field.
  • RANGE—Finds the range of values (MAX–MIN) for the specified field.
  • STD—Finds the standard deviation on values in the specified field.
  • COUNT—Finds the number of values included in statistical calculations. This counts each value except null values. To determine the number of null values in a field, use the COUNT statistic on the field in question, and a COUNT statistic on a different field which does not contain nulls (for example, the OID if present), then subtract the two values.
Value Table

Code Sample

UnsplitLine example (Python window)

The following Python window script demonstrates how to use the UnsplitLine tool in immediate mode.

import arcpy
from arcpy import env
env.workspace = "C:/data/Portland.gdb/Streets"
arcpy.UnsplitLine_management("streets", "C:/output/output.gdb/streets_unsplit",
                             ["STREETNAME", "PREFIX"])
UnsplitLine example 2 (stand-alone script)

The following stand-alone script demonstrates how to use the UnsplitLine tool.

# Name: UnsplitLine_Example2.py
# Description: Unsplit line features based on common attributes
 
# Import system modules
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data/Portland.gdb/Streets"
 
# Set local variables
inFeatures = "streets"
outFeatureClass = "C:/output/output.gdb/streets_unsplit"
dissolveFields = ["STREETNAME", "PREFIX"]
 
# Execute UnsplitLine using STREETNAME and PREFIX as Dissolve Fields
arcpy.UnsplitLine_management(inFeatures, outFeatureClass, dissolveFields)

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: No
ArcGIS for Desktop Standard: No
ArcGIS for Desktop Advanced: Yes
11/18/2013