Smooth Polyline

 Go to ToolBox Implementation Go to .NET Implementation

Smooth the features of a polyline layer using three different smoothing algorithms

Inputs:

• A polyline feature layer
• Smooth method
• Bezier curve
• The curve in general does not pass through any of the control points (vertices of original polyline) except the first and last.
• The curve is always contained within the convex hull of the control points
• Approximate the original shape rather freely
• Fast - good for polylines with many vertices (control points) that will constrain the curve close to the original shape
• B - Spline
• The curve does not pass through any of the control points (vertices of original polyline) except the first and last
• Follows better than the Bezier curve the original shape
• Depending on the "Freedom" parameter the smoothing occurs only in the areas close to a vertex
• B-Splines lie in the convex hull of the original polyline
• Slower than the Bezier curve, but the results in many cases are much better
• T - Spline (Tension Spline)
• The curve passes trough all the vertices of the original polyline
• The degree of fit can be controlled with the "Tension" parameter
• Suitable for smoothing curves with comparatively equally spaced vertices
• Fast with good approximation of the original polyline
• Parameters depending on the method
• The "Smoothness" parameter (Used in all methods) defines the number of points in the output curve. The allowed values ( 2 to 20 ) in fact are point multiplier. The number of vertices of the original polyline multiplied by this value will give the number of vertices of the smoothed polyline. The larger the value of the Smoothness parameter, the slower the process will be. In most of the cases a value of   5 (default ) will create smooth and representative polyline
• The "Freedom" parameter (B-Spline only) defines how close to the original polyline the curve will be. The allowed values are from 3 to 10. Smaller values give better approximation. With large values the curve will become very similar to Bezier curve
• The "Tension" parameter (T-Spline only) defines how close to the original polyline the curve will be. Increasing the tension is similar to pulling on the ends of a string constrained to pass through the polyline vertices. allowed values are from 1 to 100.
• Optional - Densification tolerance. In some cases the smooth parameters cannot restrict the smoothing enough. The user can restrict the effect of the smoothing by introducing new vertices in the shapes. See Densify function for details
• Optional - Generalization tolerance. The smoothing introduces in the shapes many new vertices. The user can decrease the number of vertices by using this option. See Generalize function for details.

Outputs:

• New polyline feature class
• The output feature class will contain all the features of the original data set
• If the "Smooth selected" option is used, only selected polylines will be smoothed, the rest will preserve their original shape.
• The attributes of the input data set are preserved.

Notes :

• With all methods the Start and End point of the polylines are preserved
• All the methods implement generic algorithms.
• The Generalization and Densification tolerances should be specified in the units of the spatial reference of the input feature class

Examples:

 Smooth results: Dashed - Original; Red - Bezier; Green - B-Spline; Blue- T-Spline (Default parameters) Bezier B-Spline Green - Freedom = 3 Blue - Freedom = 5 T-Spline Green - Tension = 30 Blue - Tension = 90

Command line syntax - ET_GPSmoothBezier

ET_GPSmoothBezier <input_dataset> <out_feature class> <smoothness>

Parameters

Expression Explanation
<input_dataset> A Polyline 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)
<smoothness> An Integer that defines the number of points in the output curve. The allowed values ( 2 to 20 ) in fact are point multiplier. The number of vertices of the original polyline multiplied by this value will give the number of vertices of the smoothed polyline. The larger the value of the <smoothness> parameter, the slower the process will be.

Scripting syntax - ET_GPSmoothBezier

ET_GPSmoothBezier (input_dataset, out_feature class, smoothness)

Command line syntax - ET_GPSmoothBSpline

ET_GPSmoothBSpline <input_dataset> <out_feature class> <smoothness> <freedom>

Parameters

Expression Explanation
<input_dataset> A Polyline 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)
<smoothness> An Integer that defines the number of points in the output curve. The allowed values ( 2 to 20 ) in fact are point multiplier. The number of vertices of the original polyline multiplied by this value will give the number of vertices of the smoothed polyline. The larger the value of the <smoothness> parameter, the slower the process will be.
<freedom> An Integer that defines how close to the original polyline the curve will be. The allowed values are from 3 to 10. Smaller values give better approximation. With large values the curve will become very similar to Bezier curve

Scripting syntax - ET_GPSmoothBSpline

ET_GPSmoothBSpline (input_dataset, out_feature class, smoothness, freedom)

Command line syntax - ET_GPSmoothBSpline

ET_GPSmoothTSpline <input_dataset> <out_feature class> <smoothness> <tension>

Parameters

Expression Explanation
<input_dataset> A Polyline 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)
<smoothness> An Integer that defines the number of points in the output curve. The allowed values ( 2 to 20 ) in fact are point multiplier. The number of vertices of the original polyline multiplied by this value will give the number of vertices of the smoothed polyline. The larger the value of the <smoothness> parameter, the slower the process will be.
<tension> An Integer that defines how close to the original polyline the curve will be. Increasing the tension is similar to pulling on the ends of a string constrained to pass through the polyline vertices. allowed values are from 1 to 100.

Scripting syntax - ET_GPSmoothBSpline

ET_GPSmoothTSpline (input_dataset, out_feature class, smoothness, tension)

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

SmoothBSpline(pInFC As IFeatureClass, sOutFName As String, iSmoothness As Short, iFreedom As Short, sPolylinesType As String) As IFeatureClass

SmoothTSpline(pInFC As IFeatureClass, sOutFName As String,iSmoothness As Short, iFreedom As Short, sPolylinesType As String) As IFeatureClass

SmoothBezier(pInFC As IFeatureClass, sOutFName As String, iSmoothness As Short, sPolylinesType As String) As IFeatureClass