Summary
Generates single-line road features in place of matched pairs of divided road lanes.
Matched pairs of roads or lanes are merged if they are the same road class, trend generally parallel to one another, and are within the merge distance apart. The road class is specified by the Merge Field parameter. All nonmerged roads from the input collection are copied to the output feature class.
Illustration
Usage
The output feature class contains single line features representing merged roads and copies of all unmerged input features. Merged features will inherit the attribution from one of the two input features.
Input features with Merge Field parameter values equal to zero are "locked" and will not be merged, even if adjacent features are not locked.
The optional Output Displacement Feature Class parameter creates a feature class of polygons that indicates the amount and direction of displacement that took place. This feature class can be used for visual inspection, for spatial querying, or as an input to the Propagate Displacement tool.
If the input is a feature layer drawn with a representation, any shape overrides associated with the representation will be used as the input geometry considered by this tool, and the corresponding geometry in the Shape field will be ignored. The output feature class will contain the feature class representation, but all geometry will be stored in the output Shape field, not as representation shape overrides.
Processing a large road dataset may exceed memory limitations. In this case, consider processing input data by partition by identifying a relevant polygon feature class in the Partition Features environment setting. Portions of the data, defined by partition boundaries, will be processed sequentially. The resulting feature classes will be seamless and consistent at partition edges. See How Merge Divided Roads works for more information about running this tool with partitioning.
Syntax
MergeDividedRoads_cartography (in_features, merge_field, merge_distance, out_features, {out_displacement_features})
Parameter | Explanation | Data Type |
in_features | The input linear road features that contain matched pairs of divided road lanes that should be merged together to a single output line feature. | Feature Layer |
merge_field | The field that contains road classification information. Only parallel, proximate roads of equal classification will be merged. A value of 0 (zero) locks a feature to prevent it from participating in merging. | Field |
merge_distance | The minimum distance apart, in the specified units, for equal-class, relatively parallel road features to be merged. This distance must be greater than zero. If the units are in pt, mm, cm, or in, the value is considered as page units and takes into account the reference scale. | Linear unit |
out_features | The output feature class containing single-line merged road features and all unmerged road features. | Feature Class |
out_displacement_features (Optional) | The output polygon features containing the degree and direction of road displacement, to be used by the Propagate Displacement tool to preserve spatial relationships. | Feature Class |
Code sample
MergeDividedRoads tool example (Python Window)
The following Python window script demonstrates how to use the MergeDividedRoads tool in immediate mode.
import arcpy
from arcpy import env
env.workspace = "C:/data"
env.referenceScale = "50000"
arcpy.MergeDividedRoads_cartography("roads.lyr", "level", "25 meters",
"C:/data/cartography.gdb/transportation/merged_roads",
"C:/data/cartography.gdb/transportation/displacement")
MergeDividedRoads tool example (stand-alone Python script)
This stand-alone script shows an example of using the MergeDividedRoads tool.
# Name: MergeDividedRoads_standalone_script.py
# Description: Resolves symbology conflicts between roads within a specified distance of each other by snapping them together
# Author: ESRI
# Import system modules
import arcpy
from arcpy import env
# Set environment settings
env.workspace = "C:/data"
env.referenceScale = "50000"
# Set local variables
in_features = "roads.lyr"
merge_field = "level"
collapse_distance = "25 meters"
out_features = "C:/data/cartography.gdb/transportation/merged_roads"
out_displacement_features = "C:/data/cartography.gdb/transportation/displacement"
# Execute Merge Divided Roads
arcpy.MergeDividedRoads_cartography(in_features, merge_field, collapse_distance, out_features, out_displacement_features)
Environments
Licensing information
- ArcGIS Desktop Basic: No
- ArcGIS Desktop Standard: No
- ArcGIS Desktop Advanced: Yes
Related topics
- An overview of the Generalization toolset
- Understanding conflict resolution and generalization
- Automating conflict resolution and generalization workflows with geoprocessing
- How Merge Divided Roads works
- Resolve Road Conflicts
- Collapse Road Detail
- Propagate Displacement
- Create Cartographic Partitions
- Generalizing large datasets using partitions