Package globus.glmap

Class MapGeoPoint

java.lang.Object
globus.glmap.MapGeoPoint
All Implemented Interfaces:
Serializable

public class MapGeoPoint extends Object implements 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
    Modifier and Type
    Field
    Description
    double
    Latitude
    double
    Longitude
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor
    MapGeoPoint(double lat, double lon)
    Constructor of point from latitude and longitude
    Copies constructor
    Creates a geographic point from an internal map point.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Copies data from other point
    double
    bearingAngle(double lat, double lon)
    Calculates a bearing angle to a geographic point.
    double
    Calculates a bearing angle to a geographic point.
    double
    distance(double lat, double lon)
    Calculates a great-circle distance to a geographic point.
    double
    Calculates a great-circle distance to a geographic point.
    double
    Calculates a great-circle distance to a point specified in internal map coordinates.
    boolean
    equals(Object other)
     
    int
     
    void
    set(MapPoint point)
    Replaces this point with geographic coordinates converted from an internal map point.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • lat

      public double lat
      Latitude
    • lon

      public double lon
      Longitude
  • 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

      public MapGeoPoint(@NonNull MapPoint point)
      Creates a geographic point from an internal map point.
      Parameters:
      point - Map point in internal map coordinates.
    • MapGeoPoint

      public MapGeoPoint(@NonNull MapGeoPoint mapPoint)
      Copies constructor
      Parameters:
      mapPoint - point to copy
  • Method Details

    • set

      public void set(@NonNull MapPoint point)
      Replaces this point with geographic coordinates converted from an internal map point.
      Parameters:
      point - Map point in internal map coordinates.
    • assign

      public void assign(@NonNull MapGeoPoint point)
      Copies data from other point
      Parameters:
      point - source point
    • equals

      public boolean equals(@Nullable Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • 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

      public double distanceToGeoPoint(@NonNull MapGeoPoint point)
      Calculates a great-circle distance to a geographic point.
      Parameters:
      point - point
      Returns:
      Distance in meters.
    • distanceToPoint

      public double distanceToPoint(@NonNull MapPoint point)
      Calculates a great-circle distance to a point specified in internal map coordinates.
      Parameters:
      point - point
      Returns:
      Distance in meters.
    • bearingAngleToGeoPoint

      public double bearingAngleToGeoPoint(@NonNull MapGeoPoint point)
      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.