Feature To Line (Data Management)

Summary

Creates a feature class containing lines generated by converting polygon boundaries to lines, or splitting line, polygon, or both features at their intersections.

Illustration

Feature To Line illustration

Usage

Syntax

FeatureToLine_management (in_features, out_feature_class, {cluster_tolerance}, {attributes})
ParameterExplanationData Type
in_features
[in_features,...]

The input features that can be line or polygon, or both.

Feature Layer
out_feature_class

The output line feature class.

Feature Class
cluster_tolerance
(Optional)

The minimum distance separating all feature coordinates, and the distance a coordinate can move in X, Y, or both during spatial computation. The default XY tolerance is set to 0.001 meter or its equivalent in feature units.

Linear unit
attributes
(Optional)

Specifies whether to preserve or omit the input attributes in the output feature class.

  • ATTRIBUTESPreserves the input attributes in the output features. This is the default.
  • NO_ATTRIBUTESOmits the input attributes in the output features.
Boolean

Code Sample

FeatureToLine Example 1 (Python window)

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

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.FeatureToLine_management(["majorrds.shp", "habitat_analysis.gdb/futrds"],
                               "c:/output/output.gdb/allroads",
                               "0.001 Meters", "ATTRIBUTES")
FeatureToLine Example 2 (stand-alone script)

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

# Name: FeatureToLine_Example2.py
# Description: Use FeatureToLine function to combine features from two 
#                  street feature classes into a single feature class,
#                  then determine an area of impact around all streets
#                  by buffering
# Author: ESRI

# import system modules 
import arcpy
from arcpy import env

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

#  Set local variables
oldStreets = "majorrds.shp"
newStreets = "habitat_analysis.gdb/futrds"
uptodateStreets = "c:/output/output.gdb/allroads"

# Use FeatureToLine function to combine features into single feature class
arcpy.FeatureToLine_management([oldStreets, newStreets], uptodateStreets,
                               "0.001 Meters", "ATTRIBUTES")

# Use Buffer function to determine area of impact around streets
roadsBuffer = "c:/output/output.gdb/buffer_output"
arcpy.Buffer_analysis(uptodateStreets, roadsBuffer, "50 Feet",
                      "FULL", "ROUND", "ALL")

Environments

Related Topics

Licensing Information

ArcView: No
ArcEditor: No
ArcInfo: Yes

10/27/2014