|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.factory.AbstractFactory org.geotools.referencing.factory.AbstractFactory org.geotools.referencing.factory.AbstractAuthorityFactory org.geotools.referencing.factory.BufferedAuthorityFactory org.geotools.referencing.factory.DeferredAuthorityFactory org.geotools.referencing.factory.epsg.DefaultFactory
The default EPSG factory to be registered in FactoryFinder
. This factory works as a
proxy for 1) select an appropriate FactoryUsingSQL
subclass at runtime and 2) cache CRS
objects for better performances. The database connection is specified through a
DataSource
binded to the {@value}
name in Java
Naming and Directory Interfaces (JNDI). If no binding is found under that name, data
sources are searched in the following directory:
The contains a default binding using the JDBC-ODBC bridge. This default binding expects an "" database registered as an ODBC data source. See the package javadoc for installation instructions.META-INF/services/org.geotools.referencing.factory.epsg.DataSource
Users should not creates instance of this class directly. They should invoke one of
FactoryFinder.getFooAuthorityFactory("EPSG")
methods instead.
DataSource
Field Summary | |
static java.lang.String |
DATASOURCE_NAME
The JDBC data source name in JNDI. |
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 | |
DefaultFactory()
Constructs an authority factory using the default set of factories. |
|
DefaultFactory(Hints hints)
Constructs an authority factory using a set of factories created from the specified hints. |
Method Summary | |
protected boolean |
canDisposeBackingStore(AbstractAuthorityFactory backingStore)
Returns if the backing store can be disposed now. |
protected AbstractAuthorityFactory |
createBackingStore()
Creates the backing store authority factory. |
org.opengis.metadata.citation.Citation |
getAuthority()
Returns the authority for this EPSG database. |
DataSource |
getDataSource()
Returns the data source for the EPSG database. |
static void |
main(java.lang.String[] args)
Constructs an object from the EPSG database and print its WKT (Well Know Text) to the standard output. |
void |
onDeregistration(javax.imageio.spi.ServiceRegistry registry,
java.lang.Class category)
Called when this factory is removed from the given of the given . |
void |
onRegistration(javax.imageio.spi.ServiceRegistry registry,
java.lang.Class category)
Called when this factory is added to the given of the given . |
void |
setDataSource(DataSource datasource)
Set the data source for the EPSG database. |
Methods inherited from class org.geotools.referencing.factory.DeferredAuthorityFactory |
dispose, isConnected, isReady, setTimeout |
Methods inherited from class org.geotools.referencing.factory.AbstractAuthorityFactory |
getImplementationHints, noSuchAuthorityCode, trimAuthority |
Methods inherited from class org.geotools.referencing.factory.AbstractFactory |
ensureNonNull |
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 |
Field Detail |
public static final java.lang.String DATASOURCE_NAME
Constructor Detail |
public DefaultFactory()
public DefaultFactory(Hints hints)
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.
Method Detail |
public org.opengis.metadata.citation.Citation getAuthority()
getAuthority
in interface org.opengis.referencing.AuthorityFactory
getAuthority
in class BufferedAuthorityFactory
public final DataSource getDataSource() throws java.sql.SQLException
java.sql.SQLException
- if the connection to the EPSG database failed.public void setDataSource(DataSource datasource) throws java.sql.SQLException
FactoryFinder
, since it would have a system-wide effect.
datasource
- The new datasource.
java.sql.SQLException
- if an error occured.protected AbstractAuthorityFactory createBackingStore() throws org.opengis.referencing.FactoryException
{@value}
data source. If no data
source were found for that name, implementation declared in
are tested.
createBackingStore
in class DeferredAuthorityFactory
org.opengis.referencing.FactoryException
- if the constructor failed to connect to the EPSG database.
This exception usually has a SQLException
as its cause.protected boolean canDisposeBackingStore(AbstractAuthorityFactory backingStore)
DeferredAuthorityFactory.setTimeout(long)
if the factory
were not used during that time.
canDisposeBackingStore
in class DeferredAuthorityFactory
backingStore
- The backing store in process of being disposed.public void onRegistration(javax.imageio.spi.ServiceRegistry registry, java.lang.Class category)
onRegistration
in interface javax.imageio.spi.RegisterableService
onRegistration
in class AbstractAuthorityFactory
registry
- a where this factory has been registered.category
- a object indicating the registry category under which
this object has been registered.AbstractFactory.MINIMUM_PRIORITY
,
AbstractFactory.MAXIMUM_PRIORITY
,
FactoryFinder
public void onDeregistration(javax.imageio.spi.ServiceRegistry registry, java.lang.Class category)
onDeregistration
in interface javax.imageio.spi.RegisterableService
onDeregistration
in class AbstractFactory
registry
- A service registry from which this object is being (wholly or partially)
deregistered.category
- The registry category from which this object is being deregistered.public static void main(java.lang.String[] args)
Should print:java org.geotools.referencing.factory.epsg.DefaultFactory 4181
The following optional arguments are supported:GEOGCS["Luxembourg 1930", DATUM["Luxembourg 1930", etc...
charset
Sets the console encoding for this application output. This value has no impact on the data exchanged with the EPSG database.
Output the math transforms between every pairs of CRS.
args
- A list of EPSG code to display.
An arbitrary number of codes can be specified on the command line.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |