org.geotools.referencing.factory.epsg
Class CoordinateOperationFactoryUsingWKT

Object
  extended by AbstractFactory
      extended by ReferencingFactory
          extended by AbstractAuthorityFactory
              extended by BufferedAuthorityFactory
                  extended by DeferredAuthorityFactory
                      extended by CoordinateOperationFactoryUsingWKT
All Implemented Interfaces:
RegisterableService, BufferedFactory, Factory, OptionalFactory, AuthorityFactory, CoordinateOperationAuthorityFactory

public class CoordinateOperationFactoryUsingWKT
extends DeferredAuthorityFactory
implements CoordinateOperationAuthorityFactory

Authority factory that holds user-defined Coordinate Operations.

This factory can be used as a replacement for Coordinate Operations when there is no access to a complete EPSG database. Or can be used to override the coordinate operations defined in EPSG if assigned a higher priority.

The Coordinate Operations are defined as Well Known Text math transforms (see PropertyCoordinateOperationAuthorityFactory for format specification and examples).

Property file name is "epsg_operations.properties", and its possible locations are described here. If no property file is found, the factory won't be activated.

If an operation is not found in the properties file, this factory will delegate creation on a fallback factory. The fallback factory is the next registered CoordinateOperationAuthorityFactory after this one in the priority chain.

Author:
Oscar Fonts

Field Summary
protected  Citation authority
          The authority.
protected  String directory
          Directory scanned for extra definitions.
protected  ReferencingFactoryContainer factories
          The factories to be given to the backing store.
protected  CoordinateOperationAuthorityFactory fallbackAuthorityFactory
          An alternate factory to be used when the primary one doesn't find an operation
protected  boolean fallbackAuthorityFactorySearched
          Just a flag not to search more than once
static String FILENAME
          The default filename to read.
static int PRIORITY
          Priority for this factory
 
Fields inherited from class ReferencingFactory
LOGGER
 
Fields inherited from class AbstractFactory
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority
 
Constructor Summary
  CoordinateOperationFactoryUsingWKT()
          Constructs an authority factory using the default set of factories.
  CoordinateOperationFactoryUsingWKT(Hints userHints)
          Constructs an authority factory using a set of factories created from the specified hints.
protected CoordinateOperationFactoryUsingWKT(Hints userHints, int priority)
          Constructs an authority factory using the specified hints and priority.
 
Method Summary
protected  AbstractAuthorityFactory createBackingStore()
          Creates the backing store authority factory.
 CoordinateOperation createCoordinateOperation(String code)
          Creates an operation from a single operation code.
 Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS, String targetCRS)
          Creates operations from coordinate reference system codes.
 Citation getAuthority()
          Returns the organization or party responsible for definition and maintenance of the underlying database.
protected  URL getDefinitionsURL()
          Returns the URL to the property file that contains Operation definitions.
protected  CoordinateOperationAuthorityFactory getFallbackAuthorityFactory()
          Gets the next available CoordinateOperationAuthorityFactory in the priority list.
 
Methods inherited from class DeferredAuthorityFactory
canDisposeBackingStore, dispose, disposeBackingStore, exit, getBackingStore, isAvailable, isConnected, setTimeout
 
Methods inherited from class BufferedAuthorityFactory
createCartesianCS, createCompoundCRS, createCoordinateReferenceSystem, createCoordinateSystem, createCoordinateSystemAxis, createCylindricalCS, createDatum, createDerivedCRS, createEllipsoid, createEllipsoidalCS, createEngineeringCRS, createEngineeringDatum, createExtent, createGeocentricCRS, createGeodeticDatum, createGeographicCRS, createImageCRS, createImageDatum, createObject, createOperationMethod, createParameterDescriptor, createPolarCS, createPrimeMeridian, createProjectedCRS, createSphericalCS, createTemporalCRS, createTemporalDatum, createTimeCS, createUnit, createVerticalCRS, createVerticalCS, createVerticalDatum, getAuthorityCodes, getBackingStoreDescription, getDescriptionText, getIdentifiedObjectFinder, getVendor
 
Methods inherited from class AbstractAuthorityFactory
noSuchAuthorityCode, trimAuthority
 
Methods inherited from class ReferencingFactory
ensureNonNull
 
Methods inherited from class AbstractFactory
addImplementationHints, equals, getImplementationHints, getPriority, hashCode, onDeregistration, onRegistration, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface AuthorityFactory
createObject, getAuthorityCodes, getDescriptionText
 
Methods inherited from interface Factory
getVendor
 
