org.deegree_impl.model.cs
Class CoordinateSystem

java.lang.Object
  extended byorg.deegree_impl.model.cs.Info
      extended byorg.deegree_impl.model.cs.CoordinateSystem
All Implemented Interfaces:
Dimensioned, java.io.Serializable
Direct Known Subclasses:
CompoundCoordinateSystem, GeocentricCoordinateSystem, HorizontalCoordinateSystem, LocalCoordinateSystem, TemporalCoordinateSystem, VerticalCoordinateSystem

public abstract class CoordinateSystem
extends Info
implements Dimensioned

Base class for all coordinate systems. A coordinate system is a mathematical space, where the elements of the space are called positions. Each position is described by a list of numbers. The length of the list corresponds to the dimension of the coordinate system. So in a 2D coordinate system each position is described by a list containing 2 numbers.

However, in a coordinate system, not all lists of numbers correspond to a position - some lists may be outside the domain of the coordinate system. For example, in a 2D Lat/Lon coordinate system, the list (91,91) does not correspond to a position.

Some coordinate systems also have a mapping from the mathematical space into locations in the real world. So in a Lat/Lon coordinate system, the mathematical position (lat, long) corresponds to a location on the surface of the Earth. This mapping from the mathematical space into real-world locations is called a Datum.

Version:
1.00
Author:
OpenGIS (www.opengis.org), Martin Desruisseaux
See Also:
CS_CoordinateSystem, Serialized Form

Nested Class Summary
(package private)  class CoordinateSystem.Export
          Wrap a CoordinateSystem object for use with OpenGIS.
 
Nested classes inherited from class org.deegree_impl.model.cs.Info
Info.AngularUnit, Info.LinearUnit
 
Field Summary
private static long serialVersionUID
          Serial number for interoperability with different versions.
 
Fields inherited from class org.deegree_impl.model.cs.Info
pool
 
Constructor Summary
(package private) CoordinateSystem(java.util.Map properties)
          Construct a coordinate system.
  CoordinateSystem(java.lang.String name)
          Construct a coordinate system.
 
Method Summary
(package private)  void checkAxis(DatumType type)
          Make sure there is no axis among the same direction (e.g. two north axis, or a east and a west axis).
 boolean equals(java.lang.Object object)
          Compares the specified object with this coordinate system for equality.
 boolean equivalents(CoordinateSystem cs)
          Returns true if this coordinate system is equivalents to the specified coordinate system.
abstract  AxisInfo getAxis(int dimension)
          Gets axis details for dimension within coordinate system.
(package private)  Datum getDatum()
          Returns the datum.
 Envelope getDefaultEnvelope()
          Gets default envelope of coordinate system.
abstract  int getDimension()
          Returns the dimension of the coordinate system.
(package private)  Unit getUnits()
          If all dimensions use the same units, returns this units.
abstract  Unit getUnits(int dimension)
          Gets units for dimension within coordinate system.
(package private)  java.lang.Object toOpenGIS(java.lang.Object adapters)
          Returns an OpenGIS interface for this coordinate system.
 
Methods inherited from class org.deegree_impl.model.cs.Info
addString, addUnit, cachedOpenGIS, ensureAngularUnit, ensureLinearUnit, ensureNonNull, ensureNonNull, ensureTimeUnit, getAbbreviation, getAlias, getAuthority, getAuthorityCode, getName, getRemarks, hashCode, readResolve, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial number for interoperability with different versions.

See Also:
Constant Field Values
Constructor Detail

CoordinateSystem

public CoordinateSystem(java.lang.String name)
Construct a coordinate system.

Parameters:
name - The coordinate system name.

CoordinateSystem

CoordinateSystem(java.util.Map properties)
Construct a coordinate system.

Parameters:
properties - The set of properties (see Info).
Method Detail

checkAxis

final void checkAxis(DatumType type)
              throws java.lang.IllegalArgumentException
Make sure there is no axis among the same direction (e.g. two north axis, or a east and a west axis). This methods may be invoked from subclasses constructors.

Parameters:
type - The datum type, or null if unknow.
Throws:
java.lang.IllegalArgumentException - if two axis have the same direction.

getDimension

public abstract int getDimension()
Returns the dimension of the coordinate system.

Specified by:
getDimension in interface Dimensioned
See Also:
CS_CoordinateSystem.getDimension()

getAxis

public abstract AxisInfo getAxis(int dimension)
Gets axis details for dimension within coordinate system. Each dimension in the coordinate system has a corresponding axis.

Parameters:
dimension - Zero based index of axis.
See Also:
CS_CoordinateSystem.getAxis(int)

getUnits

public abstract Unit getUnits(int dimension)
Gets units for dimension within coordinate system. Each dimension in the coordinate system has corresponding units.

Parameters:
dimension - Zero based index of axis.
See Also:
CS_CoordinateSystem.getUnits(int)

getUnits

final Unit getUnits()
If all dimensions use the same units, returns this units. Otherwise, returns null.


getDatum

Datum getDatum()
Returns the datum.


getDefaultEnvelope

public Envelope getDefaultEnvelope()
Gets default envelope of coordinate system. Coordinate systems which are bounded should return the minimum bounding box of their domain. Unbounded coordinate systems should return a box which is as large as is likely to be used. For example, a (lon,lat) geographic coordinate system in degrees should return a box from (-180,-90) to (180,90), and a geocentric coordinate system could return a box from (-r,-r,-r) to (+r,+r,+r) where r is the approximate radius of the Earth.

The default implementation returns an envelope with infinite bounds.

See Also:
CS_CoordinateSystem.getDefaultEnvelope()

equivalents

public boolean equivalents(CoordinateSystem cs)
Returns true if this coordinate system is equivalents to the specified coordinate system. Two coordinate systems are considered equivalent if the CoordinateTransformation from this to cs would be the identity transform. The equivalents method is less strict than equals in that it doesn't compare names, alias, authority codes or others similar informations.

Parameters:
cs - The coordinate system (may be null).
Returns:
true if both coordinate systems are equivalent.

equals

public boolean equals(java.lang.Object object)
Compares the specified object with this coordinate system for equality.

Overrides:
equals in class Info

toOpenGIS

java.lang.Object toOpenGIS(java.lang.Object adapters)
Returns an OpenGIS interface for this coordinate system. The returned object is suitable for RMI use. Note: The returned type is a generic Object in order to avoid too early class loading of OpenGIS interface.

Overrides:
toOpenGIS in class Info