Class PathSimplification

java.lang.Object
com.graphhopper.util.PathSimplification

public class PathSimplification extends Object
This class simplifies the path, using RamerDouglasPeucker, but also considers a given list of partitions of the path. Each partition separates the points of the path into non-overlapping intervals and the simplification is done such that we never simplify across the boundaries of these intervals. This is important, because the points at the interval boundaries must not be removed, e.g. when they are referenced by instructions. For example for a path with twenty points and three partitions like this

- (0,1,2,3)(3,4)(4,4)(4,5,6,7)(7,8,9,10,11,12)(12,13,14,15,16)(17,18,19) - (0,1)(1,2,3,4)(4,5,6,7)(7,7)(8,9,10,11)(12,13,14,15)(16,17,18,19) - (0,1,2,3,4,5)(6,7,8,9,10,11,12,13,14),(14,15,16,17,18)(18,18)(18,19)

we run the simplification for the following intervals:

(0,1)(1,2,3)(3,4)(4,5)(5,6,7)(7,8,9,10,11)(11,12)(12,13,14)(14,15)(15,16)(16,17,18)(18,19)

Author:
Robin Boldt, easbar