Back to Devexpress

VisvalingamShapeSimplifier Class

wpf-devexpress-dot-xpf-dot-map-a565e47b.md

latest2.7 KB
Original Source

VisvalingamShapeSimplifier Class

Specifies the Visvalingam shape simplification algorithm.

Namespace : DevExpress.Xpf.Map

Assembly : DevExpress.Xpf.Map.v25.2.dll

NuGet Package : DevExpress.Wpf.Map

Declaration

csharp
public class VisvalingamShapeSimplifier :
    ShapeSimplifierBase
vb
Public Class VisvalingamShapeSimplifier
    Inherits ShapeSimplifierBase

Remarks

The following example shows how to use VisvalingamShapeSimplifier to simplify vector layer items.

csharp
private void SimpleButton_Click(object sender, RoutedEventArgs e) {
    VisvalingamShapeSimplifier simplifier = new VisvalingamShapeSimplifier();
    simplifier.Simplify(adapter.DisplayItems, 50);
}
vb
Private Sub SimpleButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    Dim simplifier As VisvalingamShapeSimplifier = New VisvalingamShapeSimplifier()
    simplifier.Simplify(adapter.DisplayItems, 50)
End Sub
xaml
<dxm:MapControl x:Name="mapControl" Grid.Column="0">
    <dxm:VectorLayer>
        <dxm:SvgFileDataAdapter x:Name="adapter" FileUri="Data/countries.svg" />
    </dxm:VectorLayer>
</dxm:MapControl>
<dx:SimpleButton Content="Simplify" Grid.Column="1" Height="50" 
                 VerticalAlignment="Top" Click="SimpleButton_Click"/>

The Map control also provides the built-in DouglasPeuckerShapeSimplifier you can use instead of VisvalingamShapeSimplifier. The Douglas-Peucker algorithm provides greater smoothness of the resulting polyline while the Visvalingam algorithm demonstrates better performance when you process a polyline with a large number of vertices.

Inheritance

Object DispatcherObject DependencyObject Freezable MapDependencyObject ShapeSimplifierBase VisvalingamShapeSimplifier

See Also

VisvalingamShapeSimplifier Members

DevExpress.Xpf.Map Namespace