Skip to content

mkatch/polysim

Repository files navigation

Polyline Simplification

This project demostrates an original algorithm for polygonal line simplification. Given a polygonal line, referred to as path, we produce a visually similar path, but with less vertices. The restruction criterion is threshold, which specifies the maximal distance between a point from original path to the simplified path.

You can view the detailed description at the GitHub page of this project. You can also grab the executables in under releases

Demo app screenshot

The algorithm is, implemented by PathSimplifier. It receives an instance of Path as input and provides a simplified path as result. The simplest use case may be as follows:

Path path = new Path();
 float threshold = 0.3f;
 PathSimplifier simplifier = new PathSimplifier(path, threshold);
 path.addPoint(3, 0);
 path.addPoint(1, 2);
 . . .
 path.addPoint(-4, 1);
 Path simple = simplifier.getSimplified();

The simplifier may be attached to the path at any moment and the simplified path may be retrievied at any time. For details, refer to the implementation.

About

An algorithm for simplifying polygonal paths

Resources

Stars

Watchers

Forks

Packages

No packages published