1

Mainly the implementation for Douglas-Peucker algorithm.

Aravind Yarram
  • 78,777
  • 46
  • 231
  • 327

2 Answers2

4

You can use https://github.com/hgoebl/simplify-java

Simplification of a 2D-polyline or a 3D-polyline.

  • Uses Radial-Distance algorithm (fast) or Douglas-Peucker (high quality) algorithm
  • Port of mourner / simplify-js, a High-performance JavaScript 2D/3D polyline simplification library by Vladimir Agafonkin
  • Can handle arbitrary objects carrying coordinates (2D, 3D) either by implementing an interface or by providing a helper extracting the coordinates
  • Leaves the objects untouched, just creates a new array referencing the simplified points
  • requires Java 5
  • Maven Build
  • JUnit-tested, 94% lines covered, reference data is created by "original" JavaScript implementation (Version 1.1.0)
hgoebl
  • 12,637
  • 9
  • 49
  • 72
2

You could try JTS (LGPL licence) and it's DouglasPeuckerLineSimplifier.

(Note it was last updated 2006)

SuperBiasedMan
  • 9,814
  • 10
  • 45
  • 73
jeha
  • 10,562
  • 5
  • 50
  • 69