Package org.geolatte.geom.crs
Class CoordinateSystem<P extends Position>
- java.lang.Object
-
- org.geolatte.geom.crs.CoordinateSystem<P>
-
- Type Parameters:
P- the Position type for the system
- Direct Known Subclasses:
CartesianCoordinateSystem2D,CartesianCoordinateSystem2DM,CartesianCoordinateSystem3D,CartesianCoordinateSystem3DM,EllipsoidalCoordinateSystem2D,EllipsoidalCoordinateSystem2DM,EllipsoidalCoordinateSystem3D,EllipsoidalCoordinateSystem3DM,OneDimensionCoordinateSystem
public abstract class CoordinateSystem<P extends Position> extends Object
A coordinate system.A coordinate system is characterized by its
CoordinateSystemAxes(in order).- Author:
- Karel Maesen, Geovise BVBA creation-date: 4/29/11
-
-
Constructor Summary
Constructors Constructor Description CoordinateSystem(CoordinateSystemAxis... axes)Constructs aCoordinateSystem.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)abstract CoordinateSystem<?>extend(CoordinateSystemAxis axis)Create a new coordinate system with the axes of this system plus the specified axisCoordinateSystemAxis[]getAxes()Returns theCoordinateSystemAxesof thisCoordinateSystem(in order).CoordinateSystemAxisgetAxis(int index)Returns theCoordinateSystemAxisat the specified position.List<CoordinateSystemAxisDirection>getAxisDirections()Returns a list of all the directions of this systemsCoordinateSystemAxisgetAxisForComponentIndex(int i)Return the axis that corresponds to the i-th element in the coordinates for aPositionin thisCoordinateSystem.intgetAxisIndex(CoordinateSystemAxis axis)Returns the position of the specifiedCoordinateSystemAxisin thisCoordinateSystem, or -1 if it is not an axis of this instance.List<Integer>getAxisNormalOrder()Returns the normal order value for the axes of this systems in the order that the axes have been defined for this system.UnitgetAxisUnit(int index)Returns theUnitof the axis at the specified position.intgetCoordinateDimension()Returns the coordinate dimension, i.e.abstract Class<P>getPositionClass()inthashCode()abstract booleanhasM()does the system have a Measure axis?abstract booleanhasZ()Does the coordinate system have a Vertical or Z axis?abstract CoordinateSystem<?>merge(OneDimensionCoordinateSystem<?> coordinateSystem)Create a coordinate system that merges this instance with the specified system
-
-
-
Constructor Detail
-
CoordinateSystem
public CoordinateSystem(CoordinateSystemAxis... axes)
Constructs aCoordinateSystem.CoordinateSystems are characterized by theirCoordinateSystemAxes.- Parameters:
axes- the sequence (at least two) of itsCoordinateSystems.- Throws:
IllegalArgumentException- when less than two axes are specified, or when an argument is null.
-
-
Method Detail
-
getAxes
public CoordinateSystemAxis[] getAxes()
Returns theCoordinateSystemAxesof thisCoordinateSystem(in order).- Returns:
-
getAxisDirections
public List<CoordinateSystemAxisDirection> getAxisDirections()
Returns a list of all the directions of this systems- Returns:
- a List of Coordinate system axis directions.
-
getAxisNormalOrder
public List<Integer> getAxisNormalOrder()
Returns the normal order value for the axes of this systems in the order that the axes have been defined for this system.- Returns:
- a List of Coordinate system axis directions.
-
getCoordinateDimension
public int getCoordinateDimension()
Returns the coordinate dimension, i.e. the number of axes in this coordinate system.- Returns:
-
getAxisIndex
public int getAxisIndex(CoordinateSystemAxis axis)
Returns the position of the specifiedCoordinateSystemAxisin thisCoordinateSystem, or -1 if it is not an axis of this instance.- Parameters:
axis-- Returns:
-
getAxisForComponentIndex
public CoordinateSystemAxis getAxisForComponentIndex(int i)
Return the axis that corresponds to the i-th element in the coordinates for aPositionin thisCoordinateSystem.- Parameters:
i- the 0-base index for a coordinate- Returns:
- the axis
- Throws:
IndexOutOfBoundsException- if i > getCoordinateDimension() - 1
-
getAxis
public CoordinateSystemAxis getAxis(int index)
Returns theCoordinateSystemAxisat the specified position.- Parameters:
index-- Returns:
-
getAxisUnit
public Unit getAxisUnit(int index)
Returns theUnitof the axis at the specified position.- Parameters:
index-- Returns:
-
merge
public abstract CoordinateSystem<?> merge(OneDimensionCoordinateSystem<?> coordinateSystem)
Create a coordinate system that merges this instance with the specified system- Parameters:
coordinateSystem- the system to merge with- Returns:
- a new
CoordinateSystem - Throws:
UnsupportedOperationException- if no supported coordinate system can represent the merge
-
extend
public abstract CoordinateSystem<?> extend(CoordinateSystemAxis axis)
Create a new coordinate system with the axes of this system plus the specified axis- Parameters:
axis- the additional axis- Returns:
- a new
CoordinateSystem - Throws:
UnsupportedOperationException- if no supported coordinate system can contain the axes.
-
hasZ
public abstract boolean hasZ()
Does the coordinate system have a Vertical or Z axis?- Returns:
-
hasM
public abstract boolean hasM()
does the system have a Measure axis?- Returns:
-
-