SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A class representing a coordinate.
Constructor 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()
Returns the projection type. |
number
|
getX()
Returns the horizontal position of this coordinate. |
number
|
getY()
Returns the vertical position of this coordinate in meters. |
void
|
setProjectionType(projectionType)
Sets the projection type. |
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()
Projects the coordinate to Mercator. Returns a copy of the coordinate if it already is in Mercator. |
String
|
toString()
Returns a string representation of this coordinate. |
IWCoordinate
|
toWGS84()
Projects the coordinate to WGS 84. Returns a copy of the coordinate if it already is in WGS 84. |
Constructor Detail |
IWCoordinate(x, y, projection)
x
and y
are not specified (0, 0) is returned.
number x
- horizontal coordinate
number y
- vertical coordinate
String 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
number getX()
number
number getY()
number
void setProjectionType(projectionType)
String projectionType
void
void setX(x)
number x
void
void setY(y)
number y
void
String toFormattedString()
String
the coordinate string
IWCoordinate toMercator()
IWCoordinate
String toString()
String
IWCoordinate toWGS84()
IWCoordinate