org.geotools.referencing.operation
Class AuthorityBackedFactory

java.lang.Object
  extended byorg.geotools.factory.AbstractFactory
      extended byorg.geotools.referencing.factory.AbstractFactory
          extended byorg.geotools.referencing.operation.AbstractCoordinateOperationFactory
              extended byorg.geotools.referencing.operation.DefaultCoordinateOperationFactory
                  extended byorg.geotools.referencing.operation.AuthorityBackedFactory
All Implemented Interfaces:
org.opengis.referencing.operation.CoordinateOperationFactory, Factory, org.opengis.referencing.Factory, org.opengis.referencing.ObjectFactory, OptionalFactory, javax.imageio.spi.RegisterableService

public class AuthorityBackedFactory
extends DefaultCoordinateOperationFactory
implements OptionalFactory

A coordinate operation factory using the help of an authority factory. When createOperation(sourceCRS, targetCRS) is invoked, this class first fetch the authority codes for source and target CRS and invokes the createFromCoordinateReferenceSystemCodes method from the authority factory. If the authority factory doesn't know about the specified CRS, only then the default (standalone) process from the super-class is used as a fallback.

Using an authority factory when available gives access to informations not available otherwise. Examples include area of validity, scope and positional accuracy.

Since:
2.2
Version:
$Id: AuthorityBackedFactory.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux

Field Summary
 
Fields inherited from class org.geotools.referencing.operation.AbstractCoordinateOperationFactory
AXIS_CHANGES, DATUM_SHIFT, ELLIPSOID_SHIFT, GEOCENTRIC_CONVERSION, IDENTITY, INVERSE_OPERATION, mtFactory
 
Fields inherited from class org.geotools.referencing.factory.AbstractFactory
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 hints)
          Creates a new factory backed by an authority factory fetched using the specified hints.
 
Method Summary
protected  org.opengis.referencing.operation.CoordinateOperation createFromCoordinateReferenceSystemCodes(java.lang.String sourceCode, java.lang.String targetCode)
          Creates an operation from coordinate reference system codes.
 org.opengis.referencing.operation.CoordinateOperation createOperation(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 isReady()
          Returns if this factory and its underlying authority factory are ready for use.
 
Methods inherited from class org.geotools.referencing.operation.DefaultCoordinateOperationFactory
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, createFromAffineTransform, createFromMathTransform, createFromMathTransform, createFromParameters, ensureNonNull, getErrorMessage, getImplementationHints, getMathTransformFactory, swapAndScaleAxis
 
Methods inherited from class org.geotools.referencing.factory.AbstractFactory
getVendor
 
Methods inherited from class org.geotools.factory.AbstractFactory
onDeregistration, onRegistration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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 hints)
Creates a new factory backed by an authority factory fetched using the specified hints. This constructor recognizes the CRS, CS, DATUM and MATH_TRANSFORM hints. In addition, the FactoryGroup.HINT_KEY hint may be used as a low-level substitute for all the above.

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

getAuthorityFactory

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


createOperation

public org.opengis.referencing.operation.CoordinateOperation createOperation(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS,
                                                                             org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS)
                                                                      throws org.opengis.referencing.operation.OperationNotFoundException,
                                                                             org.opengis.referencing.FactoryException
Returns an operation for conversion or transformation between two coordinate reference systems. This invokes the createFromCoordinateReferenceSystemCodes method with the code of the supplied CRS. If no operation is found for those codes, then this method fallback on the generic implementation provided by the super-class.

Note that this method may be invoked recursively by the super-class implementation. 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.

Specified by:
createOperation in interface org.opengis.referencing.operation.CoordinateOperationFactory
Overrides:
createOperation in class DefaultCoordinateOperationFactory
Parameters:
sourceCRS - Input coordinate reference system.
targetCRS - Output coordinate reference system.
Returns:
A coordinate operation from to .
Throws:
org.opengis.referencing.operation.OperationNotFoundException - if no operation path was found from to .
org.opengis.referencing.FactoryException - if the operation creation failed for some other reason.

createFromCoordinateReferenceSystemCodes

protected org.opengis.referencing.operation.CoordinateOperation createFromCoordinateReferenceSystemCodes(java.lang.String sourceCode,
                                                                                                         java.lang.String targetCode)
                                                                                                  throws org.opengis.referencing.FactoryException
Creates an operation from coordinate reference system codes. The default implementation delegates the call to the underlying authority factory and returns the first operation found. If no operation is found, then this method returns . Subclasses can override this method if they wish to select a better operation from the authority codes.

Parameters:
sourceCode - Coded value of source coordinate reference system.
targetCode - Coded value of target coordinate reference system.
Returns:
The operation, or if the underlying authority factory doesn't provide any operation for the specified source and target CRS.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if a specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.

isReady

public boolean isReady()
Returns if this factory and its underlying authority factory are ready for use.

Specified by:
isReady in interface OptionalFactory


Copyright © GeoTools. All Rights Reserved.