DV8.SimplifyLines 1.0.4

dotnet add package DV8.SimplifyLines --version 1.0.4
NuGet\Install-Package DV8.SimplifyLines -Version 1.0.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DV8.SimplifyLines" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DV8.SimplifyLines --version 1.0.4
#r "nuget: DV8.SimplifyLines, 1.0.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DV8.SimplifyLines as a Cake Addin
#addin nuget:?package=DV8.SimplifyLines&version=1.0.4

// Install DV8.SimplifyLines as a Cake Tool
#tool nuget:?package=DV8.SimplifyLines&version=1.0.4

DV8.SimplifyLines

An updated fork/rewrite of simplify.net (https://github.com/imshz/simplify-net), which again is a fork/rewrite of simplify-js (https://github.com/mourner/simplify-js)

Installation / Nuget

See https://www.nuget.org/packages/DV8.SimplifyLines/

Highlights

  • Simplify lines using the Douglas-Peucker algorithm or Radial-Distance algorithm
  • Simple syntax/usage, see below
  • Configurable resolution
  • Uses standard dotnet data structures (Vector3)
  • Dependency free

Usage

See SimplifyShapesTests.cs for full code and more examples

        var points = CreateHighResolutionSquare();
        AreEqual(4 * 1001, points.Count);

        var simplified = SimplifyUtility.SimplifyArray(points.ToArray());
        // Note: 5 points, not 4, because we need to close the square
        AreEqual(5, simplified.Count); 

Example SVGs

The following SVGs are generated using the SimplifyShapesTests.cs

Square (~10000 points)

high-resolution-square.svg

Simplified square (5 points)

high-resolution-square-simplified.svg

Cicle (~6284 points)

high-resolution-circle.svg

Simplified circle (~33 points)

high-resolution-circle-simplified.svg

Very simplified circle (~9 points)

high-resolution-circle-ultra-simplified.svg

Changes from simplify.net:

  • updated .Net version (now supports dotnet 6+)
  • fixed spelling errors
  • updated code to modern standard
  • changed namespace to DV8.SimplifyLines to enable NuGet package
  • changed data structure to Vector3, to enable hardware acceleration

Developers

Narve Sætre and Kai Drange

Original description from simplify-net

A .NET port of simplify-js (https://github.com/mourner/simplify-js) Polyline simplification library by Vladimir Agafonkin, extracted from Leaflet. For license see the original project or https://github.com/mourner/simplify-js/blob/master/LICENSE

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.4 105 2/2/2024
1.0.3 86 1/30/2024
1.0.2 77 1/30/2024
1.0.1 1,671 1/30/2024
1.0.0 76 1/30/2024