org.geotoolkit.referencing.operation
Class CachingCoordinateOperationFactory

Object
  extended by Factory
      extended by ReferencingFactory
          extended by AbstractCoordinateOperationFactory
              extended by CachingCoordinateOperationFactory
All Implemented Interfaces:
ObjectFactory, CoordinateOperationFactory, Factory

@Buffered
@ThreadSafe
@Decorator(value=org.opengis.referencing.operation.CoordinateOperationFactory.class)
public class CachingCoordinateOperationFactory
extends AbstractCoordinateOperationFactory

Caches the coordinate operations created by an other factory. Those coordinate operations may be expensive to create. During rendering and during data I/O, some implementations make use a lot of coordinate transformations, hence caching them might help.

In most cases, users should not need to create an instance of this class explicitly. An instance of CachingCoordinateOperationFactory should be automatically registered and returned by FactoryFinder in default Geotk configuration.

Since:
2.3
Version:
3.19
Author:
Simone Giannecchini (Geosolutions), Martin Desruisseaux (IRD, Geomatys)
Module:
referencing/geotk-referencing (download)    View source code for this class

Nested Class Summary
 
Nested classes/interfaces inherited from class Factory
Factory.Availability, Factory.Organizer
 
Field Summary
 
Fields inherited from class AbstractCoordinateOperationFactory
AXIS_CHANGES, DATUM_SHIFT, ELLIPSOID_SHIFT, GEOCENTRIC_CONVERSION, IDENTITY, INVERSE_OPERATION
 
Fields inherited from class ReferencingFactory
LOGGER
 
Fields inherited from class Factory
EMPTY_HINTS, hints
 
Constructor Summary
CachingCoordinateOperationFactory()
          Creates a buffered factory wrapping the default one.
CachingCoordinateOperationFactory(Hints hints)
          Creates a buffered factory wrapping an other factory selected according the specified hints.
 
Method Summary
 CoordinateOperation createOperation(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS)
          Returns an operation for conversion or transformation between two coordinate reference systems.
 CoordinateOperation createOperation(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, OperationMethod method)
          Returns an operation for conversion or transformation between two coordinate reference systems using the specified method.
 
Methods inherited from class AbstractCoordinateOperationFactory
concatenate, concatenate, createConcatenatedOperation, createDefiningConversion, createFromAffineTransform, createFromMathTransform, createFromMathTransform, createFromParameters, createOperationMethod, getErrorMessage, getImplementationHints, getMathTransformFactory, getOperationMethod, inverse, swapAndScaleAxis
 
Methods inherited from class ReferencingFactory
ensureNonNull, getVendor
 
Methods inherited from class Factory
availability, dispose, equals, hasCompatibleHints, hashCode, setOrdering, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface Factory
getVendor
 

Constructor Detail

CachingCoordinateOperationFactory

public CachingCoordinateOperationFactory()
Creates a buffered factory wrapping the default one.


CachingCoordinateOperationFactory

public CachingCoordinateOperationFactory(Hints hints)
Creates a buffered factory wrapping an other factory selected according the specified hints.

Parameters:
hints - The hints to use for choosing a backing factory.
Method Detail

createOperation

public CoordinateOperation createOperation(CoordinateReferenceSystem sourceCRS,
                                           CoordinateReferenceSystem targetCRS)
                                    throws OperationNotFoundException,
                                           FactoryException
Returns an operation for conversion or transformation between two coordinate reference systems. If an operation was already created and still in the cache, the cached operation is returned. Otherwise the operation creation is delegated to the factory specified at construction time and the result is cached.

Parameters:
sourceCRS - Input coordinate reference system.
targetCRS - Output coordinate reference system.
Returns:
A coordinate operation from sourceCRS to targetCRS.
Throws:
OperationNotFoundException - if no operation path was found from sourceCRS to targetCRS.
FactoryException - if the operation creation failed for some other reason.

createOperation

public CoordinateOperation createOperation(CoordinateReferenceSystem sourceCRS,
                                           CoordinateReferenceSystem targetCRS,
                                           OperationMethod method)
                                    throws OperationNotFoundException,
                                           FactoryException
Returns an operation for conversion or transformation between two coordinate reference systems using the specified method. If an operation was already created and still in the cache, the cached operation is returned. Otherwise the operation creation is delegated to the factory specified at construction time and the result is cached.

Parameters:
sourceCRS - Input coordinate reference system.
targetCRS - Output coordinate reference system.
method - The algorithmic method for conversion or transformation.
Returns:
A coordinate operation from sourceCRS to targetCRS.
Throws:
OperationNotFoundException - if no operation path was found from sourceCRS to targetCRS.
FactoryException - if the operation creation failed for some other reason.


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