Package globus.glmap

Class MapGeoPoint

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

public class MapGeoPoint extends Object implements Serializable
MapGeoPoint stores geo coordinates in WGS84 format.
See Also:
  • 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 map point from map point
      Parameters:
      point - Map point
    • MapGeoPoint

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

    • set

      public void set(@NonNull MapPoint point)
      Sets coordinates of point from map point
      Parameters:
      point - map point.
    • 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 distance to point
      Parameters:
      lat - latitude of point
      lon - longitude of point
      Returns:
      distance in meters
    • distanceToGeoPoint

      public double distanceToGeoPoint(@NonNull MapGeoPoint point)
      Calculates distance to point
      Parameters:
      point - point
      Returns:
      distance in meters
    • distanceToPoint

      public double distanceToPoint(@NonNull MapPoint point)
      Calculates distance to point
      Parameters:
      point - point
      Returns:
      distance in meters
    • bearingAngle

      public double bearingAngle(@NonNull MapGeoPoint point)
      Calculates bearing angle to points
      Parameters:
      point - point
      Returns:
      bearing angle in degrees