Near Feature

Running programmatically

Calculates the distance for each feature of the Input dataset to the closest feature from the Near dataset. In the attribute table of the output the distance is recorded together with the ID of the closest feature.

Inputs:

Outputs:

Notes:

Examples:

Input Dataset - Polygons ; Near Dataset - Polylines

Input Dataset - Polylines ; Near Dataset - Polygons

Input Dataset - Points ; Near Dataset - Polylines

Running Programmatically

(Go to TOP)

Parameters

Expression Explanation
Function Name NearFeature
<input dataset> A String representing the input layer.
<Near Dataset> A String representing the reference layer.
<output dataset> A String - the full name of the output layer.
< CutOff Distance> A Double representing the Cut-Off Distance to be used. The units of the tolerance are the units of spatial reference of the input dataset if KeepSourceSref = TRUE. Otherwise - the units of spatial reference of the Near Dataset.
{KeepSourceSref} A Boolean indicating whether the output to have the spatial reference of the input layer. If False or 0, the spatial reference of the reference layer will be used.

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, "NearFeature", "input dataset", "Near Dataset", "output dataset", " CutOff Distance", "KeepSourceSref"])
.NET using ETGWRun.exe StartInfo.FileName = ETGWPath
StartInfo.Arguments = "NearFeature" "input dataset" "Near Dataset" "output dataset" "CutOff Distance" "KeepSourceSref"
.NET using ETGWOutX.dll NearFeature(input dataset,Near Dataset, output dataset, CutOff Distance, KeepSourceSref)
ArcPy arcpy.NearFeature(input dataset, Near Dataset, output dataset, "CutOff Distance" , "KeepSourceSref")

Notes:

(Go to TOP)