org.geotools.referencing.factory
Class AbstractCachedAuthorityFactory

java.lang.Object
  extended by org.geotools.factory.AbstractFactory
      extended by org.geotools.referencing.factory.ReferencingFactory
          extended by org.geotools.referencing.factory.AbstractAuthorityFactory
              extended by org.geotools.referencing.factory.AbstractCachedAuthorityFactory
All Implemented Interfaces:
javax.imageio.spi.RegisterableService, BufferedFactory, Factory, org.opengis.referencing.AuthorityFactory, org.opengis.referencing.crs.CRSAuthorityFactory, org.opengis.referencing.cs.CSAuthorityFactory, org.opengis.referencing.datum.DatumAuthorityFactory, org.opengis.referencing.operation.CoordinateOperationAuthorityFactory
Direct Known Subclasses:
AbstractEpsgFactory

public abstract class AbstractCachedAuthorityFactory
extends AbstractAuthorityFactory
implements org.opengis.referencing.AuthorityFactory, org.opengis.referencing.crs.CRSAuthorityFactory, org.opengis.referencing.cs.CSAuthorityFactory, org.opengis.referencing.datum.DatumAuthorityFactory, org.opengis.referencing.operation.CoordinateOperationAuthorityFactory, BufferedFactory

An authority factory that consults (a possibly shared) cache before generating content itself.

The behavior of the createFoo(String) methods first looks if a previously created object exists for the given code. If such an object exists, it is returned directly. The testing of the cache is synchronized and may block if the referencing object is under construction.

If the object is not yet created, the definition is delegated to the appropriate the generateFoo method and the result is cached for next time.

This object is responsible for using a provided {{ReferencingObjectCache}}.

Since:
2.4
Version:
$Id: BufferedAuthorityDecorator.java 26038 2007-06-27 01:58:12Z jgarnett $
Author:
Jody Garnett

Field Summary
protected  ObjectCache cache
          Cache to be used for referencing objects defined by this authority.
protected  ReferencingFactoryContainer factories
          A container of the "real factories" actually used to construct objects.
 
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
protected AbstractCachedAuthorityFactory(int priority)
          Constructs an instance making use of the default cache.
protected AbstractCachedAuthorityFactory(int priority, Hints hints)
          Constructs an instance making use of the default cache.
protected AbstractCachedAuthorityFactory(int priority, ObjectCache cache, ReferencingFactoryContainer container)
          Constructs an instance making use of the indicated cache.
 
