Spatial Join

Running programmatically

Joins the attributes of the Join Layer to the attribute table of the Target Layer based on spatial location.

Inputs:

Outputs:

Running Programmatically

(Go to TOP)

Parameters

Expression Explanation
Function Name SpatialJoin
<Target Dataset> A String representing the target layer.
<Join Dataset> A String representing the join layer.
<output dataset> A String - the full name of the output layer.
< Join Type> A String representing the Join Type to be used. Valid values: "OneToMany" and "ManyToMany"
<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 Target Dataset
<Join Fields< A String representing a list (separator ";") of the fields to transfer together with the method for each field. Valid values - "Sum", "Max", "Min" for number fields and "First", "Last" for string fields. Example: "Field1 Sum; Field2 First; Field3 Min"
{Keep All} A Boolean indicated whether to keep all target features - see explanation above.
{Add Statistics} A Boolean indicated whether to add statistics fields - see explanation above.

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, "SpatialJoin", "Target Dataset", "Join Dataset", "output dataset", " Join Type", "CutOff Distance", "Join Fields", "Keep All", "Add Statistics"])
.NET using ETGWRun.exe StartInfo.FileName = ETGWPath
StartInfo.Arguments = "SpatialJoin" "Target Dataset" "Join Dataset" "output dataset" "Join Type" "CutOff Distance" "Join Fields" "Keep All" "Add Statistics"
.NET using ETGWOutX.dll SpatialJoin(Target Dataset,Join Dataset, output dataset, Join Type, CutOff Distance,Join Fields,Keep All,Add Statistics)
ArcPy arcpy.SpatialJoin(Target Dataset, Join Dataset, output dataset, "Join Type", "CutOff Distance", "Join Fields","Keep All", "Add Statistics")

Notes:

(Go to TOP)