Open Table of Contents

Polyline Global Snap

Go to ToolBox Implementation Go to .NET Implementation

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

Inputs:

Outputs:

Options:

Notes:

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

Before Snap

After Snap
Option1: Nodes
Option2: Vertices

After Snap
Option1: Vertices
Option2: Vertices

After Snap
Option1: Insert Vertices
Option2: Vertices & Edges

pl_snap0.jpg (14529 bytes)

pl_snap1.jpg (17379 bytes)

pl_snap2.jpg (17806 bytes)

pl_snap3.jpg (17419 bytes)

ToolBox implementation
(Go to TOP)

Command line syntax

ET_GPSnapPolylines <input_dataset> <Reference_dataset> <out_feature class> <snap_tolerance> <snap_what> {snap_to_vertices} {snap_to_nearest}

Parameters

Expression Explanation
<input_dataset> A Polyline feature class or feature layer
<Reference_dataset> A Point, Polyline or Polygon feature class or feature layer.
<out_feature_class> A String - the full name of the output feature class (A feature class with the same full name should not exist)
<snap_tolerance> A Double representing  the Search tolerance (in the units of the input_dataset) to be used
<snap_what> A String indicating what parts of the input polylines will be snapped. Possible values:
  • Nodes: Only nodes (end points) of the polylines will be snapped
  • Vertex: All the vertices of the source polylines will be used.
  • Insert: This option will get the vertices from the features of the Reference_dataset and will insert 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 polylines to be snapped have much less vertices than the ones from the Reference_dataset.
{snap_to_vertices} A Boolean indicating whether snapping to the closest vertex of the nearest feature from the Reference_dataset to be used
{snap_to_nearest} A Boolean indicating whether snapping to the nearest point of the nearest feature from the Reference_dataset  to be used

Scripting syntax

ET_GPSnapPolylines (input_dataset, Reference_dataset, out_feature_ class, snap_tolerance, snap_what,snap_to_vertices, snap_to_nearest)

See the explanations above:
<> - required parameter
{} - optional parameter

.NET implementation
(Go to TOP)

SnapPolylines(pInFC As IFeatureClass, pRefFC As IFeatureClass, sOutFName As String, dSnapTol As Double, sSnapWhat As String, Optional bVertex As Boolean = False, Optional bNearest As Boolean = False, Optional bSnapToZ As Boolean = False) As IFeatureClass

Copyright Ianko Tchoukanski