Method Summary
 org.opengis.referencing.cs.CartesianCS createCartesianCS(java.lang.String code)
          Creates a cartesian coordinate system from a code.
 org.opengis.referencing.crs.CompoundCRS createCompoundCRS(java.lang.String code)
          Creates a 3D coordinate reference system from a code.
 org.opengis.referencing.operation.CoordinateOperation createCoordinateOperation(java.lang.String code)
          Creates an operation from a single operation code.
 org.opengis.referencing.crs.CoordinateReferenceSystem createCoordinateReferenceSystem(java.lang.String code)
          Returns an arbitrary coordinate reference system from a code.
 org.opengis.referencing.cs.CoordinateSystem createCoordinateSystem(java.lang.String code)
          Returns an arbitrary coordinate system from a code.
 org.opengis.referencing.cs.CoordinateSystemAxis createCoordinateSystemAxis(java.lang.String code)
          Returns a coordinate system axis from a code.
 org.opengis.referencing.cs.CylindricalCS createCylindricalCS(java.lang.String code)
          The default implementation invokes createCoordinateSystem(code).
 org.opengis.referencing.datum.Datum createDatum(java.lang.String code)
          Returns an arbitrary datum from a code.
 org.opengis.referencing.crs.DerivedCRS createDerivedCRS(java.lang.String code)
          Creates a derived coordinate reference system from a code.
 org.opengis.referencing.datum.Ellipsoid createEllipsoid(java.lang.String code)
          Returns an ellipsoid from a code.
 org.opengis.referencing.cs.EllipsoidalCS createEllipsoidalCS(java.lang.String code)
          Creates an ellipsoidal coordinate system from a code.
 org.opengis.referencing.crs.EngineeringCRS createEngineeringCRS(java.lang.String code)
          Creates a engineering coordinate reference system from a code.
 org.opengis.referencing.datum.EngineeringDatum createEngineeringDatum(java.lang.String code)
          Creates a engineering datum from a code.
 java.util.Set createFromCoordinateReferenceSystemCodes(java.lang.String sourceCode, java.lang.String targetCode)
          Creates an operation from coordinate reference system codes.
 org.opengis.referencing.crs.GeocentricCRS createGeocentricCRS(java.lang.String code)
          Returns a geocentric coordinate reference system from a code.
 org.opengis.referencing.datum.GeodeticDatum createGeodeticDatum(java.lang.String code)
          Returns a geodetic datum from a code.
 org.opengis.referencing.crs.GeographicCRS createGeographicCRS(java.lang.String code)
          Returns a geographic coordinate reference system from a code.
 org.opengis.referencing.crs.ImageCRS createImageCRS(java.lang.String code)
          Creates a image coordinate reference system from a code.
 org.opengis.referencing.datum.ImageDatum createImageDatum(java.lang.String code)
          Creates a image datum from a code.
 org.opengis.referencing.IdentifiedObject createObject(java.lang.String code)
          Returns an arbitrary object from a code.
 org.opengis.referencing.cs.PolarCS createPolarCS(java.lang.String code)
          Creates a polar coordinate system from a code.
 org.opengis.referencing.datum.PrimeMeridian createPrimeMeridian(java.lang.String code)
          Returns a prime meridian from a code.
 org.opengis.referencing.crs.ProjectedCRS createProjectedCRS(java.lang.String code)
          Returns a projected coordinate reference system from a code.
 org.opengis.referencing.cs.SphericalCS createSphericalCS(java.lang.String code)
          Creates a spherical coordinate system from a code.
 org.opengis.referencing.crs.TemporalCRS createTemporalCRS(java.lang.String code)
          Creates a temporal coordinate reference system from a code.
 org.opengis.referencing.datum.TemporalDatum createTemporalDatum(java.lang.String code)
          Creates a temporal datum from a code.
 org.opengis.referencing.cs.TimeCS createTimeCS(java.lang.String code)
          Creates a temporal coordinate system from a code.
 javax.measure.unit.Unit<?> createUnit(java.lang.String code)
          Returns an unit from a code.
 org.opengis.referencing.crs.VerticalCRS createVerticalCRS(java.lang.String code)
          Creates a vertical coordinate reference system from a code.
 org.opengis.referencing.cs.VerticalCS createVerticalCS(java.lang.String code)
          Creates a vertical coordinate system from a code.
 org.opengis.referencing.datum.VerticalDatum createVerticalDatum(java.lang.String code)
          Creates a vertical datum from a code.
 void dispose()
          We will clear out our cache and factories reference
protected abstract  java.util.Set generateAuthorityCodes(java.lang.Class type)
           
protected abstract  org.opengis.referencing.operation.CoordinateOperation generateCoordinateOperation(java.lang.String code)
           
protected abstract  org.opengis.referencing.crs.CoordinateReferenceSystem generateCoordinateReferenceSystem(java.lang.String code)
           
protected abstract  org.opengis.referencing.cs.CoordinateSystem generateCoordinateSystem(java.lang.String code)
           
protected abstract  org.opengis.referencing.cs.CoordinateSystemAxis generateCoordinateSystemAxis(java.lang.String code)
           
protected abstract  org.opengis.referencing.datum.Datum generateDatum(java.lang.String code)
           
protected abstract  org.opengis.referencing.datum.Ellipsoid generateEllipsoid(java.lang.String code)
           
protected abstract  java.util.Set generateFromCoordinateReferenceSystemCodes(java.lang.String sourceCode, java.lang.String targetCode)
           
protected abstract  org.opengis.referencing.IdentifiedObject generateObject(java.lang.String code)
           
protected abstract  org.opengis.referencing.datum.PrimeMeridian generatePrimeMeridian(java.lang.String code)
           
protected abstract  javax.measure.unit.Unit<?> generateUnit(java.lang.String code)
           
abstract  org.opengis.metadata.citation.Citation getAuthority()
          Returns the organization or party responsible for definition and maintenance of the database.
 java.util.Set getAuthorityCodes(java.lang.Class type)
           
abstract  org.opengis.util.InternationalString getDescriptionText(java.lang.String code)
           
 IdentifiedObjectFinder getIdentifiedObjectFinder(java.lang.Class type)
          Returns a finder which can be used for looking up unidentified objects.
