Class GeoPosition

java.lang.Object
ch.ivyteam.ivy.location.GeoPosition

public class GeoPosition extends Object
Geo-position defined by latitude, longitude, altitude.
API:
This is a public API.
  • Method Details

    • getLatitude

      public Latitude getLatitude()
      Returns:
      latitude
      API:
      This public API is available in Java.
    • getLongitude

      public Longitude getLongitude()
      Returns:
      longitude
      API:
      This public API is available in Java.
    • getAltitude

      public Altitude getAltitude()
      Returns:
      altitude
      API:
      This public API is available in Java.
    • getDistanceTo

      public Distance getDistanceTo(GeoPosition otherPosition)

      Gets the distance between this position and the given position.

      Example:

       GeoPosition zug = new GeoPosition(47.171573, 8.516835);
       GeoPosition zuerich = new GeoPosition(47.373249, 8.531220);
       Distance distance = zug.getDistanceTo(zuerich);
       ivy.log.info("The distance between zug and zuerich is "+distance.inMeters());
       

      Parameters:
      otherPosition -
      Returns:
      distance
      API:
      This public API is available in Java.
    • isNearby

      public boolean isNearby(GeoPosition otherPosition, Distance maxDistance)

      Returns true if the given position is closer than the given distance from this position.

      Parameters:
      otherPosition -
      maxDistance -
      Returns:
      if given position is closer than maxDistance
      API:
      This public API is available in Java.
    • move

      public GeoPosition move(Distance distance, Angle direction)
      Moves the position by the given distance in the given direction.
      Parameters:
      distance -
      direction - 0° means North. 90° means East. 180° means South. 270° means West.
      Returns:
      moved position
      API:
      This public API is available in Java.
    • toString

      public String toString()

      Example: Lat 47.171573° Long 8.516835° Alt 425 m

      See Also:
      API:
      This public API is available in Java.
    • formatSexagesimal

      public String formatSexagesimal()

      Example:Lat 47° 10' 257" N Long 8° 31' 744" E Alt 425 m

      Returns:
      string representation in format degrees, minutes and seconds
      API:
      This public API is available in Java.