Package ch.ivyteam.ivy.location
Class GeoPosition
- java.lang.Object
-
- ch.ivyteam.ivy.location.GeoPosition
-
public class GeoPosition extends Object
- API:
- This is a public API.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
formatSexagesimal()
Example:Lat 47° 10' 257" N Long 8° 31' 744" E Alt 425 m
Altitude
getAltitude()
Distance
getDistanceTo(GeoPosition otherPosition)
Gets the distance between this position and the given position.Latitude
getLatitude()
Longitude
getLongitude()
boolean
isNearby(GeoPosition otherPosition, Distance maxDistance)
GeoPosition
move(Distance distance, Angle direction)
Moves the position by the given distance in the given direction.String
toString()
Example:Lat 47.171573° Long 8.516835° Alt 425 m
-
-
-
Method Detail
-
getLatitude
public Latitude getLatitude()
- Returns:
- latitude
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
getLongitude
public Longitude getLongitude()
- Returns:
- longitude
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
getAltitude
public Altitude getAltitude()
- Returns:
- altitude
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
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 IvyScript and Java. It has the visibility EXPERT.
-
isNearby
public boolean isNearby(GeoPosition otherPosition, Distance maxDistance)
- Parameters:
otherPosition
-maxDistance
-- Returns:
- if given position is closer than maxDistance
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
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 IvyScript and Java. It has the visibility EXPERT.
-
toString
public String toString()
Example:
Lat 47.171573° Long 8.516835° Alt 425 m
- See Also:
Object.toString()
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
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 IvyScript and Java. It has the visibility EXPERT.
-
-