Creates an output polyline layer with single segmented polylines that connect each point of the input Point layer to it's closest neighbor. The function uses a robust algorithm and can be applied on datasets containing up to 2 million points.
Result Dataset - Add Duplicate Links option NOT selected

Result Dataset - Add Duplicate Links option NOT selected

Parameters
| Expression | Explanation |
|---|---|
| Function Name | ConnectToClosestPoint |
| <input dataset> | A String representing the input layer. Must be of Point type. |
| <output dataset> | A String - the full name of the output layer. |
| <CutOff Distance> | A Double representing the CutOff Distance( in the units of the spatial reference of the input dataset). |
| {Add Duplicates} | A Boolean indicating whether duplicate links will be added to the result. |
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, "ConnectToClosestPoint", "input dataset", "output dataset", "CutOff Distance", "Add Duplicates"]) |
| .NET using ETGWRun.exe | StartInfo.FileName = ETGWPath StartInfo.Arguments = "ConnectToClosestPoint" "input dataset" "output dataset" "CutOff Distance" "Add Duplicates" |
| .NET using ETGWOutX.dll | ConnectToClosestPoint(input dataset, output dataset, CutOff Distance, Add Duplicates) |
| ArcPy | arcpy.ConnectToClosestPoint(input dataset, output dataset, "CutOff Distance", "Add Duplicates") |
Notes:
<> - required parameter
{} - optional parameter
The argument separator for StartInfo.Arguments is space. If a string might contain a space, you need to double quote it.