Package ch.ivyteam.ivy.location
Class GeoPosition
java.lang.Object
ch.ivyteam.ivy.location.GeoPosition
- API:
- This is a public API.
-
Method Summary
Modifier and TypeMethodDescriptionExample:Lat 47° 10' 257" N Long 8° 31' 744" E Alt 425 m
getDistanceTo
(GeoPosition otherPosition) Gets the distance between this position and the given position.boolean
isNearby
(GeoPosition otherPosition, Distance maxDistance) Moves the position by the given distance in the given direction.toString()
Example:Lat 47.171573° Long 8.516835° Alt 425 m
-
Method Details
-
getLatitude
- Returns:
- latitude
- API:
- This public API is available in Java.
-
getLongitude
- Returns:
- longitude
- API:
- This public API is available in Java.
-
getAltitude
- Returns:
- altitude
- API:
- This public API is available in Java.
-
getDistanceTo
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
- Parameters:
otherPosition
-maxDistance
-- Returns:
- if given position is closer than maxDistance
- API:
- This public API is available in Java.
-
move
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
Example:
Lat 47.171573° Long 8.516835° Alt 425 m
- See Also:
- API:
- This public API is available in Java.
-
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.
-