Package globus.glmap
Class MapGeoPoint
java.lang.Object
globus.glmap.MapGeoPoint
- All Implemented Interfaces:
Serializable
A geographic point in WGS84 latitude/longitude degrees.
To convert to/from the internal map coordinate system used by the renderer, use
MapGeoPoint(MapPoint) / set(MapPoint) and MapPoint(MapGeoPoint).
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorMapGeoPoint(double lat, double lon) Constructor of point from latitude and longitudeMapGeoPoint(MapGeoPoint mapPoint) Copies constructorMapGeoPoint(MapPoint point) Creates a geographic point from an internal map point. -
Method Summary
Modifier and TypeMethodDescriptionvoidassign(MapGeoPoint point) Copies data from other pointdoublebearingAngle(double lat, double lon) Calculates a bearing angle to a geographic point.doubleCalculates a bearing angle to a geographic point.doubledistance(double lat, double lon) Calculates a great-circle distance to a geographic point.doubledistanceToGeoPoint(MapGeoPoint point) Calculates a great-circle distance to a geographic point.doubledistanceToPoint(MapPoint point) Calculates a great-circle distance to a point specified in internal map coordinates.booleaninthashCode()voidReplaces this point with geographic coordinates converted from an internal map point.
-
Field Details
-
lat
public double latLatitude -
lon
public double lonLongitude
-
-
Constructor Details
-
MapGeoPoint
public MapGeoPoint()Default constructor -
MapGeoPoint
public MapGeoPoint(double lat, double lon) Constructor of point from latitude and longitude- Parameters:
lat- latitude of point. Valid values are in range [-90, +90]lon- longitude of point. Valid values are in range [-180, +180]
-
MapGeoPoint
Creates a geographic point from an internal map point.- Parameters:
point- Map point in internal map coordinates.
-
MapGeoPoint
Copies constructor- Parameters:
mapPoint- point to copy
-
-
Method Details
-
set
Replaces this point with geographic coordinates converted from an internal map point.- Parameters:
point- Map point in internal map coordinates.
-
assign
Copies data from other point- Parameters:
point- source point
-
equals
-
hashCode
public int hashCode() -
distance
public double distance(double lat, double lon) Calculates a great-circle distance to a geographic point.- Parameters:
lat- Latitude in degrees.lon- Longitude in degrees.- Returns:
- Distance in meters.
-
distanceToGeoPoint
Calculates a great-circle distance to a geographic point.- Parameters:
point- point- Returns:
- Distance in meters.
-
distanceToPoint
Calculates a great-circle distance to a point specified in internal map coordinates.- Parameters:
point- point- Returns:
- Distance in meters.
-
bearingAngleToGeoPoint
Calculates a bearing angle to a geographic point.- Parameters:
point- point- Returns:
- Bearing in degrees clockwise from true north.
-
bearingAngle
public double bearingAngle(double lat, double lon) Calculates a bearing angle to a geographic point.- Parameters:
lat- Latitude in degrees.lon- Longitude in degrees.- Returns:
- Bearing in degrees clockwise from true north.
-