Label | Explanation | Data Type |
Input Features
| The line or polygon features that will be used to place 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 place points.
| String |
Distance
(Optional) | The interval from the beginning of the feature at which points will be placed. This parameter is active when the Point Placement parameter is set to By Distance. | 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. This parameter is active when the Point Placement parameter is set to By Percentage. | Double |
Include end points
(Optional) | Specifies whether additional points will be included at the start point and end point of the feature.
| Boolean |
Add accumulated distance and sequence fields (Optional) | Specifies whether the accumulated distance and sequence fields will be added to the output.
| Boolean |
Distance Field
(Optional) | A field from the input features that will be used to place output points. If the field is a numeric type, the field value will be used to place points at that interval. If the field is a string type, the field values must be organized as a semicolon-delimited string of distances. Points will be placed at those distances. Field values that are zero or negative vales will be ignored. Field values that exceed the length of a feature will be ignored for that feature. The distances will be in the linear units of the input's spatial reference. This parameter is active when the Point Placement parameter is set to By Distance Field. | Field |
Distance Method
(Optional) | Specifies the measurement method that will be used to create the points. This parameter is active when the Point Placement parameter is set to By Distance.
| String |
Summary
Creates point features along lines or polygons.
Usage
Points can be placed at a fixed interval for all features, or along features by percentage of the feature's length. Points can also be placed using a field from the input; the field can represent a fixed interval for each feature or specific distances for each feature.
Use the Point Placement parameter to specify the method that will be used to place the output points.
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.
If the Add accumulated distance and sequence fields parameter is checked, the following fields will be added:
- ORIG_LEN—The accumulated distance along the line from the start point of the line to the point. Distance values are added in the units of the Input Features value's spatial reference.
- ORIG_SEQ—The sequence number for each point in the order of the points created from each input line.
Parameters
arcpy.management.GeneratePointsAlongLines(Input_Features, Output_Feature_Class, Point_Placement, {Distance}, {Percentage}, {Include_End_Points}, {Add_Chainage_Fields}, {Distance_Field}, {Distance_Method})
Name | Explanation | Data Type |
Input_Features | The line or polygon features that will be used to place 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 place points.
| String |
Distance (Optional) | The interval from the beginning of the feature at which points will be placed. This parameter is active when the Point_Placement parameter is set to DISTANCE. | 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. This parameter is active when the Point_Placement parameter is set to PERCENTAGE. | Double |
Include_End_Points (Optional) | Specifies whether additional points will be included at the start point and end point of the feature.
| Boolean |
Add_Chainage_Fields (Optional) | Specifies whether the accumulated distance and sequence fields will be added to the output.
| Boolean |
Distance_Field (Optional) | A field from the input features that will be used to place output points. If the field is a numeric type, the field value will be used to place points at that interval. If the field is a string type, the field values must be organized as a semicolon-delimited string of distances. Points will be placed at those distances. Field values that are zero or negative vales will be ignored. Field values that exceed the length of a feature will be ignored for that feature. The distances will be in the linear units of the input's spatial reference. This parameter is active when the Point_Placement parameter is set to DISTANCE_FIELD. | Field |
Distance_Method (Optional) | Specifies the measurement method that will be used to create the points. This parameter is active when the Point_Placement parameter is set to DISTANCE.
| String |
Code sample
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.management.GeneratePointsAlongLines('rivers', 'distance_intervals', 'DISTANCE', Distance='500 meters')
arcpy.management.GeneratePointsAlongLines('rivers', 'percentage_intervals', 'PERCENTAGE', Percentage=10)
arcpy.management.GeneratePointsAlongLines('rivers', 'distance_by_field', 'DISTANCE_FIELD', Distance_Field='distance')
The following stand-alone script demonstrates how to use the GeneratePointsAlongLines function.
# 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'
# Run GeneratePointsAlongLines by distance
arcpy.management.GeneratePointsAlongLines(in_features, out_fc_1, 'DISTANCE',
Distance='500 meters')
# Run GeneratePointsAlongLines by percentage
arcpy.management.GeneratePointsAlongLines(in_features, out_fc_2, 'PERCENTAGE',
Percentage=10,
Include_End_Points='END_POINTS')
# Run GeneratePointsAlongLines by distance field
arcpy.management.GeneratePointsAlongLines(in_features, out_fc_2, 'DISTANCE_FIELD',
Distance_Field='distance')