public class

MapPos

extends Object
java.lang.Object
   ↳ com.carto.core.MapPos

Class Overview

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.

Summary

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
From class java.lang.Object

Public Constructors

public MapPos ()

Constructs a MapPos object. All coordinates will be 0.

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.

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.

Public Methods

public MapPos add (MapVec v)

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.

public synchronized void delete ()

public boolean equals (Object obj)

Checks if this object is equal to the specified object.

Parameters
obj The reference object.
Returns
  • True when objects are equal, false otherwise.

public double getX ()

Returns the x coordinate of this map position.

Returns
  • The x coordinate of this map position.

public double getY ()

Returns the y coordinate of this map position.

Returns
  • The y coordinate of this map position.

public double getZ ()

Returns the z coordinate of this map position.

Returns
  • The z coordinate of this map position.

public int hashCode ()

Returns the hash value of this object.

Returns
  • The hash value of this object.

public MapVec subPos (MapPos p)

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.

public MapPos subVec (MapVec v)

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.

public String toString ()

Creates a string representation of this map position, useful for logging.

Returns
  • The string representation of this map position.