deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

org.deegree.crs
Class CoordinateTransformer

java.lang.Object
  extended by org.deegree.crs.Transformer
      extended by org.deegree.crs.CoordinateTransformer

public class CoordinateTransformer
extends Transformer

Class for transforming coordinates to new a coordinate reference systems.

Version:
$Revision: 20127 $, $Date: 2009-10-14 17:04:57 +0200 (Mi, 14 Okt 2009) $
Author:
Andreas Poth, last edited by: $Author: mschneider $

Constructor Summary
CoordinateTransformer(CoordinateSystem targetCRS)
          Creates a new CoordinateTransformer object.
CoordinateTransformer(String targetCRS)
          Creates a new CoordinateTransformer object, with the given id as the target CRS.
CoordinateTransformer(Transformation transformation)
          Creates a new CoordinateTransformer object, with the given id as the target CRS.
 
Method Summary
 double[] transform(CoordinateSystem sourceCRS, double[] input, double[] out)
          Transforms a given coordinate into the CoordinateTransformer's coordinate system.
 List<javax.vecmath.Point3d> transform(CoordinateSystem sourceCRS, List<javax.vecmath.Point3d> points)
          Transforms all points to the CoordinateTransformer's coordinate system.
 
Methods inherited from class org.deegree.crs.Transformer
createCRSTransformation, createCRSTransformation, getTargetCRS, getWrappedTargetCRS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoordinateTransformer

public CoordinateTransformer(CoordinateSystem targetCRS)
                      throws IllegalArgumentException
Creates a new CoordinateTransformer object.

Parameters:
targetCRS -
Throws:
IllegalArgumentException - if the given parameter is null.

CoordinateTransformer

public CoordinateTransformer(String targetCRS)
                      throws UnknownCRSException,
                             IllegalArgumentException
Creates a new CoordinateTransformer object, with the given id as the target CRS.

Parameters:
targetCRS - an identifier to which all other CRS's shall be transformed.
Throws:
UnknownCRSException - if the given crs name could not be mapped to a valid (configured) crs.
IllegalArgumentException - if the given parameter is null.

CoordinateTransformer

public CoordinateTransformer(Transformation transformation)
                      throws IllegalArgumentException
Creates a new CoordinateTransformer object, with the given id as the target CRS.

Parameters:
transformation - to be used.
Throws:
IllegalArgumentException - if the given parameter is null.
Method Detail

transform

public List<javax.vecmath.Point3d> transform(CoordinateSystem sourceCRS,
                                             List<javax.vecmath.Point3d> points)
                                      throws TransformationException,
                                             IllegalArgumentException
Transforms all points to the CoordinateTransformer's coordinate system.

Parameters:
sourceCRS - in which the given points are referenced.
points - to transform.
Returns:
a list of transformed point3d's or an empty list if something went wrong, never null
Throws:
TransformationException - if no transformation could be created for the given source and target crs.
IllegalArgumentException - if the sourceCRS is null

transform

public double[] transform(CoordinateSystem sourceCRS,
                          double[] input,
                          double[] out)
                   throws IllegalArgumentException,
                          TransformationException
Transforms a given coordinate into the CoordinateTransformer's coordinate system.

Parameters:
sourceCRS - crs of the input coordinate, must not be null
input - input coordinate, must not be null and array length must match the number of dimensions of sourceCRS
out - output coordinate, used to store the transformed ordinates, must not be null and array length must match the number of dimensions of the target crs
Returns:
transformed coordinate, this is the same instance as out
Throws:
TransformationException
IllegalArgumentException

deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

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

]]>