org.geotools.referencing.operation
Class BufferedCoordinateOperationFactory

Object
  extended by AbstractFactory
      extended by ReferencingFactory
          extended by AbstractCoordinateOperationFactory
              extended by BufferedCoordinateOperationFactory
All Implemented Interfaces:
RegisterableService, BufferedFactory, Factory, ObjectFactory, CoordinateOperationFactory

public class BufferedCoordinateOperationFactory
extends AbstractCoordinateOperationFactory
implements BufferedFactory

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 lof 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 BufferedCoordinateOperationFactory should be automatically registered and returned by ReferencingFactoryFinder in default Geotools configuration.

Since:
2.3
Author:
Simone Giannecchini, Martin Desruisseaux
Module:

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 AbstractFactory
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority
 
Constructor Summary
BufferedCoordinateOperationFactory()
          Creates a buffered factory wrapping the default one.
BufferedCoordinateOperationFactory(CoordinateOperationFactory factory, int priority)
          Wraps the specified factory.
BufferedCoordinateOperationFactory(Hints userHints)
          Creates a buffered factory wrapping an other factory selected according the specified hints.
BufferedCoordinateOperationFactory(Hints userHints, int priority)
          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)
          Deprecated. Will be removed.
 
Methods inherited from class AbstractCoordinateOperationFactory
concatenate, concatenate, createConcatenatedOperation, createDefiningConversion, createFromAffineTransform, createFromMathTransform, createFromMathTransform, createFromParameters, ensureNonNull, getErrorMessage, getImplementationHints, getMathTransformFactory, inverse, swapAndScaleAxis
 
Methods inherited from class ReferencingFactory
getVendor
 
Methods inherited from class AbstractFactory
addImplementationHints, equals, getPriority, hashCode, onDeregistration, onRegistration, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface Factory
getImplementationHints
 
Methods inherited from interface Factory
getVendor
 

Constructor Detail

BufferedCoordinateOperationFactory

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


BufferedCoordinateOperationFactory

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

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

BufferedCoordinateOperationFactory

public BufferedCoordinateOperationFactory(Hints userHints,
                                          int priority)
Creates a buffered factory wrapping an other factory selected according the specified hints.

Parameters:
userHints - The hints to use for choosing a backing factory.
priority - The priority for this factory, as a number between MINIMUM_PRIORITY and MAXIMUM_PRIORITY inclusive.

BufferedCoordinateOperationFactory

public BufferedCoordinateOperationFactory(CoordinateOperationFactory factory,
                                          int priority)
Wraps the specified factory.

Parameters:
factory - The factory to wrap.
priority - The priority for this factory, as a number between MINIMUM_PRIORITY and MAXIMUM_PRIORITY inclusive.
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 coordinate operation factory specified at construction time and the result is cached.

Specified by:
createOperation in interface CoordinateOperationFactory
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
Deprecated. Will be removed.

Returns an operation for conversion or transformation between two coordinate reference systems using the specified method. The current implementation delegates to the coordinate operation factory specified at construction time with no caching.

Specified by:
createOperation in interface CoordinateOperationFactory
Throws:
OperationNotFoundException
FactoryException


Copyright © 1996-2009 Geotools. All Rights Reserved.