protected  org.opengis.referencing.NoSuchAuthorityCodeException noSuchAuthorityCode(java.lang.Class type, java.lang.String code, java.lang.ClassCastException cause)
          Creates an exception for an unknown authority code.
protected  java.lang.String toKey(java.lang.String code)
           
protected  java.lang.String trimAuthority(java.lang.String code)
          Trims the authority scope, if present.
 
Methods inherited from class org.geotools.referencing.factory.AbstractAuthorityFactory
createExtent, createOperationMethod, createParameterDescriptor, getBackingStoreDescription, noSuchAuthorityCode
 
Methods inherited from class org.geotools.referencing.factory.ReferencingFactory
ensureNonNull, getVendor
 
Methods inherited from class org.geotools.factory.AbstractFactory
addImplementationHints, equals, getImplementationHints, 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.opengis.referencing.Factory
getVendor
 
Methods inherited from interface org.geotools.factory.Factory
getImplementationHints
 

Field Detail

cache

protected ObjectCache cache
Cache to be used for referencing objects defined by this authority. Please note that this cache may be shared!

Your cache may grow to considerable size during actual use; in addition to storing CoordinateReferenceSystems (by code); it will also store all the component parts (each under its own code), along with MathTransformations between two CoordinateReferenceSystems. So even if you are only planning on working with 50 CoordianteReferenceSystems please keep in mind that you will need larger cache size in order to prevent a bottleneck.


factories

protected ReferencingFactoryContainer factories
A container of the "real factories" actually used to construct objects.

Constructor Detail

AbstractCachedAuthorityFactory

protected AbstractCachedAuthorityFactory(int priority)
Constructs an instance making use of the default cache.

Parameters:
factory - The factory to cache. Can not be null.

AbstractCachedAuthorityFactory

protected AbstractCachedAuthorityFactory(int priority,
                                         Hints hints)
Constructs an instance making use of the default cache.

Parameters:
factory - The factory to cache. Can not be null.

AbstractCachedAuthorityFactory

protected AbstractCachedAuthorityFactory(int priority,
                                         ObjectCache cache,
                                         ReferencingFactoryContainer container)
Constructs an instance making use of the indicated cache.

This constructor is protected because subclasses must declare which of the DatumAuthorityFactory, CSAuthorityFactory, CRSAuthorityFactory and CoordinateOperationAuthorityFactory interfaces they choose to implement.

Parameters:
factory - The factory to cache. Can not be null.
maxStrongReferences - The maximum number of objects to keep by strong reference.
Method Detail

toKey

protected java.lang.String toKey(java.lang.String code)

trimAuthority

protected java.lang.String trimAuthority(java.lang.String code)
Trims the authority scope, if present. For example if this factory is an EPSG authority factory and the specified code start with the "EPSG:" prefix, then the prefix is removed. Otherwise, the string is returned unchanged (except for leading and trailing spaces).

Overrides:
trimAuthority in class AbstractAuthorityFactory
Parameters:
code - The code to trim.
Returns:
The code without the authority scope.

noSuchAuthorityCode

protected org.opengis.referencing.NoSuchAuthorityCodeException noSuchAuthorityCode(java.lang.Class type,
                                                                                   java.lang.String code,
                                                                                   java.lang.ClassCastException cause)
Creates an exception for an unknown authority code. This convenience method is provided for implementation of createXXX methods.

Parameters:
type - The GeoAPI interface that was to be created (e.g. CoordinateReferenceSystem.class).
code - The unknown authority code.
cause - The cause of this error, or null.
Returns:
An exception initialized with an error message built from the specified informations.

getAuthority

public abstract org.opengis.metadata.citation.Citation getAuthority()
Description copied from class: AbstractAuthorityFactory
Returns the organization or party responsible for definition and maintenance of the database.

Specified by:
getAuthority in interface org.opengis.referencing.AuthorityFactory
Specified by:
getAuthority in class AbstractAuthorityFactory

getAuthorityCodes

public java.util.Set getAuthorityCodes(java.lang.Class type)
                                throws org.opengis.referencing.FactoryException
Specified by:
getAuthorityCodes in interface org.opengis.referencing.AuthorityFactory
Throws:
org.opengis.referencing.FactoryException

generateAuthorityCodes

protected abstract java.util.Set generateAuthorityCodes(java.lang.Class type)
                                                 throws org.opengis.referencing.FactoryException
Throws:
org.opengis.referencing.FactoryException

getDescriptionText

