Package org.eclipse.mosaic.lib.geo
Class GeoUtils
java.lang.Object
org.eclipse.mosaic.lib.geo.GeoUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleCalculates and returns the angle (azimuth) between two points as seen frompointA.static doubleCalculates and returns the angle (azimuth) between two points as seen frompointA.static GeoPointclosestPointOnLine(GeoPoint point, GeoPoint linePointA, GeoPoint linePointB) Searches for theMutableGeoPointon a line between two given pointslinePointAandlinePointBwhich is closest to the given pointpoint.static doubledistanceBetween(GeoPoint a, GeoPoint b) static Vector3ddistanceBetween(GeoPoint a, GeoPoint b, Vector3d result) static GeoPointgetGeoPointFromDirection(GeoPoint origin, double azimuth, double distance) Calculates a geographic coordinate based on an origin point and a direction with length.static GeoPointgetGeoPointFromDirection(GeoPoint origin, Vector3d direction) static GeoPointgetPointBetween(GeoPoint pointA, GeoPoint pointB) Returns the exact point which between the two given points.static longgetQuadKey(GeoPoint geoPoint, int zoom) Returns the Bing quad key tile with the specified zoom level that contains the givenGeoPoint.static GeoPointgetRandomGeoPoint(RandomNumberGenerator random, GeoPoint origin, double radius) Returns a randomMutableGeoPointwithin the radius of the given point.
-
Constructor Details
-
GeoUtils
public GeoUtils()
-
-
Method Details
-
distanceBetween
-
distanceBetween
-
azimuth
Calculates and returns the angle (azimuth) between two points as seen frompointA. The azimuth value starts with0degrees referring to North, and increases clockwise up to360degrees.- Parameters:
a- the base pointb- the point to calculate the azimuth based onpointA- Returns:
- the azimuth value in [degrees] from 0 (North) clockwise to 360
-
azimuth
Calculates and returns the angle (azimuth) between two points as seen frompointA. The azimuth value starts with0degrees referring to North, and increases clockwise up to360degrees.- Parameters:
a- the base pointb- the point to calculate the azimuth based onpointA- Returns:
- the azimuth value in [degrees] from 0 (North) clockwise to 360
-
closestPointOnLine
Searches for theMutableGeoPointon a line between two given pointslinePointAandlinePointBwhich is closest to the given pointpoint.- Parameters:
point- the point which is used to search for the closest point on the given linelinePointA- the start of the line on which the resulting point is locatedlinePointB- the end of the line on which the resulting point is located- Returns:
- the
MutableGeoPointon the line betweenlinePointAandlinePointBwhich is closest topoint
-
getGeoPointFromDirection
Calculates a geographic coordinate based on an origin point and a direction with length.- Parameters:
origin- The geographic position to start fromazimuth- The azimuth in decimal degrees from -180° to 180°distance- The orthodromic distance in the same units as the ellipsoid axis (meters by default)
-
getGeoPointFromDirection
-
getRandomGeoPoint
public static GeoPoint getRandomGeoPoint(RandomNumberGenerator random, GeoPoint origin, double radius) Returns a randomMutableGeoPointwithin the radius of the given point.- Parameters:
random- the random number generator to generate random pointsorigin- Initial geographic positionradius- Radius around the geographic position, unit: [m]- Returns:
- Random geographic position within the radius of the given point
-
getPointBetween
Returns the exact point which between the two given points. The orthodromic distance from the resulting point topointAorpointBis equal to the half of the distance betweenpointAandpointB.- Parameters:
pointA- the first pointpointB- the second point- Returns:
- the point in center of both points
-
getQuadKey
Returns the Bing quad key tile with the specified zoom level that contains the givenGeoPoint.
-