@Immutable public final class GeoPolyLine extends GeoObject
GeoPolyLine()
Constructor and Description |
---|
GeoPolyLine(List<GeoPoint> points)
Create a polyline.
|
Modifier and Type | Method and Description |
---|---|
List<GeoLine> |
asLines()
Get the polyline as a series of connected lines.
|
boolean |
canEqual(Object obj) |
boolean |
equals(Object obj) |
GeoPoint |
get(int i)
Get point.
|
GeoPoint |
getCenter()
Return center == Mid point of bounding box of polyline.
|
double |
getLengthMeters()
Return length of line in meters (approximation).
|
GeoLine |
getLine(int i)
Get a single line segment.
|
GeoPoint |
getOrigin()
Return origin == first point.
|
GeoPoint |
getPointAtOffset(double offsetInMeters)
Return an (interpolated) point on a polyline, given an offset in meters.
|
int |
hashCode() |
GeoPolyLine |
moveTo(GeoPoint origin)
Move a geo object to specific origin.
|
int |
size()
Get number of points in polyline.
|
GeoPolyLine |
translate(GeoVector vector)
Translate a geo object with an Easting and Northing value.
|
public GeoPolyLine(@Nonnull List<GeoPoint> points)
points
- Points, to be connected by polyline, via shortest line (so not across the long side of the
Earth). Must contain at least 2 points.@Nonnull public GeoPoint getCenter()
@Nonnull public GeoPoint getPointAtOffset(double offsetInMeters)
offsetInMeters
- Offset in meters, if positive (or 0.0) from the start of the polyline,
if negative, from the end of the polyline.public int size()
@Nonnull public GeoPoint get(int i)
i
- Index, must be in [0, size - 1].@Nonnull public List<GeoLine> asLines()
@Nonnull public GeoLine getLine(int i)
i
- Index, must be in [0, size - 2].@Nonnull public GeoPolyLine translate(@Nonnull GeoVector vector)
GeoObject
@Nonnull public GeoPolyLine moveTo(@Nonnull GeoPoint origin)
GeoObject
public double getLengthMeters()
Copyright © 2018 TomTom International BV. All rights reserved.