Methods inherited from interface Factory
getImplementationHints
 

Field Detail

authority

protected Citation authority
The authority. Will be created only when first needed.

See Also:
getAuthority()

FILENAME

public static final String FILENAME
The default filename to read. The default FactoryUsingWKT implementation will search for the first occurence of this file in the following places:

See Also:
getDefinitionsURL(), Constant Field Values

PRIORITY

public static final int PRIORITY
Priority for this factory

See Also:
Constant Field Values

factories

protected final ReferencingFactoryContainer factories
The factories to be given to the backing store.


directory

protected final String directory
Directory scanned for extra definitions.


fallbackAuthorityFactory

protected CoordinateOperationAuthorityFactory fallbackAuthorityFactory
An alternate factory to be used when the primary one doesn't find an operation


fallbackAuthorityFactorySearched

protected boolean fallbackAuthorityFactorySearched
Just a flag not to search more than once

Constructor Detail

CoordinateOperationFactoryUsingWKT

public CoordinateOperationFactoryUsingWKT()
Constructs an authority factory using the default set of factories.


CoordinateOperationFactoryUsingWKT

public CoordinateOperationFactoryUsingWKT(Hints userHints)
Constructs an authority factory using a set of factories created from the specified hints.


CoordinateOperationFactoryUsingWKT

protected CoordinateOperationFactoryUsingWKT(Hints userHints,
                                             int priority)
Constructs an authority factory using the specified hints and priority.

Method Detail

getAuthority

public Citation getAuthority()
Description copied from class: BufferedAuthorityFactory
Returns the organization or party responsible for definition and maintenance of the underlying database.

Specified by:
getAuthority in interface AuthorityFactory
Overrides:
getAuthority in class BufferedAuthorityFactory
Returns:
The organization reponsible for definition of the database.

createBackingStore

protected AbstractAuthorityFactory createBackingStore()
                                               throws FactoryException
Creates the backing store authority factory.

Specified by:
createBackingStore in class DeferredAuthorityFactory
Returns:
The backing store to uses in createXXX(...) methods.
Throws:
FactoryNotFoundException - if the properties file has not been found.
FactoryException - if the constructor failed to find or read the file. This exception usually has an IOException as its cause.

getDefinitionsURL

protected URL getDefinitionsURL()
Returns the URL to the property file that contains Operation definitions. The default implementation performs the following search path:

Returns:
The URL, or null if none.

createFromCoordinateReferenceSystemCodes

public Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS,
                                                                         String targetCRS)
                                                                  throws NoSuchAuthorityCodeException,
                                                                         FactoryException
Creates operations from coordinate reference system codes. This method searches in the properties file for operations. If not found there, it will create operations from a fallback factory (see getFallbackAuthorityFactory()).

Specified by:
createFromCoordinateReferenceSystemCodes in interface CoordinateOperationAuthorityFactory
Overrides:
createFromCoordinateReferenceSystemCodes in class BufferedAuthorityFactory
Parameters:
sourceCRS - Coded value of source coordinate reference system.
targetCRS - Coded value of target coordinate reference system.
Returns:
The operations from sourceCRS to targetCRS.
Throws:
NoSuchAuthorityCodeException - if a specified code was not found.
FactoryException - if the object creation failed for some other reason.

createCoordinateOperation

public CoordinateOperation createCoordinateOperation(String code)
                                              throws NoSuchAuthorityCodeException,
                                                     FactoryException
Creates an operation from a single operation code. This method searches in the properties file for operations. If not found there, it will create operations from a fallback factory (see getFallbackAuthorityFactory()).

Specified by:
createCoordinateOperation in interface CoordinateOperationAuthorityFactory
Overrides:
createCoordinateOperation in class BufferedAuthorityFactory
Parameters:
code - Coded value for operation.
Returns:
The operation from sourceCRS to targetCRS.
Throws:
NoSuchAuthorityCodeException - if a specified code was not found.
FactoryException - if the object creation failed for some other reason.

getFallbackAuthorityFactory

protected CoordinateOperationAuthorityFactory getFallbackAuthorityFactory()
                                                                   throws NoSuchAuthorityCodeException,
                                                                          FactoryException
Gets the next available CoordinateOperationAuthorityFactory in the priority list.

Returns:
the alternative CoordinateOperationAuthorityFactory.
Throws:
NoSuchAuthorityCodeException - if a specified code was not found.
FactoryException - if the object creation failed for some other reason.


Copyright © 1996-2014 Geotools. All Rights Reserved.