public final class PolylineUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<Point> |
decode(java.lang.String encodedPath,
int precision)
Decodes an encoded path string into a sequence of
Point. |
static java.lang.String |
encode(java.util.List<Point> path,
int precision)
Encodes a sequence of Points into an encoded path string.
|
static java.util.List<Point> |
simplify(java.util.List<Point> points)
Reduces the number of points in a polyline while retaining its shape, giving a performance
boost when processing it and also reducing visual noise.
|
static java.util.List<Point> |
simplify(java.util.List<Point> points,
boolean highestQuality)
Reduces the number of points in a polyline while retaining its shape, giving a performance
boost when processing it and also reducing visual noise.
|
static java.util.List<Point> |
simplify(java.util.List<Point> points,
double tolerance)
Reduces the number of points in a polyline while retaining its shape, giving a performance
boost when processing it and also reducing visual noise.
|
static java.util.List<Point> |
simplify(java.util.List<Point> points,
double tolerance,
boolean highestQuality)
Reduces the number of points in a polyline while retaining its shape, giving a performance
boost when processing it and also reducing visual noise.
|
@NonNull public static java.util.List<Point> decode(@NonNull java.lang.String encodedPath, int precision)
Point.encodedPath - a String representing an encoded path stringprecision - OSRMv4 uses 6, OSRMv5 and Google uses 5Point making up the line@NonNull
public static java.lang.String encode(@NonNull
java.util.List<Point> path,
int precision)
path - list of Points making up the lineprecision - OSRMv4 uses 6, OSRMv5 and Google uses 5@NonNull public static java.util.List<Point> simplify(@NonNull java.util.List<Point> points)
points - an array of points@NonNull public static java.util.List<Point> simplify(@NonNull java.util.List<Point> points, double tolerance)
points - an array of pointstolerance - affects the amount of simplification (in the same metric as the point
coordinates)@NonNull public static java.util.List<Point> simplify(@NonNull java.util.List<Point> points, boolean highestQuality)
points - an array of pointshighestQuality - excludes distance-based preprocessing step which leads to highest quality
simplification@NonNull public static java.util.List<Point> simplify(@NonNull java.util.List<Point> points, double tolerance, boolean highestQuality)
points - an array of pointstolerance - affects the amount of simplification (in the same metric as the point
coordinates)highestQuality - excludes distance-based preprocessing step which leads to highest quality
simplification