Polyline Global Snap

Running programmatically

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

Inputs

Outputs

Options:

Notes:

Example: Red - Source Polyline; Black - Snap Polyline; Green - Snapped Polyline

Before Snap

Before Snap

After Snap - Option1: Nodes, Option2: Vertices

After Snap - Option1: Nodes, Option2: Vertices

After Snap - Option1: Vertices, Option2: Vertices

After Snap - Option1: Vertices, Option2: Vertices

After Snap - Option1: Insert Vertices, Option2: Vertices and Edges

After Snap - Option1: Insert Vertices, Option2: Vertices and Edges

Running Programmatically

(Go to TOP)

Parameters

Expression Explanation
Function Name SnapPolylines
<input dataset> A String representing the input layer. Must be of Polyline 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 or the Reference Dataset is KeepSourceSref = FALSE).
<Snap What> Required. A String indicating what parts of the input polygons will be snapped. Possible values:
  • Node - only the nodes of the source polylines will be snapped.
  • Vertex - the vertices of the source polylines 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 polylines. 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 polylines will be snapped only to the vertices of the geometries from the reference dataset.
  • All - the input polylines 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.
{KeepSourceSref} Optional. 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, "SnapPolylines", "input dataset", "Reference Dataset", "output dataset", "Snap Tolerance", "Snap What", "Snap To What", "Snap To Z", "KeepSourceSref"])
.NET using ETGWRun.exe StartInfo.FileName = ETGWPath
StartInfo.Arguments = "SnapPolylines" "input dataset"  "Reference Dataset" "output dataset" "Snap Tolerance" "Snap What" "Snap To What" "Snap To Z" "KeepSourceSref"
.NET using ETGWOutX.dll SnapPolylines(input dataset, Reference Dataset, output dataset, Snap Tolerance, Snap What, Snap To What, Snap To Z,KeepSourceSref)
ArcPy arcpy.SnapPolylines(input dataset, Reference Dataset, "output dataset" , "Snap Tolerance", "Snap What", "Snap To What", "Snap To Z", "KeepSourceSref")

Notes:

(Go to TOP)