public class Coordinate extends Object
| Constructor and Description |
|---|
Coordinate() |
| Modifier and Type | Method and Description |
|---|---|
static double |
distanceBetween(double x1,
double y1,
double x2,
double y2)
Calculates the distance between this point and the supplied point.
|
double |
distanceFrom(Coordinate coordinate)
Returns the distance between this point and the supplied point in meters.
|
static double |
distanceFromPoly(double x,
double y,
List<Coordinate> polygon)
The distance from the closest polygon's border to the point.
|
boolean |
equals(Object obj) |
static int |
getBearing(Coordinate from,
Coordinate to)
Calculates a geographical bearing between two points.
|
static List<Coordinate> |
getCalculatedExtent(List<Coordinate> features)
Recalculate the extent of collection of coordinates.
|
static Coordinate |
getCentroid(List<Coordinate> coordinates)
Get the centroid of collection of
Coordinate(s). |
int |
hashCode() |
static boolean |
intersectsWithPoly(double x,
double y,
List<Coordinate> polygon)
Returns whether the polygon intersects with a specific x and y.
|
static boolean |
isPolygon(List<Coordinate> feature)
Get whether this polygon is a properly formed polygon having the end point equal to the first point.
|
static List<Coordinate> |
rectangleFromLtrb(double left,
double top,
double right,
double bottom)
Gets collection of
Coordinate(s) representing rectangular shape. |
String |
toString() |
public static double distanceBetween(double x1,
double y1,
double x2,
double y2)
x1 - The fist x coordinate (longitude).y1 - The fist y coordinate (latitude).x2 - The second x coordinate (longitude).y2 - The second y coordinate (latitude).public static double distanceFromPoly(double x,
double y,
List<Coordinate> polygon)
x - The origin's x-coordinate.y - The origin's y-coordinate.polygon - The SimpleCoordinate list represents the the polygon.public static int getBearing(Coordinate from, Coordinate to)
from - The origin coordinates.to - The destination coordinates.public static List<Coordinate> getCalculatedExtent(List<Coordinate> features)
features - The features.public static Coordinate getCentroid(List<Coordinate> coordinates)
Coordinate(s).coordinates - The coordinates.public static boolean intersectsWithPoly(double x,
double y,
List<Coordinate> polygon)
x - The x-coordinate being tested for intersection.y - The y-coordinate being tested for intersection.polygon - The Coordinate list (the polygon) being tested for intersection.public static boolean isPolygon(List<Coordinate> feature)
feature - The featurepublic static List<Coordinate> rectangleFromLtrb(double left, double top, double right, double bottom)
Coordinate(s) representing rectangular shape.left - The left.top - The top.right - The right.bottom - The bottom.Coordinate(s).public double distanceFrom(Coordinate coordinate)
coordinate - The Coordinate being checked for distance.Copyright © 2023. All rights reserved.