PolylineSimplifier 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package PolylineSimplifier --version 1.0.0
                    
NuGet\Install-Package PolylineSimplifier -Version 1.0.0
                    
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="PolylineSimplifier" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PolylineSimplifier" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="PolylineSimplifier" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PolylineSimplifier --version 1.0.0
                    
#r "nuget: PolylineSimplifier, 1.0.0"
                    
#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.
#:package PolylineSimplifier@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PolylineSimplifier&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=PolylineSimplifier&version=1.0.0
                    
Install as a Cake Tool

PolylineSimplifier

An efficient .NET library for simplifying 2D polylines using the Ramer-Douglas-Peucker algorithm.

Usage

Installation

dotnet add package PolylineSimplifier

Example

using PolylineSimplifier;

public record Point(float X, float Y);

var points = new List<Point>
{
    new(0, 0), new(1, 0.1f), new(2, -0.1f), new(3, 5), new(4, 6),
    new(5, 7), new(6, 8.1f), new(7, 9), new(8, 9), new(9, 9)
};

var simplified = RamerDouglasPeucker2D.Simplify(
    points,
    epsilon: 1.0f,
    getX: p => p.X,
    getY: p => p.Y);

Parameters

Parameter Description
points The input polyline as a list of points
epsilon Maximum perpendicular distance tolerance. Larger values = more simplification
getX Function to extract the X coordinate from a point
getY Function to extract the Y coordinate from a point

Benchmarks

Measured on AMD Ryzen 5 7600 Processor:

Method epsilon Mean Allocated
Simplify_Small_100Points 1 1.912 μs 2.27 KB
Simplify_Medium_1000Points 1 32.363 μs 17.21 KB
Simplify_Large_10000Points 1 962.689 μs 138.07 KB
Simplify_ExtraLarge_100000Points 1 23,547.090 μs 2146.2 KB

Running Benchmarks

git clone git@github.com:jonataneckeskog/PolylineSimplifier.git
cd PolylineSimplifier
dotnet run -c Release --project tests/PolylineSimplifier.Benchmarks

License

MIT License – see LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

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.2 81 2/28/2026
1.0.1 81 2/28/2026
1.0.0 201 11/27/2025