deegree 2.1 (2007/11/08 09:57 build-328-official)

org.deegree.model.csct.resources
Class OpenGIS

java.lang.Object
  extended by org.deegree.model.csct.resources.OpenGIS

public final class OpenGIS
extends Object

A set of static methods working on OpenGIS objects. Some of those methods are useful, but not really rigorous. This is why they do not appear in the "official" package, but instead in this private one. Do not rely on this API! It may change in incompatible way in any future version.

Version:
1.0
Author:
Martin Desruisseaux

Method Summary
static CoordinateSystem getCoordinateSystem2D(CoordinateSystem cs)
          Returns a two-dimensional coordinate system representing the two first dimensions of the specified coordinate system.
static int getDimensionOf(CoordinateSystem cs, AxisInfo axis)
          Returns the dimension of the first axis of a particular type.
static HorizontalDatum getHorizontalDatum(CoordinateSystem cs)
          Returns the first horizontal datum found in a coordinate system, or null if there is none.
static TemporalDatum getTemporalDatum(CoordinateSystem cs)
          Returns the first temporal datum found in a coordinate system, or null if there is none.
static VerticalDatum getVerticalDatum(CoordinateSystem cs)
          Returns the first vertical datum found in a coordinate system, or null if there is none.
static String toWGS84String(CoordinateSystem cs, Rectangle2D bounds)
          Retourne une cha�ne de caract�res repr�sentant la r�gion g�ographique sp�cifi�e.
static Rectangle2D transform(MathTransform2D transform, Rectangle2D source, Rectangle2D dest)
          Transform an envelope.
static Envelope transform(MathTransform transform, Envelope envelope)
          Transform an envelope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDimensionOf

public static int getDimensionOf(CoordinateSystem cs,
                                 AxisInfo axis)
Returns the dimension of the first axis of a particular type. For example, getDimensionOf(cs, AxisInfo.TIME) would returns the dimension number of time axis.


getCoordinateSystem2D

public static CoordinateSystem getCoordinateSystem2D(CoordinateSystem cs)
                                              throws IllegalArgumentException
Returns a two-dimensional coordinate system representing the two first dimensions of the specified coordinate system. If cs is already a two-dimensional coordinate system, then it is returned unchanged. Otherwise, if it is a CompoundCoordinateSystem, then the head coordinate system is examined.

Parameters:
cs - The coordinate system.
Returns:
A two-dimensional coordinate system that represents the two first dimensions of cs.
Throws:
IllegalArgumentException - if cs can't be reduced to a two-coordinate system.

getHorizontalDatum

public static HorizontalDatum getHorizontalDatum(CoordinateSystem cs)
Returns the first horizontal datum found in a coordinate system, or null if there is none. Note: in a future version, we may implement this method directly into CoordinateSystem (not sure yet if it would be a good idea).


getVerticalDatum

public static VerticalDatum getVerticalDatum(CoordinateSystem cs)
Returns the first vertical datum found in a coordinate system, or null if there is none. Note: if a future version, we may implement this method directly into CoordinateSystem (not sure yet if it would be a good idea).


getTemporalDatum

public static TemporalDatum getTemporalDatum(CoordinateSystem cs)
Returns the first temporal datum found in a coordinate system, or null if there is none. Note: if a future version, we may implement this method directly into CoordinateSystem (not sure yet if it would be a good idea).


transform

public static Envelope transform(MathTransform transform,
                                 Envelope envelope)
                          throws TransformException
Transform an envelope. The transformation is only approximative.

Parameters:
transform - The transform to use.
envelope - Envelope to transform. This envelope will not be modified.
Returns:
The transformed envelope. It may not have the same number of dimensions than the original envelope.
Throws:
TransformException - if a transform failed.

transform

public static Rectangle2D transform(MathTransform2D transform,
                                    Rectangle2D source,
                                    Rectangle2D dest)
                             throws TransformException
Transform an envelope. The transformation is only approximative. Invoking this method is equivalent to invoking the following:
transform(transform, new Envelope(source)).toRectangle2D()

Parameters:
transform - The transform to use. Source and target dimension must be 2.
source - The rectangle to transform (may be null).
dest - The destination rectangle (may be source). If null, a new rectangle will be created and returned.
Returns:
dest, or a new rectangle if dest was non-null and source was null.
Throws:
TransformException - if a transform failed.

toWGS84String

public static String toWGS84String(CoordinateSystem cs,
                                   Rectangle2D bounds)
Retourne une cha�ne de caract�res repr�sentant la r�gion g�ographique sp�cifi�e. La cha�ne retourn�e sera de la forme "45�00.00'N-50�00.00'N 30�00.00'E-40�00.00'E". Si une projection cartographique est n�cessaire pour obtenir cette repr�sentation, elle sera faite automatiquement. Cette cha�ne sert surtout � des fins de d�boguage et sa forme peut varier.


deegree 2.1 (2007/11/08 09:57 build-328-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://deegree.sourceforge.net