org.geotools.referencing.factory
Class PropertyAuthorityFactory

java.lang.Object
  extended byorg.geotools.factory.AbstractFactory
      extended byorg.geotools.referencing.factory.AbstractFactory
          extended byorg.geotools.referencing.factory.AbstractAuthorityFactory
              extended byorg.geotools.referencing.factory.PropertyAuthorityFactory
All Implemented Interfaces:
org.opengis.referencing.AuthorityFactory, org.opengis.referencing.operation.CoordinateOperationAuthorityFactory, org.opengis.referencing.crs.CRSAuthorityFactory, org.opengis.referencing.cs.CSAuthorityFactory, org.opengis.referencing.datum.DatumAuthorityFactory, Factory, org.opengis.referencing.Factory, javax.imageio.spi.RegisterableService

public class PropertyAuthorityFactory
extends AbstractAuthorityFactory

Default implementation for a coordinate reference system authority factory backed by a property file. This gives some of the benificts of using the EPSG database backed authority factory (for example), in a portable property file.

This factory doesn't cache any result. Any call to a method will send a new query to the EPSG database. For caching, this factory should be wrapped in some buffered factory like BufferedAuthorityFactory.

This authority factory has a low priority. By default, FactoryFinder will uses it only if it has been unable to get a connection to a more suitable database like EPSG.

Since:
2.1
Version:
$Id: PropertyAuthorityFactory.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Jody Garnett, Rueben Schulz, Martin Desruisseaux

Field Summary
 
Fields inherited from class org.geotools.referencing.factory.AbstractAuthorityFactory
factories
 
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
PropertyAuthorityFactory(FactoryGroup factories, org.opengis.metadata.citation.Citation authority, java.net.URL definitions)
          Loads from the specified property file.
 
Method Summary
 org.opengis.referencing.crs.CoordinateReferenceSystem createCoordinateReferenceSystem(java.lang.String code)
          Returns an arbitrary coordinate reference system from a code.
 org.opengis.referencing.IdentifiedObject createObject(java.lang.String code)
          Returns an arbitrary object from a code.
 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)
          Returns the set of authority codes of the given type.
 org.opengis.util.InternationalString getDescriptionText(java.lang.String code)
          Gets a description of the object corresponding to a code.
 java.lang.String getWKT(java.lang.String code)
          Returns the Well Know Text from a code.
 
Methods inherited from class org.geotools.referencing.factory.AbstractAuthorityFactory
createCartesianCS, createCompoundCRS, createCoordinateOperation, createCoordinateSystem, createCoordinateSystemAxis, createCylindricalCS, createDatum, createDerivedCRS, createEllipsoid, createEllipsoidalCS, createEngineeringCRS, createEngineeringDatum, createExtent, createFromCoordinateReferenceSystemCodes, createGeocentricCRS, createGeodeticDatum, createGeographicCRS, createImageCRS, createImageDatum, createOperationMethod, createParameterDescriptor, createPolarCS, createPrimeMeridian, createProjectedCRS, createSphericalCS, createTemporalCRS, createTemporalDatum, createTimeCS, createUnit, createVerticalCRS, createVerticalCS, createVerticalDatum, dispose, getBackingStoreDescription, getImplementationHints, noSuchAuthorityCode, onRegistration, trimAuthority
 
Methods inherited from class org.geotools.referencing.factory.AbstractFactory
ensureNonNull, getVendor
 
Methods inherited from class org.geotools.factory.AbstractFactory
onDeregistration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opengis.referencing.Factory
getVendor
 

Constructor Detail

PropertyAuthorityFactory

public PropertyAuthorityFactory(FactoryGroup factories,
                                org.opengis.metadata.citation.Citation authority,
                                java.net.URL definitions)
                         throws java.io.IOException
Loads from the specified property file.

Parameters:
factories - The underlying factories used for objects creation.
authority - The organization or party responsible for definition and maintenance of the database.
definitions - URL to the definition file.
Throws:
java.io.IOException - if the definitions can't be read.
Method Detail

getAuthority

public org.opengis.metadata.citation.Citation getAuthority()
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
Returns the set of authority codes of the given type. The type argument specify the base class. For example if this factory is an instance of CRSAuthorityFactory, then: The default implementaiton filters the set of codes based on the "PROJCS" and "GEOGCS" at the start of the WKT strings.

Parameters:
type - The spatial reference objects type (may be ).
Returns:
The set of authority codes for spatial reference objects of the given type. If this factory doesn't contains any object of the given type, then this method returns an empty set.
Throws:
org.opengis.referencing.FactoryException - if access to the underlying database failed.

getWKT

public java.lang.String getWKT(java.lang.String code)
                        throws org.opengis.referencing.NoSuchAuthorityCodeException
Returns the Well Know Text from a code.

Parameters:
code - Value allocated by authority.
Returns:
The Well Know Text (WKT) for the specified code.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified was not found.

getDescriptionText

public org.opengis.util.InternationalString getDescriptionText(java.lang.String code)
                                                        throws org.opengis.referencing.NoSuchAuthorityCodeException,
                                                               org.opengis.referencing.FactoryException
Gets a description of the object corresponding to a code.

Parameters:
code - Value allocated by authority.
Returns:
A description of the object, or if the object corresponding to the specified has no description.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified was not found.
org.opengis.referencing.FactoryException - if the query failed for some other reason.

createObject

public org.opengis.referencing.IdentifiedObject createObject(java.lang.String code)
                                                      throws org.opengis.referencing.NoSuchAuthorityCodeException,
                                                             org.opengis.referencing.FactoryException
Returns an arbitrary object from a 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 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)

createCoordinateReferenceSystem

public org.opengis.referencing.crs.CoordinateReferenceSystem createCoordinateReferenceSystem(java.lang.String code)
                                                                                      throws org.opengis.referencing.NoSuchAuthorityCodeException,
                                                                                             org.opengis.referencing.FactoryException
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.

Specified by:
createCoordinateReferenceSystem in interface org.opengis.referencing.crs.CRSAuthorityFactory
Overrides:
createCoordinateReferenceSystem in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Throws:
org.opengis.referencing.NoSuchAuthorityCodeException - if the specified 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)


Copyright © GeoTools. All Rights Reserved.