Collapse Dual Lines To Centerline (Cartography)

Summary

Derives centerlines from dual-line (or double-line) features, such as road casings, based on specified width tolerances.

Illustration

Creating centerlines

Usage

Syntax

CollapseDualLinesToCenterline_cartography (in_features, out_feature_class, maximum_width, {minimum_width})
ParameterExplanationData Type
in_features

The input dual-line features, such as road casings, from which centerlines are derived.

Feature Layer
out_feature_class

The output feature class to be created.

Feature Class
maximum_width

Sets the maximum width of the dual-line features to derive centerline. A value must be specified, and it must be greater than zero. You can choose a preferred unit; the default is the feature unit.

Linear unit
minimum_width
(Optional)

Sets the minimum width of the dual-line features to derive centerline. The minimum width must be greater than or equal to zero, and it must be less than the maximum width. The default value is zero. You can specify a preferred unit; the default is the feature unit.

Linear unit

Code Sample

CollapseDualLinesToCenterline Example (Python Window)

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

import arcpy
from arcpy import env
import arcpy.cartography as CA
env.workspace = "C:/data"
CA.CollapseDualLinesToCenterline("dual_line_roads.shp", "C:/output/output.gdb/road_centerlines", 50)
CollapseDualLinesToCenterline Example 2 (stand-alone script)

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

# Name: CollapseDualLinesToCenterline_Example2.py
# Description: Create road centerlines and find buildings within a given distance
# Author: ESRI
 
# Import system modules
import arcpy
from arcpy import env
import arcpy.cartography as CA
import arcpy.management as DM
import arcpy.analysis as AN
 
# Set environment settings
env.workspace = "C:/data/Portland.gdb"
 
# Set local variables
inRoadCasingsFeatures = "road_casings"
inHouseFeatures = "houses"

centerlineFeatures = "C:/data/PortlandOutput.gdb/road_centerlines"
bufferFeatures = "C:/data/PortlandOutput.gdb/road_buffers"

# Create centerlines for road casings.
CA.CollapseDualLinesToCenterline(inRoadCasingsFeatures, centerlineFeatures, 80)
 
# Create buffers 100 units from around centerlines.
AN.Buffer(centerlineFeatures, bufferFeatures, 100)

# Select houses by buffers.
DM.SelectLayerByLocation(inHouseFeatures, "intersect", bufferFeatures, 100)

 

Environments

Related Topics

Licensing Information

ArcView: No
ArcEditor: No
ArcInfo: Yes

11/11/2011