org.geotoolkit.referencing.operation.transform
Class WarpFactory

Object
  extended by WarpFactory

public class WarpFactory
extends Object

Creates image Warp objects for the given MathTransform2D. The Warp.warpPoint(int,int,float[]) method transforms coordinates from source to target CRS. Note that the JAI warp operation needs a warp object with the opposite semantic (i.e. the image warp shall transform coordinates from target to source CRS). Consequently, consider invoking transform.inverse() if the warp object is going to be used in an image reprojection.


Mapping pixels corner or center
The semantic of Java Advanced Imaging Warp operation is to apply the transforms as below:

This semantic implies that the grid to CRS transforms were computed using PixelOrientation.UPPER_LEFT, as in Java2D usage.

Since:
3.16
Version:
3.16
Author:
Martin Desruisseaux (Geomatys)
Module:
coverage/geotk-coverage (download)    View source code for this class

Field Summary
static WarpFactory DEFAULT
          The default factory instance.
 
Constructor Summary
WarpFactory(double tolerance)
          Creates a new factory.
 
Method Summary
 Warp create(CharSequence name, MathTransform2D transform)
          Creates an image warp applicable to the whole domain of validity of the given transform.
 Warp create(CharSequence name, MathTransform2D transform, Rectangle domain)
          Creates an image warp applicable to the given domain of validity.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final WarpFactory DEFAULT
The default factory instance.

Constructor Detail

WarpFactory

public WarpFactory(double tolerance)
Creates a new factory.

Parameters:
tolerance - The maximal error allowed, in units of destination CRS (usually pixels). This is the maximal difference allowed between a coordinate transformed using the original transform, and the same coordinate transformed using the warp created by this factory.
Method Detail

create

public Warp create(CharSequence name,
                   MathTransform2D transform)
Creates an image warp applicable to the whole domain of validity of the given transform.

Parameters:
name - The image or coverage name, or null.
transform - The transform to returns as an image warp.
Returns:
The warp for the given transform.

create

public Warp create(CharSequence name,
                   MathTransform2D transform,
                   Rectangle domain)
            throws TransformException
Creates an image warp applicable to the given domain of validity. This method will typically create more efficient warps than the unbounded method.

Parameters:
name - The image or coverage name, or null.
transform - The transform to returns as an image warp.
domain - The domain of validity in source coordinates.
Returns:
The warp for the given transform.
Throws:
TransformException - If at least one point in the given domain can not be transformed.


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.