public final class GeoPointUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static double |
LATITUDE_MAX
Maximum possible latitude coordinate.
|
static double |
LATITUDE_MIN
Minimum possible latitude coordinate.
|
static double |
LONGITUDE_MAX
Maximum possible longitude coordinate.
|
static double |
LONGITUDE_MIN
Minimum possible longitude coordinate.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
contains(GeoPoint[] geoPoints,
GeoPoint geoPoint)
Find if the given point lies within this polygon.
|
static double |
distanceSegmentPoint(double startX,
double startY,
double endX,
double endY,
double pointX,
double pointY)
Returns the distance between the given segment and point.
|
static boolean |
isClosedWay(GeoPoint[] geoPoints)
Find if this way is closed.
|
static Point |
nearestSegmentPoint(double startX,
double startY,
double endX,
double endY,
double pointX,
double pointY)
Returns a point on the segment nearest to the specified point.
|
static double |
scaleForBounds(BoundingBox bbox,
int viewWidth,
int viewHeight)
Calculates the scale that allows to display the
BoundingBox on a view with width and
height. |
static double |
validateLatitude(double latitude) |
static double |
validateLongitude(double longitude) |
public static final double LATITUDE_MAX
public static final double LATITUDE_MIN
public static final double LONGITUDE_MAX
public static final double LONGITUDE_MIN
public static boolean contains(GeoPoint[] geoPoints, GeoPoint geoPoint)
http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
public static double distanceSegmentPoint(double startX,
double startY,
double endX,
double endY,
double pointX,
double pointY)
libGDX (Apache 2.0)
public static boolean isClosedWay(GeoPoint[] geoPoints)
public static Point nearestSegmentPoint(double startX, double startY, double endX, double endY, double pointX, double pointY)
libGDX (Apache 2.0)
public static double scaleForBounds(BoundingBox bbox, int viewWidth, int viewHeight)
BoundingBox on a view with width and
height.bbox - the BoundingBox to display.viewWidth - the width of the view.viewHeight - the height of the view.BoundingBox on a view with width and
height.public static double validateLatitude(double latitude)
latitude - the latitude coordinate in degrees which should be validated.java.lang.IllegalArgumentException - if the latitude coordinate is invalid or Double.NaN.public static double validateLongitude(double longitude)
longitude - the longitude coordinate in degrees which should be validated.java.lang.IllegalArgumentException - if the longitude coordinate is invalid or Double.NaN.