Generate Points Along Lines (Data Management)

Summary

Creates point features along lines or polygons at fixed intervals or by percentage of a feature's length.

Usage

  • The attributes of the input features will be maintained in the output feature class. A new field, ORIG_FID, will be added to the output feature class and set to the input feature IDs.

Parameters

LabelExplanationData Type
Input Features

The line or polygon features to be converted into points.

Feature Layer
Output Feature Class

The point feature class that will be created from the input features.

Feature Class
Point Placement

Specifies the method that will be used to create points.

  • By percentage — The Percentage parameter value will be used to place points along the features by percentage.
  • By distance — The Distance parameter value will be used to place points at fixed distances along the features. This is the default.
String
Distance
(Optional)

The interval from the beginning of the feature at which points will be placed.

Linear Unit
Percentage
(Optional)

The percentage from the beginning of the feature at which points will be placed. For example, if a percentage of 40 is used, points will be placed at 40 percent and 80 percent of the feature's distance.

Double
Include End Points
(Optional)

Specifies whether additional points will be included at the start point and end point of the feature.

  • Checked—Additional points will be included at the start point and end point of the feature.
  • Unchecked—No additional points will be included at the start point and end point of the feature. This is the default.
Boolean

arcpy.management.GeneratePointsAlongLines(Input_Features, Output_Feature_Class, Point_Placement, {Distance}, {Percentage}, {Include_End_Points})
NameExplanationData Type
Input_Features

The line or polygon features to be converted into points.

Feature Layer
Output_Feature_Class

The point feature class that will be created from the input features.

Feature Class
Point_Placement

Specifies the method that will be used to create points.

  • PERCENTAGEThe Percentage parameter value will be used to place points along the features by percentage.
  • DISTANCEThe Distance parameter value will be used to place points at fixed distances along the features. This is the default.
String
Distance
(Optional)

The interval from the beginning of the feature at which points will be placed.

Linear Unit
Percentage
(Optional)

The percentage from the beginning of the feature at which points will be placed. For example, if a percentage of 40 is used, points will be placed at 40 percent and 80 percent of the feature's distance.

Double
Include_End_Points
(Optional)

Specifies whether additional points will be included at the start point and end point of the feature.

  • END_POINTSAdditional points will be included at the start point and end point of the feature.
  • NO_END_POINTSNo additional points will be included at the start point and end point of the feature. This is the default.
Boolean

Code sample

GeneratePointsAlongLines example 1 (Python window)

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

import arcpy
arcpy.env.workspace = 'C:/data/base.gdb'
arcpy.GeneratePointsAlongLines_management('rivers', 'distance_intervals', 'DISTANCE', Distance='500 meters')
arcpy.GeneratePointsAlongLines_management('rivers', 'percentage_intervals', 'PERCENTAGE', Percentage=10)
GeneratePointsAlongLines example 2 (stand-alone script)

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

# Description: Convert point features to line features

import arcpy

# Set environment settings
arcpy.env.workspace = 'C:/data/base.gdb'

# Set local variables
in_features = 'rivers'
out_fc_1 = 'distance_intervals'
out_fc_2 = 'percentage_intervals'

# Execute GeneratePointsAlongLines by distance
arcpy.GeneratePointsAlongLines_management(in_features, out_fc_1, 'DISTANCE',
                                          Distance='500 meters')

# Execute GeneratePointsAlongLines by percentage
arcpy.GeneratePointsAlongLines_management(in_features, out_fc_2, 'PERCENTAGE',
                                          Percentage=10,
                                          Include_End_Points='END_POINTS')

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics