Package com.massifmaps.core
Class MapPos
java.lang.Object
com.massifmaps.core.MapPos
A double precision map position defined using three coordinates. X and y coordinates denote positions on the map,
while z coordinate is height from the ground plane. Actual units for x, y and z depend on map projection.
For example, in EPSG:4326 x is used for latitude, y for longitude and z for height in meters.
while z coordinate is height from the ground plane. Actual units for x, y and z depend on map projection.
For example, in EPSG:4326 x is used for latitude, y for longitude and z for height in meters.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new map position by adding a map vector to this map position.booleanChecks if this object is equal to the specified object.doublegetX()Returns the x coordinate of this map position.doublegetY()Returns the y coordinate of this map position.doublegetZ()Returns the z coordinate of this map position.inthashCode()Returns the hash value of this object.Creates a new map vector by subtracting a map position from this map position.Creates a new map position by subtracting a map vector from this map position.toString()Creates a string representation of this map position, useful for logging.
-
Constructor Details
-
MapPos
public MapPos()Constructs a MapPos object. All coordinates will be 0. -
MapPos
public MapPos(double x, double y) Constructs a MapPos object from 2 coordinates. The z coordinate will be 0.- Parameters:
x- The x coordinate.y- The y coordinate.
-
MapPos
public MapPos(double x, double y, double z) Constructs a MapPos object from 3 coordinates.- Parameters:
x- The x coordinate.y- The y coordinate.z- The z coordinate.
-
-
Method Details
-
equals
Checks if this object is equal to the specified object. -
hashCode
public int hashCode()Returns the hash value of this object. -
getX
public double getX()Returns the x coordinate of this map position.- Returns:
- The x coordinate of this map position.
-
getY
public double getY()Returns the y coordinate of this map position.- Returns:
- The y coordinate of this map position.
-
getZ
public double getZ()Returns the z coordinate of this map position.- Returns:
- The z coordinate of this map position.
-
add
Creates a new map position by adding a map vector to this map position.- Parameters:
v- The map vector to be added.- Returns:
- The new map position.
-
subVec
Creates a new map position by subtracting a map vector from this map position.- Parameters:
v- The map vector to be subtracted.- Returns:
- The new map position.
-
subPos
Creates a new map vector by subtracting a map position from this map position.- Parameters:
p- The map position to be subtracted.- Returns:
- The new map vector.
-
toString
Creates a string representation of this map position, useful for logging.
-