org.deegree_impl.model.resources
Class OpenGIS

java.lang.Object
  extended byorg.deegree_impl.model.resources.OpenGIS

public final class OpenGIS
extends java.lang.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

Constructor Summary
private OpenGIS()
          Do not allow creation of instances of this class.
 
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 java.lang.String toWGS84String(CoordinateSystem cs, java.awt.geom.Rectangle2D bounds)
          Retourne une chaîne de caractères représentant la région géographique spécifiée.
static java.awt.geom.Rectangle2D transform(MathTransform2D transform, java.awt.geom.Rectangle2D source, java.awt.geom.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
 

Constructor Detail

OpenGIS

private OpenGIS()
Do not allow creation of instances of this class.

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 java.lang.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:
java.lang.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 java.awt.geom.Rectangle2D transform(MathTransform2D transform,
                                                  java.awt.geom.Rectangle2D source,
                                                  java.awt.geom.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 java.lang.String toWGS84String(CoordinateSystem cs,
                                             java.awt.geom.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.