Class Altitude
- java.lang.Object
-
- org.jscience.geography.coordinates.Coordinates<VerticalCRS<?>>
-
- org.jscience.geography.coordinates.Altitude
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<Measurable<Length>>
,Measurable<Length>
,javolution.lang.Immutable
,javolution.lang.Realtime
,javolution.lang.ValueType
,javolution.xml.XMLSerializable
,org.opengis.spatialschema.geometry.DirectPosition
,org.opengis.spatialschema.geometry.geometry.Position
,org.opengis.util.Cloneable
public final class Altitude extends Coordinates<VerticalCRS<?>> implements Measurable<Length>
This class represents the Mean-Sea-Levelvertical
altitude (MSL).Note: The current implementation approximates the MSL altitude to the WGS-86 Ellipsoid Height. Future implementations will use lookup tables in order to correct for regional discrepencies.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static VerticalCRS<Altitude>
CRS
Holds the coordinate reference system for all instances of this class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Measurable<Length> measure)
Altitude
copy()
Returns a copy of these coordinatesallocated
by the calling thread (possibly on the stack).double
doubleValue(Unit<Length> unit)
Returns the value of this measurable stated in the specified unit as adouble
.VerticalCRS<?>
getCoordinateReferenceSystem()
Returns the reference system for this coordinates.int
getDimension()
OpenGIS® - The length of coordinate sequence (the number of entries).double
getOrdinate(int dimension)
OpenGIS® - Returns the ordinate at the specified dimension.long
longValue(Unit<Length> unit)
Returns the estimated integral value of this measurable stated in the specified unit as along
.static Altitude
valueOf(double value, Unit<Length> unit)
Returns the vertical position corresponding to the specified coordinates.-
Methods inherited from class org.jscience.geography.coordinates.Coordinates
clone, getCoordinates, getPosition, setOrdinate, toString, toText
-
-
-
-
Field Detail
-
CRS
public static final VerticalCRS<Altitude> CRS
Holds the coordinate reference system for all instances of this class.
-
-
Method Detail
-
valueOf
public static Altitude valueOf(double value, Unit<Length> unit)
Returns the vertical position corresponding to the specified coordinates.- Parameters:
value
- the mean sea level altitude stated in the specified unit.unit
- the length unit in which the altitude is stated.- Returns:
- the corresponding vertical position.
-
getCoordinateReferenceSystem
public VerticalCRS<?> getCoordinateReferenceSystem()
Description copied from class:Coordinates
Returns the reference system for this coordinates.- Specified by:
getCoordinateReferenceSystem
in interfaceorg.opengis.spatialschema.geometry.DirectPosition
- Specified by:
getCoordinateReferenceSystem
in classCoordinates<VerticalCRS<?>>
- Returns:
- the associated coordinate reference system.
-
getDimension
public int getDimension()
Description copied from class:Coordinates
OpenGIS® - The length of coordinate sequence (the number of entries). This is determined by the coordinate reference system.- Specified by:
getDimension
in interfaceorg.opengis.spatialschema.geometry.DirectPosition
- Specified by:
getDimension
in classCoordinates<VerticalCRS<?>>
- Returns:
- the dimensionality of this position.
-
getOrdinate
public double getOrdinate(int dimension) throws IndexOutOfBoundsException
Description copied from class:Coordinates
OpenGIS® - Returns the ordinate at the specified dimension.- Specified by:
getOrdinate
in interfaceorg.opengis.spatialschema.geometry.DirectPosition
- Specified by:
getOrdinate
in classCoordinates<VerticalCRS<?>>
- Parameters:
dimension
- The dimension in the range 0 to dimension-1.- Returns:
- The coordinate at the specified dimension.
- Throws:
IndexOutOfBoundsException
- if the specified dimension is out of bounds.
-
doubleValue
public final double doubleValue(Unit<Length> unit)
Description copied from interface:Measurable
Returns the value of this measurable stated in the specified unit as adouble
. If the measurable has too great a magnitude to be represented as adouble
, it will be converted toDouble.NEGATIVE_INFINITY
orDouble.POSITIVE_INFINITY
as appropriate.- Specified by:
doubleValue
in interfaceMeasurable<Length>
- Parameters:
unit
- the unit in which this measurable value is stated.- Returns:
- the numeric value after conversion to type
double
.
-
longValue
public final long longValue(Unit<Length> unit)
Description copied from interface:Measurable
Returns the estimated integral value of this measurable stated in the specified unit as along
.Note: This method differs from the
Number.longValue()
in the sense that the closest integer value is returned and an ArithmeticException is raised instead of a bit truncation in case of overflow (safety critical).- Specified by:
longValue
in interfaceMeasurable<Length>
- Parameters:
unit
- the unit in which the measurable value is stated.- Returns:
- the numeric value after conversion to type
long
.
-
compareTo
public int compareTo(Measurable<Length> measure)
- Specified by:
compareTo
in interfaceComparable<Measurable<Length>>
-
copy
public Altitude copy()
Description copied from class:Coordinates
Returns a copy of these coordinatesallocated
by the calling thread (possibly on the stack).- Specified by:
copy
in interfacejavolution.lang.ValueType
- Specified by:
copy
in classCoordinates<VerticalCRS<?>>
- Returns:
- an identical and independant copy of these coordinates .
-
-