Random Points On Polylines

Running programmatically

Generates random points located on the polylines of the input polyline dataset. The number of points per polyline can be constant or different for each polyline - based on the values in a numeric field of the input polyline feature class."



Note: Be careful with assigning the number of points per polyline. The function will try to create N unique points on the polyline and if the number of points allocated is too large, might be very slow or even fall into an indefinite loop.


Original polylines labeled with the values in field to be used as a source for getting the number of points to be generated

The resulting point dataset

Running Programmatically

(Go to TOP)


Expression Explanation
Function Name RandomPointsOnPolylines
<input dataset> A String representing the input layer. Must be of Polyline type.
<output dataset> A String - the full name of the output layer.
{Number Points} An Integer representing the number of points per polygon to be created.
{Number Points Field} A String representing the name of a field in the in the attribute table of the input dataset. The field has the values for the number points per polygon to be created.
{Distance to Ends} A Double representing the minimum distance to the ends of the polyline

Running the function

ETGWPath used in the table below is the full path to ETGWRun.exe (E.G. "C:\Program Files\ETSpatial Techniques\ETGeo Wizards\ETGWRun.exe")

Language Syntax
Python subprocess.call( [ETGWPath, "RandomPointsOnPolylines", "input dataset", "output dataset", "Number Points", "Number Points Field", "Distance to Ends"])
.NET using ETGWRun.exe StartInfo.FileName = ETGWPath
StartInfo.Arguments = "RandomPointsOnPolylines" "input dataset" "output dataset" "Number Points" "Number Points Field" "Distance to Ends"
.NET using ETGWOutX.dll RandomPointsOnPolylines(input dataset, output dataset, Number Points, Number Points Field, Distance to Ends)
ArcPy arcpy.RandomPointsOnPolylines(input dataset, output dataset, "Number Points", "Number Points Field", "Distance to Ends")


(Go to TOP)