org.deegree.cs
Class CoordinateTransformer

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

public class CoordinateTransformer
extends Transformer

Base class for transforming coordinates to new a coordinate reference systems.

Version:
$Revision: 29642 $, $Date: 2011-02-11 13:59:33 +0100 (Fri, 11 Feb 2011) $
Author:
Andreas Poth, last edited by: $Author: lbuesching $

Constructor Summary
CoordinateTransformer(ICRS 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(ICRS sourceCRS, double[] input, double[] out)
          Transforms a given coordinate into the CoordinateTransformer's coordinate system.
 List<javax.vecmath.Point3d> transform(ICRS sourceCRS, List<javax.vecmath.Point3d> points)
          Transforms all points to the CoordinateTransformer's coordinate system.
 
Methods inherited from class org.deegree.cs.Transformer
createCRSTransformation, createCRSTransformation, createCRSTransformation, getTargetCRS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoordinateTransformer

public CoordinateTransformer(ICRS 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(ICRS 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(ICRS 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


Copyright © 2011. All Rights Reserved.