public abstract class Position extends Object
A Position
is represented by an array of coordinates. There must be at least two coordinates.
The order of coordinates must follow the order: x, y, z, measure (easting, northing, altitude, measure) for coordinates in a projected coordinate reference system, or longitude, latitude, altitude, measure for coordinates in a geographic coordinate reference system).
Usually the first coordinate value (X or Lon) increases along an EAST axis direction, and the second (Y or Lat)
along an NORTH axis direction. In some projected coordinate systems, such as those used in South-Africa,
the orientation is WEST for the first and SOUTH for the second coordinate value. To be sure of the interpretation
of the first and second coordinate, you can inspect the CoordinateReferenceSystem
used with the
Position
.
Modifier and Type | Field and Description |
---|---|
protected double[] |
coords |
Modifier | Constructor and Description |
---|---|
protected |
Position(double... coords)
Constructs an instance with the specified coordinates
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
double |
getCoordinate(CoordinateSystemAxis axis,
CoordinateReferenceSystem<?> crs)
Gets the coordinate value for the specified axis
|
double |
getCoordinate(int idx)
Returns the coordinate at the specified index
|
abstract int |
getCoordinateDimension() |
int |
hashCode() |
boolean |
isEmpty() |
double[] |
toArray(double[] dest)
Copies the coordinates of this
Position in the specified Array, in normal order. |
String |
toString() |
protected Position(double... coords)
coords
- public double[] toArray(double[] dest)
Position
in the specified Array, in normal order.
If the array is null or smaller than the coordinate dimension, then a new Array instance will be created.
dest
- the recipient of the coordinates of this instance (if large enough)Position
public abstract int getCoordinateDimension()
public boolean isEmpty()
public double getCoordinate(int idx)
Note that the index here refers to the coordinates ordered in a normalized order.
idx
- the index of the coordinate (0-based)public double getCoordinate(CoordinateSystemAxis axis, CoordinateReferenceSystem<?> crs)
axis
- the CoordinateSystemAxis for which to get the coordinateIllegalArgumentException
- if the specified axis is not present in the CoordinateReferenceSystem
of this instanceCopyright © 2015 geolatte.org. All rights reserved.