DV8.SimplifyLines
1.0.4
dotnet add package DV8.SimplifyLines --version 1.0.4
NuGet\Install-Package DV8.SimplifyLines -Version 1.0.4
<PackageReference Include="DV8.SimplifyLines" Version="1.0.4" />
paket add DV8.SimplifyLines --version 1.0.4
#r "nuget: DV8.SimplifyLines, 1.0.4"
// 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)
Simplified square (5 points)
Cicle (~6284 points)
Simplified circle (~33 points)
Very simplified circle (~9 points)
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
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 | Versions 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. |
-
net6.0
- coverlet.collector (>= 3.1.0)
- Microsoft.NET.Test.Sdk (>= 16.11.0)
- NUnit (>= 3.13.2)
- NUnit3TestAdapter (>= 4.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.