SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A class representing a coordinate.
Author: BRE, JANConstructor Summary | |
IWCoordinate(x, y, projection)
Creates a new coordinate. If x and y are not specified (0, 0) is returned.
|
Method Summary | |
IWCoordinate
|
clone()
Returns a new instance of this object. |
number
|
distanceFrom(other)
Returns the distance between this coordinate and another one in meters. |
boolean
|
equals(other)
Checks whether this coordinate equals another one (or is very close to it, i.e. |
String
|
getProjectionType()
|
double
|
getX()
Returns the horizontal position of this coordinate. |
double
|
getY()
Returns the vertical position of this coordinate in meters. |
void
|
setProjectionType(projectionType)
|
void
|
setX(x)
Sets the horizontal position of this coordinate. |
void
|
setY(y)
Sets the vertical position of this coordinate in meters. |
String
|
toFormattedString()
Returns a compact string representation of this coordinate. For WGS84 coordinates this is latitude, longitude (e.g. in all other cases x, y (e.g. "794920, 6568663"). |
IWCoordinate
|
toMercator()
Returns the Mercator coordinate as a new IWCoordinate object.
|
String
|
toString()
Returns a string representation of this coordinate. |
IWCoordinate
|
toWGS84()
Returns the WGS84 coordinate as a new IWCoordinate object.
|
Constructor Detail |
IWCoordinate(x, y, projection)
x
and y
are not specified (0, 0) is returned.
double x
- horizontal coordinate
double y
- vertical coordinate
int projection
- projection type of this coordinate (optional, default is Mercator)
Method Detail |
IWCoordinate clone()
IWCoordinate
number distanceFrom(other)
IWCoordinate other
- another coordinate
number
boolean equals(other)
IWCoordinate other
- another coordinate
boolean
String getProjectionType()
String
double getX()
double
double getY()
double
void setProjectionType(projectionType)
String projectionType
void
void setX(x)
double x
void
void setY(y)
double y
void
String toFormattedString()
String
the coordinate string
IWCoordinate toMercator()
new IWCoordinate
object.
IWCoordinate
String toString()
String
IWCoordinate toWGS84()
new IWCoordinate
object.
IWCoordinate