Unsplit Line (Data Management)

Summary

Aggregates line features that have coincident endpoints and, optionally, common attribute values.

Illustration

Unsplit Line tool illustration

Usage

  • The attributes of the features that are aggregated by this tool can be summarized or described using a variety of statistics. The statistic used to summarize attributes is added to the output feature class as a single field with the naming standard of statistic type + underscore + input field name. For example, if the SUM statistic type is used on a field named POP, the output will include a field named SUM_POP.

  • The availability of physical memory may limit the amount (and complexity) of input features that can be processed and aggregated into a single output line feature. This limitation may cause an error to occur, as the unsplit process may require more memory than is available. To prevent this, Unsplit Line may divide and process the input features using an adaptive tiling algorithm. To determine the features that have been tiled, run the Frequency tool on the result of this tool, specifying the same fields used in the Dissolve Field(s) parameter for the Frequency Field(s) parameter. Any record with a frequency value of 2 has been tiled. Tile boundaries are preserved in the output features to prevent the creation of features that are too large to be used by ArcGIS.

    Caution:

    Running Unsplit Line on the output of a previous unsplit process will rarely reduce the number of features in the output when the original processing divided and processed the inputs using adaptive tiling. The maximum size of any output feature is determined by the amount of available memory at run time; output containing tiles is an indicator that aggregating further with the available resources will cause an out-of-memory situation or result in a feature that is unusable. Additionally, running the Unsplit Line tool a second time on output that was created this way may result in slow performance for little to no gain and may cause an unexpected failure.

  • Null values are excluded from all statistical calculations. For example, the average of 10, 5, and a null is 7.5 ((10 + 5) / 2). The count returns the number of values included in the statistical calculation, which in this case is 2.

Parameters

LabelExplanationData Type
Input Features

The line features to be aggregated.

Feature Layer
Output Feature Class

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

Feature Class
Dissolve Fields
(Optional)

The field or fields on which features will be aggregated. If no fields are specified, the tool will dissolve all features together.

Field
Statistics Fields
(Optional)

Specifies the field or fields containing the attribute values that will be used to calculate the specified statistic. Multiple statistic and field combinations can be specified. Null values are excluded from all calculations.

By default, the tool will not calculate any statistics.

Numeric attribute fields can be summarized using any statistic. Text attribute fields can be summarized using minimum, maximum, count, first, last, unique, concatenate, and mode statistics.

  • Sum—The values for the specified field will be added together.
  • Mean—The average for the specified field will be calculated.
  • Minimum—The smallest value of the specified field will be identified.
  • Maximum—The largest value of the specified field will be identified.
  • Range—The range of values (maximum minus minimum) for the specified field will be calculated.
  • Standard deviation—The standard deviation of values for the specified field will be calculated.
  • Count—The number of values in the specified field will be identified.
  • First—The specified field value of the first record in the input will be used.
  • Last—The specified field value of the last record in the input will be used.
  • Median—The median of the specified field will be calculated.
  • Variance—The variance of the specified field will be calculated.
  • Unique—The number of unique values of the specified field will be counted.
  • Concatenate—The values for the specified field will be concatenated. The values can be separated using the Concatenation Separator parameter.
  • Mode—The mode (the most common value) for the specified field will be identified. If more than one value is equally common, the lowest value will be returned.
Value Table
Concatenation Separator
(Optional)

A character or characters that will be used to concatenate values when the Concatenation option is used for the Statistics Fields parameter. By default, the tool will concatenate values without a separator.

String

arcpy.management.UnsplitLine(in_features, out_feature_class, {dissolve_field}, {statistics_fields}, {concatenation_separator})
NameExplanationData Type
in_features

The line features to be aggregated.

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 features will be aggregated. If no fields are specified, the tool will dissolve all features together.

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

Specifies the field or fields containing the attribute values that will be used to calculate the specified statistic. Multiple statistic and field combinations can be specified. Null values are excluded from all calculations.

By default, the tool will not calculate any statistics.

Numeric attribute fields can be summarized using any statistic. Text attribute fields can be summarized using minimum, maximum, count, first, last, unique, concatenate, and mode statistics.

  • SUM—The values for the specified field will be added together.
  • MEAN—The average for the specified field will be calculated.
  • MIN—The smallest value of the specified field will be identified.
  • MAX—The largest value of the specified field will be identified.
  • RANGE—The range of values (maximum minus minimum) for the specified field will be calculated.
  • STD—The standard deviation of values for the specified field will be calculated.
  • COUNT—The number of values in the specified field will be identified.
  • FIRST—The specified field value of the first record in the input will be used.
  • LAST—The specified field value of the last record in the input will be used.
  • MEDIAN—The median of the specified field will be calculated.
  • VARIANCE—The variance of the specified field will be calculated.
  • UNIQUE—The number of unique values of the specified field will be counted.
  • CONCATENATE—The values for the specified field will be concatenated. The values can be separated using the concatenation_separator parameter.
  • MODE—The mode (the most common value) for the specified field will be identified. If more than one value is equally common, the lowest value will be returned.
Value Table
concatenation_separator
(Optional)

A character or characters that will be used to concatenate values when the CONCATENATION option is used for the statistics_fields parameter. By default, the tool will concatenate values without a separator.

String

Code sample

UnsplitLine example (Python window)

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

import arcpy
arcpy.env.workspace = "C:/data/Portland.gdb/Streets"
arcpy.management.UnsplitLine("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 function.

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

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

Related topics