Class Position
java.lang.Object
ch.tocco.nice2.optional.geolocation.api.Position
- All Implemented Interfaces:
Serializable
A geographical position specified by a pair of latitude and longitude coordinates.
The walkXxx and getBoundingBox methods calculate good
results for small distances only! Feel free to improve this to support e.g. travelling
around the earth multiple times etc.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondistanceTo(Position position) booleanPosition[]getBoundingBox(Distance dst) Returns a bounding square around this position where this is the center of the square.inthashCode()toString()Returns the position locateddsteastern from this.Returns the position locateddstnorthern from this.Returns the position locateddstsouthern from this.Returns the position locateddstwestern from this.
-
Field Details
-
RADIUS_EARTH_KM
-
-
Constructor Details
-
Position
-
-
Method Details
-
getLatitude
-
getLongitude
-
distanceTo
-
walkNorth
-
walkSouth
-
walkEast
-
walkWest
-
getBoundingBox
Returns a bounding square around this position where this is the center of the square. Note, the result is the unexacter the larger the distance gets!- Parameters:
dst- the distance from this position to an edge of the square (so the total width of one side of the bounding box is 2 * dist).- Returns:
- two positions in an array where the fist element is the upper-left corner and the second element is the lower-right corner
-
equals
-
hashCode
-
toString
-