Package com.graphhopper.util
Class PathSimplification
java.lang.Object
com.graphhopper.util.PathSimplification
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
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic PointList
simplify
(ResponsePath responsePath, RamerDouglasPeucker ramerDouglasPeucker, boolean enableInstructions) Convenience method used to obtain the partitions from a calculated path with details and instructionsstatic void
simplify
(PointList pointList, List<com.graphhopper.util.PathSimplification.Partition> partitions, RamerDouglasPeucker ramerDouglasPeucker)
-
Method Details
-
simplify
public static PointList simplify(ResponsePath responsePath, RamerDouglasPeucker ramerDouglasPeucker, boolean enableInstructions) Convenience method used to obtain the partitions from a calculated path with details and instructions -
simplify
public static void simplify(PointList pointList, List<com.graphhopper.util.PathSimplification.Partition> partitions, RamerDouglasPeucker ramerDouglasPeucker)
-