Skip To Content

Points To Line


Creates line features from points.


Point to line example


  • Line feature will not be written to the output if they are made up of less than two vertices.


PointsToLine_management (Input_Features, Output_Feature_Class, {Line_Field}, {Sort_Field}, {Close_Line})
ParameterExplanationData Type

The point features to be converted into lines.

Feature Layer

The line feature class which will be created from the input points.

Feature Class

Each feature in the output will be based on unique values in the Line Field.


By default, points used to create each output line feature will be used in the order they are found. If a different order is desired, specify a Sort Field.


Specifies whether output line features should be closed.

  • CLOSEAn extra vertex will be added to ensure that every output line feature's end point will match up with its start point. Then polygons can be generated from the line feature class using the Feature To Polygon tool.
  • NO_CLOSENo extra vertices will be added to close an output line feature. This is the default.

Code sample

PointsToLine Example (Python Window)

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

import arcpy
arcpy.env.workspace = "C:/data"
                              "ROUTE1", "MEASURE")
PointsToLine Example 2 (stand-alone script)

The following stand-alone script demonstrates how to use PointsToLine.

# Name:
# Description: Convert point features into line features

# Import system modules
import arcpy

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

# Set local variables
inFeatures = "calibration_points.shp"
outFeatures = "C:/output/output.gdb/out_lines"
lineField = "ROUTE1"
sortField = "MEASURE"

# Execute PointsToLine 
arcpy.PointsToLine_management(inFeatures, outFeatures, lineField, sortField)

Licensing information

  • ArcGIS Desktop Basic: Yes
  • ArcGIS Desktop Standard: Yes
  • ArcGIS Desktop Advanced: Yes

Related topics