public abstract org.opengis.util.InternationalString getDescriptionText(java.lang.String code)
                                                                 throws org.opengis.referencing.FactoryException
Specified by:
getDescriptionText in interface org.opengis.referencing.AuthorityFactory
Throws:
org.opengis.referencing.FactoryException

createObject

public org.opengis.referencing.IdentifiedObject createObject(java.lang.String code)
                                                      throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Returns an arbitrary object from a code. The returned object will typically be an instance of Datum, CoordinateSystem, CoordinateReferenceSystem or CoordinateOperation. The default implementation always throw an exception. Subclasses should override this method if they are capable to automatically detect the object type from its code.

Specified by:
createObject in interface org.opengis.referencing.AuthorityFactory
Overrides:
createObject in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.
See Also:
AbstractAuthorityFactory.createCoordinateReferenceSystem(java.lang.String), AbstractAuthorityFactory.createDatum(java.lang.String), AbstractAuthorityFactory.createEllipsoid(java.lang.String), AbstractAuthorityFactory.createUnit(java.lang.String)

generateObject

protected abstract org.opengis.referencing.IdentifiedObject generateObject(java.lang.String code)
                                                                    throws org.opengis.referencing.FactoryException
Throws:
org.opengis.referencing.FactoryException

createCompoundCRS

public org.opengis.referencing.crs.CompoundCRS createCompoundCRS(java.lang.String code)
                                                          throws org.opengis.referencing.FactoryException
Creates a 3D coordinate reference system from a code.

Specified by:
createCompoundCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Overrides:
createCompoundCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.

createCoordinateReferenceSystem

public org.opengis.referencing.crs.CoordinateReferenceSystem createCoordinateReferenceSystem(java.lang.String code)
                                                                                      throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Returns an arbitrary coordinate reference system from a code. If the coordinate reference system type is know at compile time, it is recommended to invoke the most precise method instead of this one (for example  createGeographicCRS(code)  instead of  createCoordinateReferenceSystem(code)  if the caller know he is asking for a geographic coordinate reference system).

Specified by:
createCoordinateReferenceSystem in interface org.opengis.referencing.crs.CRSAuthorityFactory
Overrides:
createCoordinateReferenceSystem in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.
See Also:
AbstractAuthorityFactory.createGeographicCRS(java.lang.String), AbstractAuthorityFactory.createProjectedCRS(java.lang.String), AbstractAuthorityFactory.createVerticalCRS(java.lang.String), AbstractAuthorityFactory.createTemporalCRS(java.lang.String), AbstractAuthorityFactory.createCompoundCRS(java.lang.String)

generateCoordinateReferenceSystem

protected abstract org.opengis.referencing.crs.CoordinateReferenceSystem generateCoordinateReferenceSystem(java.lang.String code)
                                                                                                    throws org.opengis.referencing.FactoryException
Throws:
org.opengis.referencing.FactoryException

createDerivedCRS

public org.opengis.referencing.crs.DerivedCRS createDerivedCRS(java.lang.String code)
                                                        throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Creates a derived coordinate reference system from a code.

Specified by:
createDerivedCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Overrides:
createDerivedCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.

createEngineeringCRS

public org.opengis.referencing.crs.EngineeringCRS createEngineeringCRS(java.lang.String code)
                                                                throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Creates a engineering coordinate reference system from a code.

Specified by:
createEngineeringCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Overrides:
createEngineeringCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.

createGeocentricCRS

public org.opengis.referencing.crs.GeocentricCRS createGeocentricCRS(java.lang.String code)
                                                              throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Returns a geocentric coordinate reference system from a code.

Specified by:
createGeocentricCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Overrides:
createGeocentricCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed.
See Also:
AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)

createGeographicCRS

public org.opengis.referencing.crs.GeographicCRS createGeographicCRS(java.lang.String code)
                                                              throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Returns a geographic coordinate reference system from a code.

Specified by:
createGeographicCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Overrides:
createGeographicCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.
See Also:
AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)

createImageCRS

public org.opengis.referencing.crs.ImageCRS createImageCRS(java.lang.String code)
                                                    throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Creates a image coordinate reference system from a code.

Specified by:
createImageCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Overrides:
createImageCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.

createProjectedCRS

public org.opengis.referencing.crs.ProjectedCRS createProjectedCRS(java.lang.String code)
                                                            throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Returns a projected coordinate reference system from a code.

