public class PolylineUtils
extends java.lang.Object
| Constructor and Description |
|---|
PolylineUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<Position> |
decode(java.lang.String encodedPath,
int precision)
Decodes an encoded path string into a sequence of Positions.
|
static java.lang.String |
encode(java.util.List<Position> path,
int precision)
Encodes a sequence of Positions into an encoded path string.
|
static Position[] |
simplify(Position[] 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 Position[] |
simplify(Position[] 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 Position[] |
simplify(Position[] 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 Position[] |
simplify(Position[] 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.
|
public static java.util.List<Position> decode(java.lang.String encodedPath, int precision)
encodedPath - String representing a path string.precision - OSRMv4 uses 6, OSRMv5 and Google uses 5.Position making up the line.public static java.lang.String encode(java.util.List<Position> path, int precision)
path - List of Position making up the line.precision - OSRMv4 uses 6, OSRMv5 and Google uses 5.String representing a path string.public static Position[] simplify(Position[] points)
points - an array of pointspublic static Position[] simplify(Position[] points, double tolerance)
points - an array of pointstolerance - affects the amount of simplification (in the same metric as the point coordinates)public static Position[] simplify(Position[] points, boolean highestQuality)
points - an array of pointshighestQuality - excludes distance-based preprocessing step which leads to highest quality simplificationpublic static Position[] simplify(Position[] 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