deegree 2.2 (2008/12/22 11:33 build-3038-official)

org.deegree.model.crs
Class GeoTransformer

java.lang.Object
  extended by org.deegree.model.crs.GeoTransformer

public class GeoTransformer
extends Object

class for transforming deegree geometries to new coordinate reference systems.

------------------------------------------------------------

Version:
$Revision: 11341 $, $Date: 2008-04-22 12:08:33 +0200 (Di, 22 Apr 2008) $
Author:
Andreas Poth, last edited by: $Author: rbezema $

Constructor Summary
GeoTransformer(CoordinateSystem targetCRS)
          Creates a new GeoTransformer object.
GeoTransformer(String targetCRS)
          Creates a new GeoTransformer object, with the given id as the target CRS.
 
Method Summary
 GridCoverage transform(AbstractGridCoverage coverage, Envelope targetBBOX, int dstWidth, int dstHeight, int refPointsGridSize, int degree, javax.media.jai.Interpolation interpolation)
          transforms a GridCoverage into another coordinate reference system.
 GridCoverage transform(AbstractGridCoverage coverage, int refPointsGridSize, int degree, javax.media.jai.Interpolation interpolation)
          Deprecated. 
 Envelope transform(Envelope envelope, CoordinateSystem sourceCRS)
          transforms a Envelope to the target crs of the GeoTransformer instance
 Envelope transform(Envelope envelope, CoordinateSystem sourceCRS, boolean regardDistortion)
          transfroms a Envelope to the target crs of the GeoTransformer instance This transformation takes rotation and distortion into account when regardDistortion is true.
 Envelope transform(Envelope envelope, String sourceCRS)
          Transforms a Envelope to the target crs of the GeoTransformer instance
 Feature transform(Feature feature)
          transforms all geometries contained within the passed Feature into the target CRS of a GeoTransformer instance.
 FeatureCollection transform(FeatureCollection fc)
          transforms all geometries contained within the passed FeatureCollection into the target CRS of a GeoTransformer instance.
 Geometry transform(Geometry geo)
          transforms the coodinates of a deegree geometry to the target coordinate reference system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoTransformer

public GeoTransformer(CoordinateSystem targetCRS)
               throws InvalidParameterException
Creates a new GeoTransformer object.

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

GeoTransformer

public GeoTransformer(String targetCRS)
               throws UnknownCRSException,
                      InvalidParameterException
Creates a new GeoTransformer 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.
InvalidParameterException - if the given parameter is null.
Method Detail

transform

public GridCoverage transform(AbstractGridCoverage coverage,
                              Envelope targetBBOX,
                              int dstWidth,
                              int dstHeight,
                              int refPointsGridSize,
                              int degree,
                              javax.media.jai.Interpolation interpolation)
                       throws CRSTransformationException
transforms a GridCoverage into another coordinate reference system.

Parameters:
coverage - grid coverage to transform
targetBBOX - envelope for the target coverage
dstWidth - width of the output coverage in pixel
dstHeight - height of the output coverage in pixel
refPointsGridSize - size of the grid used to calculate polynoms coefficients. E.g. 2 -≶ 4 points, 3 -≶ 9 points ...
Must be ≶= 2. Accuracy of coefficients increase with size of the grid. Speed decreases with size of the grid.
degree - The degree of the polynomial is supplied as an argument.
interpolation - interpolation method for warping the passed coverage. Can be null. In this case 'Nearest Neighbor' will be used as default
Returns:
a transformed GridCoverage.
Throws:
CRSTransformationException - if the gridCoverage could not be created or the transformation failed

transform

@Deprecated
public GridCoverage transform(AbstractGridCoverage coverage,
                                         int refPointsGridSize,
                                         int degree,
                                         javax.media.jai.Interpolation interpolation)
                       throws CRSTransformationException
Deprecated. 

transforms a GridCoverage into another coordinate reference system.

Parameters:
coverage - grid coverage to transform
refPointsGridSize - size of the grid used to calculate polynoms coefficients. E.g. 2 -≶ 4 points, 3 -≶ 9 points ...
Must be ≶= 2. Accuracy of coefficients increase with size of the grid. Speed decreases with size of the grid.
degree - The degree of the polynomial is supplied as an argument.
interpolation - interpolation method for warping the passed coverage. Can be null. In this case 'Nearest Neighbor' will be used as default
Returns:
a transformed GridCoverage.
Throws:
CRSTransformationException - if the gridCoverage could not be created or the transformation failed

transform

public Envelope transform(Envelope envelope,
                          CoordinateSystem sourceCRS)
                   throws CRSTransformationException
transforms a Envelope to the target crs of the GeoTransformer instance

Parameters:
envelope - to transform
sourceCRS - CRS of the envelope
Returns:
the transformed envelope
Throws:
CRSTransformationException

transform

public Envelope transform(Envelope envelope,
                          CoordinateSystem sourceCRS,
                          boolean regardDistortion)
                   throws CRSTransformationException
transfroms a Envelope to the target crs of the GeoTransformer instance This transformation takes rotation and distortion into account when regardDistortion is true. Otherwise the transformed envelope may not contain the whole input envelope.

Parameters:
envelope - to transform
sourceCRS - CRS of the envelope
regardDistortion -
Returns:
the transformed envelope
Throws:
CRSTransformationException

transform

public Envelope transform(Envelope envelope,
                          String sourceCRS)
                   throws CRSTransformationException,
                          UnknownCRSException
Transforms a Envelope to the target crs of the GeoTransformer instance

Parameters:
envelope - to transform
sourceCRS - CRS of the envelope
Returns:
the transformed envelope
Throws:
CRSTransformationException - if the transformation did not succeed.
UnknownCRSException - if the given string is unknown to the CRSProvider

transform

public Feature transform(Feature feature)
                  throws CRSTransformationException
transforms all geometries contained within the passed Feature into the target CRS of a GeoTransformer instance. If a geometry was transformed the Feature.setEnvelopesUpdated() method will be called.

Parameters:
feature -
Returns:
the transformed geometries in the given Feature.
Throws:
CRSTransformationException

transform

public FeatureCollection transform(FeatureCollection fc)
                            throws CRSTransformationException
transforms all geometries contained within the passed FeatureCollection into the target CRS of a GeoTransformer instance.

Parameters:
fc - the collection to transform
Returns:
the transformed geometries in the FeatureCollection
Throws:
CRSTransformationException - if the transformation cannot be created or processed.

transform

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

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

deegree 2.2 (2008/12/22 11:33 build-3038-official)

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