Split Line At Vertices (Data Management)

Summary

Creates a feature class containing lines that are generated by splitting input lines or polygon boundaries at their vertices.

Illustration

Split Lines At Vertices illustration

Usage

Syntax

SplitLine_management (in_features, out_feature_class)
ParameterExplanationData Type
in_features

The input features that can be line or polygon.

Feature Layer
out_feature_class

The output line feature class.

Feature Class

Code Sample

SplitLine Example 1 (Python window)

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

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.SplitLine_management("roads.shp", "c:/output/output.gdb/roads_split")
SplitLine Example 2 (stand-alone script)

The following stand-alone script is a simple example of how to apply the SplitLine function in a scripting environment.

# Name: SplitLine_Example2.py
# Description: Split a bus line feature at its vertices (bus stops)
#              and find a midpoint of each new line for further analysis.
# Author: ESRI
 
# import system modules 
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data"
 
# Set local variables
inFeatures = "buslines.shp"
outFeatureClass = "c:/output/output.gdb/buslines_segments"
midPtsFeatureClass = "c:/output/output.gdb/buslines_segments_midPts"

# Run SplitLine to get new lines, each of which is between two bus stops
arcpy.SplitLine_management(inFeatures, outFeatureClass)

# Execute FeatureVerticesToPoints to find a midpoint for every new line
arcpy.FeatureVerticesToPoints_management(outFeatureClass,
                                         midPtsFeatureClass, "MID")

# Comments: You may add attribute information, such as driving time,
#           to the midpoint feature class and display the attributes 
#           as an alternative label for each line between two bus stops.

Environments

Related Topics

Licensing Information

ArcView: No
ArcEditor: No
ArcInfo: Yes

10/27/2014