Class BufferedCoordinateOperationFactory
Object
AbstractFactory
ReferencingFactory
AbstractCoordinateOperationFactory
BufferedCoordinateOperationFactory
- All Implemented Interfaces:
Factory,ObjectFactory,CoordinateOperationFactory,BufferedFactory,Factory,RegistrableFactory
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
-
Field Summary
Fields inherited from class AbstractCoordinateOperationFactory
AXIS_CHANGES, DATUM_SHIFT, ELLIPSOID_SHIFT, GEOCENTRIC_CONVERSION, IDENTITY, INVERSE_OPERATIONFields inherited from class ReferencingFactory
LOGGERFields inherited from class AbstractFactory
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority -
Constructor Summary
ConstructorsConstructorDescriptionCreates 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
Modifier and TypeMethodDescriptioncreateOperation(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS) Returns an operation for conversion or transformation between two coordinate reference systems.createOperation(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, OperationMethod method) Returns an operation for conversion or transformation between two coordinate reference systems using the specified method.findOperations(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS) Returns all available operations for conversion or transformation between two coordinate reference systems.Methods inherited from class AbstractCoordinateOperationFactory
concatenate, concatenate, concatenate, concatenate, createConcatenatedOperation, createDefiningConversion, createFromAffineTransform, createFromMathTransform, createFromMathTransform, createFromParameters, ensureNonNull, getErrorMessage, getImplementationHints, getMathTransformFactory, inverse, swapAndScaleAxisMethods inherited from class ReferencingFactory
getVendorMethods inherited from class AbstractFactory
addImplementationHints, equals, getPriority, hashCode, onDeregistration, onRegistration, toStringMethods inherited from interface Factory
getImplementationHints
-
Constructor Details
-
BufferedCoordinateOperationFactory
public BufferedCoordinateOperationFactory()Creates a buffered factory wrapping the default one. -
BufferedCoordinateOperationFactory
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
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 betweenMINIMUM_PRIORITYandMAXIMUM_PRIORITYinclusive.
-
BufferedCoordinateOperationFactory
Wraps the specified factory.- Parameters:
factory- The factory to wrap.priority- The priority for this factory, as a number betweenMINIMUM_PRIORITYandMAXIMUM_PRIORITYinclusive.
-
-
Method Details
-
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:
createOperationin interfaceCoordinateOperationFactory- Parameters:
sourceCRS- Input coordinate reference system.targetCRS- Output coordinate reference system.- Returns:
- A coordinate operation from
sourceCRStotargetCRS. - Throws:
OperationNotFoundException- if no operation path was found fromsourceCRStotargetCRS.FactoryException- if the operation creation failed for some other reason.
-
findOperations
public Set<CoordinateOperation> findOperations(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS) throws FactoryException Returns all available operations for conversion or transformation between two coordinate reference systems. The operation creation is delegated to the coordinate operation factory specified at construction time and the result is not cached.- Specified by:
findOperationsin interfaceCoordinateOperationFactory- Parameters:
sourceCRS- Input coordinate reference system.targetCRS- Output coordinate reference system.- Returns:
- A Set of coordinate operations from
sourceCRStotargetCRS. - Throws:
FactoryException- if there was a failure retrieving or creating the operations.
-
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. The current implementation delegates to the coordinate operation factory specified at construction time with no caching.- Specified by:
createOperationin interfaceCoordinateOperationFactory- Parameters:
sourceCRS- Input coordinate reference system.targetCRS- Output coordinate reference system.method- The algorithmic method for conversion or transformation.- Returns:
- A coordinate operation from
sourceCRStotargetCRS. - Throws:
OperationNotFoundException- if no operation path was found fromsourceCRStotargetCRS.FactoryException- if the operation creation failed for some other reason.
-