Specified by:
createProjectedCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Overrides:
createProjectedCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.
See Also:
AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)

createTemporalCRS

public org.opengis.referencing.crs.TemporalCRS createTemporalCRS(java.lang.String code)
                                                          throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Creates a temporal coordinate reference system from a code.

Specified by:
createTemporalCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Overrides:
createTemporalCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.
See Also:
AbstractAuthorityFactory.createTemporalDatum(java.lang.String)

createVerticalCRS

public org.opengis.referencing.crs.VerticalCRS createVerticalCRS(java.lang.String code)
                                                          throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Creates a vertical coordinate reference system from a code.

Specified by:
createVerticalCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Overrides:
createVerticalCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.
See Also:
AbstractAuthorityFactory.createVerticalDatum(java.lang.String)

createCartesianCS

public org.opengis.referencing.cs.CartesianCS createCartesianCS(java.lang.String code)
                                                         throws org.opengis.referencing.FactoryException
Creates a cartesian coordinate system from a code. The default implementation invokes createCoordinateSystem(code).

Specified by:
createCartesianCS in interface org.opengis.referencing.cs.CSAuthorityFactory
Overrides:
createCartesianCS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.

createCoordinateSystem

public org.opengis.referencing.cs.CoordinateSystem createCoordinateSystem(java.lang.String code)
                                                                   throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Returns an arbitrary coordinate system from a code. The default implementation invokes createObject(code).

Specified by:
createCoordinateSystem in interface org.opengis.referencing.cs.CSAuthorityFactory
Overrides:
createCoordinateSystem in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.

generateCoordinateSystem

protected abstract org.opengis.referencing.cs.CoordinateSystem generateCoordinateSystem(java.lang.String code)
                                                                                 throws org.opengis.referencing.FactoryException
Throws:
org.opengis.referencing.FactoryException

createCoordinateSystemAxis

public org.opengis.referencing.cs.CoordinateSystemAxis createCoordinateSystemAxis(java.lang.String code)
                                                                           throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Returns a coordinate system axis from a code. The default implementation invokes createObject(code).

Specified by:
createCoordinateSystemAxis in interface org.opengis.referencing.cs.CSAuthorityFactory
Overrides:
createCoordinateSystemAxis in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The axis for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.

generateCoordinateSystemAxis

protected abstract org.opengis.referencing.cs.CoordinateSystemAxis generateCoordinateSystemAxis(java.lang.String code)
                                                                                         throws org.opengis.referencing.FactoryException
Throws:
org.opengis.referencing.FactoryException

createCylindricalCS

public org.opengis.referencing.cs.CylindricalCS createCylindricalCS(java.lang.String code)
                                                             throws org.opengis.referencing.FactoryException
The default implementation invokes createCoordinateSystem(code).

Specified by:
createCylindricalCS in interface org.opengis.referencing.cs.CSAuthorityFactory
Overrides:
createCylindricalCS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.

createEllipsoidalCS

public org.opengis.referencing.cs.EllipsoidalCS createEllipsoidalCS(java.lang.String code)
                                                             throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Creates an ellipsoidal coordinate system from a code. The default implementation invokes createCoordinateSystem(code).

Specified by:
createEllipsoidalCS in interface org.opengis.referencing.cs.CSAuthorityFactory
Overrides:
createEllipsoidalCS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.

createPolarCS

public org.opengis.referencing.cs.PolarCS createPolarCS(java.lang.String code)
                                                 throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Creates a polar coordinate system from a code. The default implementation invokes createCoordinateSystem(code).

Specified by:
createPolarCS in interface org.opengis.referencing.cs.CSAuthorityFactory
Overrides:
createPolarCS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.

createSphericalCS

public org.opengis.referencing.cs.SphericalCS createSphericalCS(java.lang.String code)
                                                         throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Creates a spherical coordinate system from a code. The default implementation invokes createCoordinateSystem(code).

Specified by:
createSphericalCS in interface org.opengis.referencing.cs.CSAuthorityFactory
Overrides:
createSphericalCS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.

createTimeCS

public org.opengis.referencing.cs.TimeCS createTimeCS(java.lang.String code)
                                               throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Creates a temporal coordinate system from a code. The default implementation invokes createCoordinateSystem(code).

Specified by:
createTimeCS in interface org.opengis.referencing.cs.CSAuthorityFactory
Overrides:
createTimeCS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.

