Extend Line (Editing)

Summary

This tool extends line segments to the first intersecting feature within a specified distance. If no intersecting feature is within the specified distance, the line segment will not be extended. Tool use is intended for quality control tasks such as cleaning up topology errors in features that were digitized without having set proper snapping environments.

Illustration

Extend Line illustration

Usage

Syntax

ExtendLine_edit (in_features, {length}, {extend_to})
ParameterExplanationData Type
in_features

The line input features to be extended.

Feature Layer
length
(Optional)

The maximum distance a line segment can be extended to an intersecting feature.

Linear Unit
extend_to
(Optional)

Controls whether line segments can be extended to other extended line segments within the specified extend length.

  • EXTENSIONLine segments can be extended to other extended line segments as well as existing line features. This is the default.
  • FEATURELine segments can only be extended to existing line features.
Boolean

Code Sample

Extend Line Example (Python Window)

The following Python Window script demonstrates how to use the Extend Line tool.

import arcpy
arcpy.env.workspace = "C:/data"
arcpy.ExtendLine_edit("majorrds.shp", "15 Feet", "EXTENSION")
Extend Line Example (Stand-alone script)

Clean up street centerlines that were digitized without having set proper snapping environments

# Name: ExtendLine.py
# Description:  Clean up street centerlines that were digitized without 
#                      having set proper snapping environments
# Author: ESRI

# import system modules 
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data"

# Make backup copy of streets feature class, since modification with 
#  the Editing tools below is permanent
streets = "majorrds.shp"
streetsBackup = "C:/output/Output.gdb/streetsBackup"
arcpy.CopyFeatures_management(streets, streetsBackup)

# Trim street lines to clean up dangles
arcpy.TrimLine_edit(streets, "10 Feet", "KEEP_SHORT")

# Extend street lines to clean up dangles
arcpy.ExtendLine_edit(streets, "15 Feet", "EXTENSION")

Environments

Related Topics

Licensing Information

ArcView: No
ArcEditor: Yes
ArcInfo: Yes

4/27/2011