java.lang.Object | |
↳ | com.carto.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.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
MapPos()
Constructs a MapPos object.
| |||||||||||
MapPos(double x, double y)
Constructs a MapPos object from 2 coordinates.
| |||||||||||
MapPos(double x, double y, double z)
Constructs a MapPos object from 3 coordinates.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
MapPos |
add(MapVec v)
Creates a new map position by adding a map vector to this map position.
| ||||||||||
synchronized void | delete() | ||||||||||
boolean |
equals(Object obj)
Checks if this object is equal to the specified object.
| ||||||||||
double |
getX()
Returns the x coordinate of this map position.
| ||||||||||
double |
getY()
Returns the y coordinate of this map position.
| ||||||||||
double |
getZ()
Returns the z coordinate of this map position.
| ||||||||||
int |
hashCode()
Returns the hash value of this object.
| ||||||||||
MapVec |
subPos(MapPos p)
Creates a new map vector by subtracting a map position from this map position.
| ||||||||||
MapPos |
subVec(MapVec v)
Creates a new map position by subtracting a map vector from this map position.
| ||||||||||
String |
toString()
Creates a string representation of this map position, useful for logging.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Constructs a MapPos object. All coordinates will be 0.
Constructs a MapPos object from 2 coordinates. The z coordinate will be 0.
x | The x coordinate. |
---|---|
y | The y coordinate. |
Constructs a MapPos object from 3 coordinates.
x | The x coordinate. |
---|---|
y | The y coordinate. |
z | The z coordinate. |
Creates a new map position by adding a map vector to this map position.
v | The map vector to be added. |
---|
Checks if this object is equal to the specified object.
obj | The reference object. |
---|
Returns the x coordinate of this map position.
Returns the y coordinate of this map position.
Returns the z coordinate of this map position.
Returns the hash value of this object.
Creates a new map vector by subtracting a map position from this map position.
p | The map position to be subtracted. |
---|
Creates a new map position by subtracting a map vector from this map position.
v | The map vector to be subtracted. |
---|
Creates a string representation of this map position, useful for logging.