Snaps the features of a point layer to another layer (Point, Polyline or Polygon)
Before Snap
After Snap - Option: Vertex
After Snap - Option: Nearest
Expression | Explanation |
---|---|
Function Name | SnapPoints |
<input dataset> | A String representing the input layer. Must be of Point type. |
<reference dataset> | A String representing the reference layer. Must be of Polyline type |
<output dataset> | A String - the full name of the output layer. |
< SnapTolerance> | A Double representing the Snap Tolerance 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 reference dataset. |
{snap option} | A String indicating the snap option to be used. Valid inputs: "Vertex" or "Nearest". Default = "Nearest" |
{snapToZ} | A Boolean indicating whether to snap to Z values (if the reference dataset has Z values). Default = False. |
{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. |
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, "SnapPoints", "input dataset", "reference dataset", "output dataset", " SnapTolerance", "snap option", "snapToZ", "KeepSourceSref"]) |
.NET using ETGWRun.exe | StartInfo.FileName = ETGWPath StartInfo.Arguments = "SnapPoints" "input dataset" "reference dataset" "output dataset" "SnapTolerance" "snap option" "snapToZ" "KeepSourceSref" |
.NET using ETGWOutX.dll | SnapPoints(input dataset,reference dataset, output dataset, SnapTolerance, snap option, snapToZ, KeepSourceSref) |
ArcPy | arcpy.SnapPoints(input dataset, reference dataset, output dataset, "SnapTolerance" , "snap option", "snapToZ", "KeepSourceSref") |
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.