createUnit

public javax.measure.unit.Unit<?> createUnit(java.lang.String code)
                                      throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Returns an unit from a code. The default implementation invokes createObject(code).

Specified by:
createUnit in interface org.opengis.referencing.cs.CSAuthorityFactory
Overrides:
createUnit in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The unit for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.

generateUnit

protected abstract javax.measure.unit.Unit<?> generateUnit(java.lang.String code)
                                                    throws org.opengis.referencing.FactoryException
Throws:
org.opengis.referencing.FactoryException

createVerticalCS

public org.opengis.referencing.cs.VerticalCS createVerticalCS(java.lang.String code)
                                                       throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Creates a vertical coordinate system from a code. The default implementation invokes createCoordinateSystem(code).

Specified by:
createVerticalCS in interface org.opengis.referencing.cs.CSAuthorityFactory
Overrides:
createVerticalCS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate system for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.

createDatum

public org.opengis.referencing.datum.Datum createDatum(java.lang.String code)
                                                throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Returns an arbitrary datum from a code. The default implementation invokes createObject(code).

Specified by:
createDatum in interface org.opengis.referencing.datum.DatumAuthorityFactory
Overrides:
createDatum in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The datum for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.
See Also:
AbstractAuthorityFactory.createGeodeticDatum(java.lang.String), AbstractAuthorityFactory.createVerticalDatum(java.lang.String), AbstractAuthorityFactory.createTemporalDatum(java.lang.String)

generateDatum

protected abstract org.opengis.referencing.datum.Datum generateDatum(java.lang.String code)
                                                              throws org.opengis.referencing.FactoryException
Throws:
org.opengis.referencing.FactoryException

createEllipsoid

public org.opengis.referencing.datum.Ellipsoid createEllipsoid(java.lang.String code)
                                                        throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Returns an ellipsoid from a code. The default implementation invokes createObject(code).

Specified by:
createEllipsoid in interface org.opengis.referencing.datum.DatumAuthorityFactory
Overrides:
createEllipsoid in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The ellipsoid for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.
See Also:
AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)

generateEllipsoid

protected abstract org.opengis.referencing.datum.Ellipsoid generateEllipsoid(java.lang.String code)
                                                                      throws org.opengis.referencing.FactoryException
Throws:
org.opengis.referencing.FactoryException

createEngineeringDatum

public org.opengis.referencing.datum.EngineeringDatum createEngineeringDatum(java.lang.String code)
                                                                      throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Creates a engineering datum from a code. The default implementation invokes createDatum(code).

Specified by:
createEngineeringDatum in interface org.opengis.referencing.datum.DatumAuthorityFactory
Overrides:
createEngineeringDatum in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The datum for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.
See Also:
AbstractAuthorityFactory.createEngineeringCRS(java.lang.String)

createGeodeticDatum

public org.opengis.referencing.datum.GeodeticDatum createGeodeticDatum(java.lang.String code)
                                                                throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Returns a geodetic datum from a code. The default implementation invokes createDatum(code).

Specified by:
createGeodeticDatum in interface org.opengis.referencing.datum.DatumAuthorityFactory
Overrides:
createGeodeticDatum in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The datum for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.
See Also:
AbstractAuthorityFactory.createEllipsoid(java.lang.String), AbstractAuthorityFactory.createPrimeMeridian(java.lang.String), AbstractAuthorityFactory.createGeographicCRS(java.lang.String), AbstractAuthorityFactory.createProjectedCRS(java.lang.String)

createImageDatum

public org.opengis.referencing.datum.ImageDatum createImageDatum(java.lang.String code)
                                                          throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Creates a image datum from a code. The default implementation invokes createDatum(code).

Specified by:
createImageDatum in interface org.opengis.referencing.datum.DatumAuthorityFactory
Overrides:
createImageDatum in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The datum for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.
See Also:
AbstractAuthorityFactory.createImageCRS(java.lang.String)

createPrimeMeridian

public org.opengis.referencing.datum.PrimeMeridian createPrimeMeridian(java.lang.String code)
                                                                throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Returns a prime meridian from a code. The default implementation invokes createObject(code).

Specified by:
createPrimeMeridian in interface org.opengis.referencing.datum.DatumAuthorityFactory
Overrides:
createPrimeMeridian in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The prime meridian for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.
See Also:
AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)

generatePrimeMeridian

