public class PathSimplification extends Object
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)
Modifier and Type | Method and Description |
---|---|
static void |
simplify(PointList pointList,
List<com.graphhopper.util.PathSimplification.Partition> partitions,
RamerDouglasPeucker ramerDouglasPeucker) |
static PointList |
simplify(ResponsePath responsePath,
RamerDouglasPeucker ramerDouglasPeucker,
boolean enableInstructions)
Convenience method used to obtain the partitions from a calculated path with details and instructions
|
public static PointList simplify(ResponsePath responsePath, RamerDouglasPeucker ramerDouglasPeucker, boolean enableInstructions)
public static void simplify(PointList pointList, List<com.graphhopper.util.PathSimplification.Partition> partitions, RamerDouglasPeucker ramerDouglasPeucker)
Copyright © 2012–2022. All rights reserved.