org.geotools.referencing.operation
Class AuthorityBackedFactory

java.lang.Object
  extended by org.geotools.factory.AbstractFactory
      extended by org.geotools.referencing.factory.ReferencingFactory
          extended by org.geotools.referencing.operation.AbstractCoordinateOperationFactory
              extended by org.geotools.referencing.operation.DefaultCoordinateOperationFactory
                  extended by org.geotools.referencing.operation.AuthorityBackedFactory
All Implemented Interfaces:
javax.imageio.spi.RegisterableService, Factory, OptionalFactory, org.opengis.referencing.ObjectFactory, org.opengis.referencing.operation.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
Version:
$Id: AuthorityBackedFactory.java 35586 2010-05-25 14:06:26Z aaime $
Author:
Martin Desruisseaux (IRD)

Field Summary
 
Fields inherited from class org.geotools.referencing.operation.AbstractCoordinateOperationFactory
AXIS_CHANGES, DATUM_SHIFT, ELLIPSOID_SHIFT, GEOCENTRIC_CONVERSION, IDENTITY, INVERSE_OPERATION
 
Fields inherited from class org.geotools.referencing.factory.ReferencingFactory
LOGGER
 
Fields inherited from class org.geotools.factory.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(org.opengis.referencing.operation.CoordinateOperation operation)
          Returns true if the specified operation is acceptable.
protected  org.opengis.referencing.operation.CoordinateOperation createFromDatabase(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS)
          Returns an operation for conversion or transformation between two coordinate reference systems.
protected  org.opengis.referencing.operation.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 org.geotools.referencing.operation.DefaultCoordinateOperationFactory
createOperation, createOperation, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep, createOperationStep
 
Methods inherited from class org.geotools.referencing.operation.AbstractCoordinateOperationFactory
concatenate, concatenate, createConcatenatedOperation, createDefiningConversion, createFromAffineTransform, createFromMathTransform, createFromMathTransform, createFromParameters, ensureNonNull, getErrorMessage, getImplementationHints, getMathTransformFactory, inverse, swapAndScaleAxis
 
Methods inherited from class org.geotools.referencing.factory.ReferencingFactory
getVendor
 
Methods inherited from class org.geotools.factory.AbstractFactory
addImplementationHints, equals, getPriority, hashCode, onDeregistration, onRegistration, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.geotools.factory.Factory
getImplementationHints
 
Methods inherited from interface org.opengis.referencing.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 org.opengis.referencing.operation.CoordinateOperationAuthorityFactory getAuthorityFactory()
Returns the underlying coordinate operation authority factory.


createFromDatabase

protected org.opengis.referencing.operation.CoordinateOperation createFromDatabase(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS,
                                                                                   org.opengis.referencing.crs.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(org.opengis.referencing.operation.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-2010 Geotools. All Rights Reserved.