protected abstract org.opengis.referencing.datum.PrimeMeridian generatePrimeMeridian(java.lang.String code)
                                                                              throws org.opengis.referencing.FactoryException
Throws:
org.opengis.referencing.FactoryException

createTemporalDatum

public org.opengis.referencing.datum.TemporalDatum createTemporalDatum(java.lang.String code)
                                                                throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Creates a temporal datum from a code. The default implementation invokes createDatum(code).

Specified by:
createTemporalDatum in interface org.opengis.referencing.datum.DatumAuthorityFactory
Overrides:
createTemporalDatum in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The datum for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.
See Also:
AbstractAuthorityFactory.createTemporalCRS(java.lang.String)

createVerticalDatum

public org.opengis.referencing.datum.VerticalDatum createVerticalDatum(java.lang.String code)
                                                                throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Creates a vertical datum from a code. The default implementation invokes createDatum(code).

Specified by:
createVerticalDatum in interface org.opengis.referencing.datum.DatumAuthorityFactory
Overrides:
createVerticalDatum in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The datum for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.
See Also:
AbstractAuthorityFactory.createVerticalCRS(java.lang.String)

createCoordinateOperation

public org.opengis.referencing.operation.CoordinateOperation createCoordinateOperation(java.lang.String code)
                                                                                throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Creates an operation from a single operation code.

Specified by:
createCoordinateOperation in interface org.opengis.referencing.operation.CoordinateOperationAuthorityFactory
Overrides:
createCoordinateOperation in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The operation for the given code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified code was not found.
org.opengis.referencing.FactoryException - if the object creation failed for some other reason.

generateCoordinateOperation

protected abstract org.opengis.referencing.operation.CoordinateOperation generateCoordinateOperation(java.lang.String code)
                                                                                              throws org.opengis.referencing.FactoryException
Throws:
org.opengis.referencing.FactoryException

createFromCoordinateReferenceSystemCodes

public java.util.Set createFromCoordinateReferenceSystemCodes(java.lang.String sourceCode,
                                                              java.lang.String targetCode)
                                                       throws org.opengis.referencing.FactoryException
Description copied from class: AbstractAuthorityFactory
Creates an operation from coordinate reference system codes. The default implementation returns an empty set. We do not delegate to some kind of coordinate operation factory method because the usual contract for this method is to extract the information from an authority database like EPSG, not to compute operations on-the-fly.

Rational: Coordinate operation factory backed by an authority will invoke this method. If this method invoked the coordinate operation factory in turn, the application could be trapped in infinite recursive calls.

Specified by:
createFromCoordinateReferenceSystemCodes in interface org.opengis.referencing.operation.CoordinateOperationAuthorityFactory
Overrides:
createFromCoordinateReferenceSystemCodes in class AbstractAuthorityFactory
Parameters:
sourceCode - Coded value of source coordinate reference system.
targetCode - Coded value of target coordinate reference system.
Returns:
The operations from sourceCRS to targetCRS.
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.

generateFromCoordinateReferenceSystemCodes

protected abstract java.util.Set generateFromCoordinateReferenceSystemCodes(java.lang.String sourceCode,
                                                                            java.lang.String targetCode)
                                                                     throws org.opengis.referencing.FactoryException
Throws:
org.opengis.referencing.FactoryException

dispose

public void dispose()
             throws org.opengis.referencing.FactoryException
We will clear out our cache and factories reference

Overrides:
dispose in class AbstractAuthorityFactory
Throws:
org.opengis.referencing.FactoryException

getIdentifiedObjectFinder

public IdentifiedObjectFinder getIdentifiedObjectFinder(java.lang.Class type)
                                                 throws org.opengis.referencing.FactoryException
Returns a finder which can be used for looking up unidentified objects. The default implementation delegates lookup to the underlying backing store and caches the result.

Overrides:
getIdentifiedObjectFinder in class AbstractAuthorityFactory
Parameters:
type - The type of objects to look for. Should be a GeoAPI interface like GeographicCRS.class, but this method accepts also implementation class. If the type is unknown, use IdentifiedObject.class. A more accurate type may help to speed up the search, since it reduces the amount of tables to scan in some implementations like the factories backed by EPSG database.
Returns:
A finder to use for looking up unidentified objects.
Throws:
org.opengis.referencing.FactoryException - if the finder can not be created.
Since:
2.4


Copyright © 1996-2010 Geotools. All Rights Reserved.