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

org.deegree.geometry
Class GeometryTransformer

java.lang.Object
  extended by org.deegree.crs.Transformer
      extended by org.deegree.geometry.GeometryTransformer
Direct Known Subclasses:
XMLTransformer

public class GeometryTransformer
extends Transformer

Transforms a geometry defined in a CoordinateSystem into a geometry defined in another CoordinateSystem

Version:
$Revision: 22818 $, $Date: 2010-03-03 17:32:26 +0100 (Mi, 03 Mrz 2010) $
Author:
Rutger Bezema, last edited by: $Author: rbezema $

Constructor Summary
GeometryTransformer(CoordinateSystem targetCRS)
          Creates a new GeometryTransformer object.
GeometryTransformer(String targetCRS)
          Creates a new GeometryTransformer object, with the given id as the target CRS.
GeometryTransformer(Transformation definedTransformation)
           
 
Method Summary
 Geometry transform(Geometry geo)
          transforms the coordinates of a deegree geometry to the target coordinate reference system.
 Geometry transform(Geometry geo, boolean testValidDomain)
          transforms the coordinates of a deegree geometry to the target coordinate reference system.
 Geometry transform(Geometry geo, CoordinateSystem sourceCRS)
          transforms the coordinates of a deegree geometry to the target coordinate reference system.
 Geometry transform(Geometry geom, CoordinateSystem sourceCRS, boolean testValidArea)
          transforms the coordinates of a deegree geometry to the target coordinate reference system.
 Geometry transform(Geometry geo, String sourceCRS)
          transforms the coordinates of a deegree geometry to the target coordinate reference 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

GeometryTransformer

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

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

GeometryTransformer

public GeometryTransformer(String targetCRS)
                    throws UnknownCRSException,
                           IllegalArgumentException
Creates a new GeometryTransformer 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.

GeometryTransformer

public GeometryTransformer(Transformation definedTransformation)
                    throws IllegalArgumentException
Parameters:
definedTransformation - to use instead of the CRSFactory.
Throws:
IllegalArgumentException - if the given parameter is null.
Method Detail

transform

public Geometry transform(Geometry geo)
                   throws TransformationException,
                          IllegalArgumentException,
                          UnknownCRSException
transforms the coordinates of a deegree geometry to the target coordinate reference system.

Parameters:
geo - to be transformed
Returns:
the same geometry in a different crs.
Throws:
TransformationException - if the transformation between the source and target crs cannot be created.
IllegalArgumentException - if the coordinates system of the geometry is null
UnknownCRSException

transform

public Geometry transform(Geometry geo,
                          boolean testValidDomain)
                   throws TransformationException,
                          IllegalArgumentException,
                          UnknownCRSException
transforms the coordinates of a deegree geometry to the target coordinate reference system. Optionally tests whether the given Geometry lies within the source crs' valid domain.

Parameters:
geo - to be transformed
testValidDomain - true if the incoming geometry should be checked against the domain of validity of the CoordinateSystem it is defined in.
Returns:
the same geometry in a different crs.
Throws:
TransformationException - if the transformation between the source and target crs cannot be created.
IllegalArgumentException - if the coordinates system of the geometry is null
UnknownCRSException

transform

public Geometry transform(Geometry geo,
                          String sourceCRS)
                   throws TransformationException,
                          IllegalArgumentException,
                          UnknownCRSException
transforms the coordinates of a deegree geometry to the target coordinate reference system.

Parameters:
geo - to be transformed
sourceCRS - the source CRS for the geometry. overwrites the CRS of the geometry.
Returns:
the same geometry in a different crs.
Throws:
TransformationException - if the transformation between the source and target crs cannot be created.
IllegalArgumentException - if the coordinates system of the geometry is null
UnknownCRSException - if the given CRS is not found

transform

public Geometry transform(Geometry geo,
                          CoordinateSystem sourceCRS)
                   throws TransformationException,
                          IllegalArgumentException
transforms the coordinates of a deegree geometry to the target coordinate reference system.

Parameters:
geo - to be transformed
sourceCRS - the source CRS for the geometry. overwrites the CRS of the geometry.
Returns:
the same geometry in a different crs.
Throws:
TransformationException - if the transformation between the source and target crs cannot be created.
IllegalArgumentException - if the coordinates system of the geometry is null

transform

public Geometry transform(Geometry geom,
                          CoordinateSystem sourceCRS,
                          boolean testValidArea)
                   throws IllegalArgumentException,
                          TransformationException
transforms the coordinates of a deegree geometry to the target coordinate reference system.

Parameters:
geom - to be transformed
sourceCRS - the source CRS for the geometry. overwrites the CRS of the geometry.
testValidArea - true if the geometry should be be checked of the valid area of the source crs.
Returns:
the same geometry in a different crs.
Throws:
IllegalArgumentException - if the coordinates system of the geometry is null
TransformationException - if the transformation between the source and target crs cannot be created.

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

]]>