org.deegree.cs.transformations
Class TransformationFactory

java.lang.Object
  extended by org.deegree.cs.transformations.TransformationFactory

public class TransformationFactory
extends Object

The TransformationFactory class is the central access point for all transformations between different crs's.

It creates a transformation chain for two given ICoordinateSystems by considering their type. For example the Transformation chain from EPSG:31466 ( a projected crs with underlying geographic crs epsg:4314 using the DHDN datum and the TransverseMercator Projection) to EPSG:28992 (another projected crs with underlying geographic crs epsg:4289 using the 'new Amersfoort Datum' and the StereographicAzimuthal Projection) would result in following Transformation Chain:

  1. Inverse projection - thus getting the coordinates in lat/lon for geographic crs epsg:4314
  2. Geodetic transformation - thus getting x-y-z coordinates for geographic crs epsg:4314
  3. WGS84 transformation -thus getting the x-y-z coordinates for the WGS84 datum
  4. Inverse WGS84 transformation -thus getting the x-y-z coordinates for the geodetic from epsg:4289
  5. Inverse geodetic - thus getting the lat/lon for epsg:4289
  6. projection - getting the coordinates (in meters) for epsg:28992

Version:
$Revision: 31960 $, $Date: 2011-09-21 08:00:30 +0200 (Wed, 21 Sep 2011) $
Author:
Rutger Bezema, last edited by: $Author: lbuesching $

Nested Class Summary
static class TransformationFactory.DSTransform
          Defines the type of transformation to use while switching datums.
 
Constructor Summary
TransformationFactory(CRSStore provider)
          The default coordinate transformation factory.
 
Method Summary
 Transformation createFromCoordinateSystems(ICRS sourceCRS, ICRS targetCRS)
          Creates a transformation between two coordinate systems.
 Transformation createFromCoordinateSystems(ICRS sourceCRS, ICRS targetCRS, List<Transformation> transformationsToBeUsed)
          Creates a transformation between two coordinate systems.
static IGeographicCRS createWGSAlligned(IGeographicCRS sourceCRS)
          Create a new geographic crs with the same axis as the wgs.
static boolean isIdentity(Transformation transformation)
          True if the transformation is null || it's an identity ( Transformation.isIdentity().
 void setPreferredTransformation(TransformationFactory.DSTransform datumTransform)
          Set the default transformation type to use for datum switching.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformationFactory

public TransformationFactory(CRSStore provider)
The default coordinate transformation factory. Will be constructed only when first needed.

Parameters:
provider - used to do lookups of transformations
Method Detail

setPreferredTransformation

public void setPreferredTransformation(TransformationFactory.DSTransform datumTransform)
Set the default transformation type to use for datum switching.

Parameters:
datumTransform - to be used preferably.

createFromCoordinateSystems

public Transformation createFromCoordinateSystems(ICRS sourceCRS,
                                                  ICRS targetCRS)
                                           throws TransformationException,
                                                  IllegalArgumentException
Creates a transformation between two coordinate systems. This method will examine the coordinate systems in order to construct a transformation between them.

Parameters:
sourceCRS - Input coordinate system.
targetCRS - Output coordinate system.
Returns:
A coordinate transformation from sourceCRS to targetCRS.
Throws:
TransformationException
TransformationException - if no transformation path has been found.
IllegalArgumentException - if the sourceCRS or targetCRS are null.

createFromCoordinateSystems

public Transformation createFromCoordinateSystems(ICRS sourceCRS,
                                                  ICRS targetCRS,
                                                  List<Transformation> transformationsToBeUsed)
                                           throws TransformationException
Creates a transformation between two coordinate systems. This method will examine the coordinate systems in order to construct a transformation between them. The given list of transformations is taken into consideration.

Parameters:
sourceCRS - Input coordinate system.
targetCRS - Output coordinate system.
transformationsToBeUsed -
Returns:
A coordinate transformation from sourceCRS to targetCRS.
Throws:
TransformationException
TransformationException - if no transformation path has been found.
IllegalArgumentException - if the sourceCRS or targetCRS are null.

createWGSAlligned

public static final IGeographicCRS createWGSAlligned(IGeographicCRS sourceCRS)
Create a new geographic crs with the same axis as the wgs.

Parameters:
sourceCRS -
Returns:
a new crs with same axis as wgs84.

isIdentity

public static final boolean isIdentity(Transformation transformation)
True if the transformation is null || it's an identity ( Transformation.isIdentity().

Parameters:
transformation - to check for.
Returns:
true if the given transformation is null or an identity.


Copyright © 2011. All Rights Reserved.