org.geotools.referencing.operation
Class AuthorityBackedFactory

Object
  extended by AbstractFactory
      extended by ReferencingFactory
          extended by AbstractCoordinateOperationFactory
              extended by DefaultCoordinateOperationFactory
                  extended by AuthorityBackedFactory
All Implemented Interfaces:
RegisterableService, Factory, OptionalFactory, ObjectFactory, CoordinateOperationFactory

public class AuthorityBackedFactory
extends DefaultCoordinateOperationFactory
implements OptionalFactory

A coordinate operation factory extended with the extra informations provided by an authority factory. Such authority factory may help to find transformation paths not available otherwise (often determined from empirical parameters). Authority factories can also provide additional informations like the area of validity, scope and positional accuracy.

When createOperation(sourceCRS, targetCRS) is invoked, AuthorityBackedFactory fetch the authority codes for source and target CRS and submits them to the underlying authority factory through a call to its createFromCoordinateReferenceSystemCodes(sourceCode, targetCode) method. If the authority factory doesn't know about the specified CRS, then the default (standalone) process from the super-class is used as a fallback.

Since:
2.2
Author:
Martin Desruisseaux (IRD)

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
AuthorityBackedFactory()
          Creates a new factory backed by a default EPSG authority factory.
AuthorityBackedFactory(Hints userHints)
          Creates a new factory backed by an authority factory fetched using the specified hints.
 
Method Summary
protected  boolean accept(CoordinateOperation operation)
          Returns true if the specified operation is acceptable.
protected  CoordinateOperation createFromDatabase(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS)
          Returns an operation for conversion or transformation between two coordinate reference systems.
protected  CoordinateOperationAuthorityFactory getAuthorityFactory()
          Returns the underlying coordinate operation authority factory.
 boolean isAvailable()
          Returns true if this factory and its underlying authority factory are available for use.
 
Methods inherited from class DefaultCoordinateOperationFactory
createOperation, createOperation, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep
 
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

AuthorityBackedFactory

public AuthorityBackedFactory()
Creates a new factory backed by a default EPSG authority factory. This factory will uses a priority slightly higher than the default (standalone) factory.


AuthorityBackedFactory

public AuthorityBackedFactory(Hints userHints)
Creates a new factory backed by an authority factory fetched using the specified hints. This constructor recognizes the CRS, CS, DATUM and MATH_TRANSFORM FACTORY hints.

Parameters:
userHints - The hints, or null if none.
Method Detail

getAuthorityFactory

protected CoordinateOperationAuthorityFactory getAuthorityFactory()
Returns the underlying coordinate operation authority factory.


createFromDatabase

protected CoordinateOperation createFromDatabase(CoordinateReferenceSystem sourceCRS,
                                                 CoordinateReferenceSystem targetCRS)
Returns an operation for conversion or transformation between two coordinate reference systems. The default implementation extracts the authority code from the supplied sourceCRS and targetCRS, and submit them to the createFromCoordinateReferenceSystemCodes(sourceCode, targetCode) methods. If no operation is found for those codes, then this method returns null.

Note that this method may be invoked recursively. For example no operation may be available from the underlying authority factory between two compound CRS, but an operation may be available between two components of those compound CRS.

Overrides:
createFromDatabase in class DefaultCoordinateOperationFactory
Parameters:
sourceCRS - Input coordinate reference system.
targetCRS - Output coordinate reference system.
Returns:
A coordinate operation from sourceCRS to targetCRS, or null if no such operation is explicitly defined in the underlying database.
Since:
2.3

accept

protected boolean accept(CoordinateOperation operation)
Returns true if the specified operation is acceptable. This method is invoked automatically by createFromDatabase(...) for every operation candidates found. The default implementation returns always true. Subclasses should override this method if they wish to filter the coordinate operations to be returned.

Since:
2.3

isAvailable

public boolean isAvailable()
Returns true if this factory and its underlying authority factory are available for use.

Specified by:
isAvailable in interface OptionalFactory


Copyright © 1996-2014 Geotools. All Rights Reserved.