Polygon Global Snap

Running programmatically

Snaps the features of a polygon layer to another layer (Point, Polyline or Polygon)

Inputs

Outputs

Options:

Notes:

Example:

Before Snap

Before Snap

After Snap - Option: Vertices

After Snap - Option: Vertices

After Snap - Option: Nearest Edge

After Snap - Option: Nearest Edge

After Snap - Option: Vertices and Edges

After Snap - Option: Vertices and Edges

Running Programmatically

(Go to TOP)

Parameters

Expression Explanation
Function Name SnapPolygons
<input dataset> A String representing the input layer. Must be of Polygon type.
<Reference Dataset> A String representing the layer to be used to snap to.
<output dataset> A String - the full name of the output layer.
<Snap Tolerance> A Double representing the Snap Tolerance (in the units of the spatial reference of the input dataset.
<Snap What> Required. A String indicating what parts of the input polygons will be snapped. Possible values:
  • Vertex - the vertices of the source polygons will be snapped.
  • InsertVertex - the vertices from the features of the Reference Dataset will be inserted (if closer to the input dataaset) as new vertices into the source polygon boundaries. The new vertices together with the original ones will be used for snapping. This option is slower than the other ones, but gives the best snapping results especially if the polygons to be snapped have much less vertices than the ones from the Reference Dataset.
<Snap To What> Required. A String indicating to what parts of the reference geometries the input polygons will try to snap. Possible values:
  • Vertex - the input polygons will be snapped only to the vertices of the geometries from the reference dataset.
  • All - the input polygons will be snapped to the vertices or nearest edge of the geometries from the reference dataset.
{Snap To Z} Optional. A Boolean indicating whether the input geometries will snap the the Z values of the geometries from the Reference Dataset. Only if both dataset have Z values.

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, "SnapPolygons", "input dataset", "Reference Dataset", "output dataset", "Snap Tolerance", "Snap What", "Snap To What", "Snap To Z"])
.NET using ETGWRun.exe StartInfo.FileName = ETGWPath
StartInfo.Arguments = "SnapPolygons" "input dataset"  "Reference Dataset" "output dataset" "Snap Tolerance" "Snap What" "Snap To What" "Snap To Z"
.NET using ETGWOutX.dll SnapPolygons(input dataset, Reference Dataset, output dataset, Snap Tolerance, Snap What, Snap To What, Snap To Z)
ArcPy arcpy.SnapPolygons(input dataset, Reference Dataset, "output dataset" , "Snap Tolerance", "Snap What", "Snap To What", "Snap To Z")

Notes:

(Go to TOP)