Class Position
- java.lang.Object
-
- org.geolatte.geom.Position
-
public abstract class Position extends Object
Represents a position in a coordinate system.A
Positionis 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
CoordinateReferenceSystemused with thePosition.- Author:
- Karel Maesen, Geovise BVBA creation-date: 2/19/14
-
-
Field Summary
Fields Modifier and Type Field Description protected double[]coords
-
Constructor Summary
Constructors Modifier Constructor Description protectedPosition(double... coords)Constructs an instance with the specified coordinates
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(Object o)doublegetCoordinate(int idx)Returns the coordinate at the specified indexdoublegetCoordinate(CoordinateSystemAxis axis)doublegetCoordinate(CoordinateSystemAxis axis, CoordinateReferenceSystem<?> crs)Deprecated.abstract intgetCoordinateDimension()inthashCode()booleanisEmpty()double[]toArray(double[] dest)Copies the coordinates of thisPositionin the specified Array, in normal order.StringtoString()
-
-
-
Method Detail
-
toArray
public double[] toArray(double[] dest)
Copies the coordinates of thisPositionin 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.
- Parameters:
dest- the recipient of the coordinates of this instance (if large enough)- Returns:
- an array (possibly the same instance as specified by dest) holding the coordinates of this
Position
-
getCoordinateDimension
public abstract int getCoordinateDimension()
-
isEmpty
public boolean isEmpty()
-
getCoordinate
public double getCoordinate(int idx)
Returns the coordinate at the specified indexNote that the index here refers to the coordinates ordered in a normalized order.
- Parameters:
idx- the index of the coordinate (0-based)- Returns:
- the coordinate value at the specified index.
-
getCoordinate
@Deprecated public double getCoordinate(CoordinateSystemAxis axis, CoordinateReferenceSystem<?> crs)
Deprecated.Gets the coordinate value for the specified axis- Parameters:
axis- the CoordinateSystemAxis for which to get the coordinate- Returns:
- the coordinate value for the specified axis
- Throws:
IllegalArgumentException- if the specified axis is not present in theCoordinateReferenceSystemof this instance
-
getCoordinate
public double getCoordinate(CoordinateSystemAxis axis)
-
-