Java Doc for DirectEpsgFactory.java in  » GIS » GeoTools-2.4.1 » org » geotools » referencing » factory » epsg » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.referencing.factory.epsg 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.geotools.referencing.factory.AbstractAuthorityFactory
   org.geotools.referencing.factory.DirectAuthorityFactory
      org.geotools.referencing.factory.epsg.DirectEpsgFactory

All known Subclasses:   org.geotools.referencing.factory.epsg.FactoryUsingSQL,  org.geotools.referencing.factory.epsg.AccessDialectEpsgFactory,
DirectEpsgFactory
abstract public class DirectEpsgFactory extends DirectAuthorityFactory implements CRSAuthorityFactory,CSAuthorityFactory,DatumAuthorityFactory,CoordinateOperationAuthorityFactory(Code)
A coordinate reference system factory backed by the EPSG database tables.

The EPSG database is freely available at http://www.epsg.org. Current version of this class requires EPSG database version 6.6 or above.

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

This class is abstract - please see the subclasses for dialect specific implementations:

These factories accepts names as well as numerical identifiers. For example "NTF (Paris) / France I" and "27581" both fetchs the same object. However, names may be ambiguous since the same name may be used for more than one object. This is the case of "WGS 84" for example. If such an ambiguity is found, an exception will be thrown. If names are not wanted as a legal EPSG code, subclasses can override the DirectEpsgFactory.isPrimaryKey method.
since:
   2.4
version:
   $Id: DirectEpsgFactory.java 28264 2007-12-05 21:53:08Z desruisseaux $
author:
   Yann Cézard
author:
   Martin Desruisseaux
author:
   Rueben Schulz
author:
   Matthias Basler
author:
   Andrea Aime


Field Summary
final static  StringSHUTDOWN_THREAD
     The name of the thread to execute at JVM shutdown.
 AbstractAuthorityFactorybuffered
     The buffered authority factory, or this if none.
final protected  Connectionconnection
     The connection to the EPSG database.

Constructor Summary
public  DirectEpsgFactory(Hints userHints, Connection connection)
     Constructs an authority factory using the specified connection.

Method Summary
abstract protected  StringadaptSQL(String statement)
     Invoked when a new PreparedStatement is about to be created from a SQL string. Since the EPSG database is available mainly in MS-Access format, SQL statements are formatted using some syntax specific to this particular database software (for example "SELECT * FROM [Coordinate Reference System]").
final synchronized  booleancanDispose()
     Returns true if it is safe to dispose this factory.
public synchronized  CoordinateOperationcreateCoordinateOperation(String code)
     Returns a coordinate operation from a code. The returned object will either be a or a , depending on the code.
Parameters:
  code - Value allocated by authority.
public synchronized  CoordinateReferenceSystemcreateCoordinateReferenceSystem(String code)
     Returns a coordinate reference system from a code.
Parameters:
  code - Value allocated by authority.
public synchronized  CoordinateSystemcreateCoordinateSystem(String code)
     Returns a coordinate system from a code.
Parameters:
  code - Value allocated by authority.
public synchronized  CoordinateSystemAxiscreateCoordinateSystemAxis(String code)
     Returns a from a code.
public synchronized  DatumcreateDatum(String code)
     Returns a datum from a code.
Parameters:
  code - Value allocated by authority.
public synchronized  EllipsoidcreateEllipsoid(String code)
     Returns an ellipsoid from a code.
Parameters:
  code - The EPSG value.
public synchronized  ExtentcreateExtent(String code)
     Returns an area of use.
Parameters:
  code - Value allocated by authority.
public synchronized  SetcreateFromCoordinateReferenceSystemCodes(String sourceCode, String targetCode)
     Creates operations from coordinate reference system codes.
public synchronized  IdentifiedObjectcreateObject(String code)
     Returns an arbitrary object from a code. The default implementation invokes one of DirectEpsgFactory.createCoordinateReferenceSystem , DirectEpsgFactory.createCoordinateSystem , DirectEpsgFactory.createDatum , DirectEpsgFactory.createEllipsoid , or DirectEpsgFactory.createUnit methods according the object type.
Parameters:
  code - The EPSG value.
public synchronized  OperationMethodcreateOperationMethod(String code)
     Returns an operation method from a code.
Parameters:
  code - The operation method code allocated by EPSG authority.
throws:
  NoSuchAuthorityCodeException - if this method can't find the requested code.
throws:
  FactoryException - if some other kind of failure occured in the backingstore.
public synchronized  ParameterDescriptorcreateParameterDescriptor(String code)
     Returns a parameter descriptor from a code.
Parameters:
  code - The parameter descriptor code allocated by EPSG authority.
throws:
  NoSuchAuthorityCodeException - if this method can't find the requested code.
throws:
  FactoryException - if some other kind of failure occured in the backingstore.
public synchronized  PrimeMeridiancreatePrimeMeridian(String code)
     Returns a prime meridian, relative to Greenwich.
Parameters:
  code - Value allocated by authority.
public synchronized  UnitcreateUnit(String code)
     Returns an unit from a code.
Parameters:
  code - Value allocated by authority.
public synchronized  voiddispose()
     Disposes any resources hold by this object.
final protected  voidfinalize()
     Invokes DirectEpsgFactory.dispose when this factory is garbage collected.
public synchronized  CitationgetAuthority()
     Returns the authority for this EPSG database.
public  SetgetAuthorityCodes(Class type)
     Returns the set of authority codes of the given type.

NOTE: This method returns a living connection to the underlying database. This means that the returned set can executes efficiently idioms like the following one:

getAuthorityCodes(typeothers)
But do not keep the returned reference for a long time.
public synchronized  StringgetBackingStoreDescription()
     Returns a description of the database engine.
public  InternationalStringgetDescriptionText(String code)
     Gets a description of the object corresponding to a code.
Parameters:
  code - Value allocated by authority.
public  IdentifiedObjectFindergetIdentifiedObjectFinder(Class type)
     Returns a finder which can be used for looking up unidentified objects.
Parameters:
  type - The type of objects to look for.
public  MapgetImplementationHints()
     Returns the implementation hints for this factory.
protected  booleanisPrimaryKey(String code)
     Returns true if the specified code may be a primary key in some table.
final  booleanisProjection(String code)
     Returns true if the for the specified code is a .
protected  voidshutdown(boolean active)
     Shutdown the database engine.

Field Detail
SHUTDOWN_THREAD
final static String SHUTDOWN_THREAD(Code)
The name of the thread to execute at JVM shutdown. This thread will be created by ThreadedEpsgFactory on registration. It will be checked by DirectEpsgFactory.dispose in order to determine if we are in the process for shutting down the database engine.



buffered
AbstractAuthorityFactory buffered(Code)
The buffered authority factory, or this if none. This field is set to a different value by ThreadedEpsgFactory only, which will point toward a buffered factory wrapping this DirectEpsgFactory for efficienty.



connection
final protected Connection connection(Code)
The connection to the EPSG database.




Constructor Detail
DirectEpsgFactory
public DirectEpsgFactory(Hints userHints, Connection connection)(Code)
Constructs an authority factory using the specified connection.
Parameters:
  userHints - The underlying factories used for objects creation.
Parameters:
  connection - The connection to the underlying EPSG database.




Method Detail
adaptSQL
abstract protected String adaptSQL(String statement)(Code)
Invoked when a new PreparedStatement is about to be created from a SQL string. Since the EPSG database is available mainly in MS-Access format, SQL statements are formatted using some syntax specific to this particular database software (for example "SELECT * FROM [Coordinate Reference System]"). When providing subclass targeting another database vendor, then this method should be overridden in order to adapt the local SQL syntax.

For example a subclass connecting to a PostgreSQL database could replace all spaces (" ") between watching braces ("[" and "]") by underscore ("_").
Parameters:
  statement - The statement in MS-Access syntax. The SQL statement to use. The default implementation returns the string unchanged.




canDispose
final synchronized boolean canDispose()(Code)
Returns true if it is safe to dispose this factory. This method is invoked indirectly by ThreadedEpsgFactory after some timeout in order to release resources. This method will block the disposal if some are still in use.



createCoordinateOperation
public synchronized CoordinateOperation createCoordinateOperation(String code) throws FactoryException(Code)
Returns a coordinate operation from a code. The returned object will either be a or a , depending on the code.
Parameters:
  code - Value allocated by authority. The coordinate operation object.
throws:
  NoSuchAuthorityCodeException - if this method can't find the requested code.
throws:
  FactoryException - if some other kind of failure occured in the backingstore. This exception usually have SQLException as its cause.



createCoordinateReferenceSystem
public synchronized CoordinateReferenceSystem createCoordinateReferenceSystem(String code) throws FactoryException(Code)
Returns a coordinate reference system from a code.
Parameters:
  code - Value allocated by authority. The coordinate reference system object.
throws:
  NoSuchAuthorityCodeException - if this method can't find the requested code.
throws:
  FactoryException - if some other kind of failure occured in the backingstore. This exception usually have SQLException as its cause.



createCoordinateSystem
public synchronized CoordinateSystem createCoordinateSystem(String code) throws FactoryException(Code)
Returns a coordinate system from a code.
Parameters:
  code - Value allocated by authority. The coordinate system object.
throws:
  NoSuchAuthorityCodeException - if this method can't find the requested code.
throws:
  FactoryException - if some other kind of failure occured in the backingstore. This exception usually have SQLException as its cause.



createCoordinateSystemAxis
public synchronized CoordinateSystemAxis createCoordinateSystemAxis(String code) throws FactoryException(Code)
Returns a from a code.
Parameters:
  code - Value allocated by authority.
throws:
  NoSuchAuthorityCodeException - if the specified code was not found.
throws:
  FactoryException - if the object creation failed for some other reason.



createDatum
public synchronized Datum createDatum(String code) throws FactoryException(Code)
Returns a datum from a code.
Parameters:
  code - Value allocated by authority. The datum object.
throws:
  NoSuchAuthorityCodeException - if this method can't find the requested code.
throws:
  FactoryException - if some other kind of failure occured in the backingstore. This exception usually have SQLException as its cause.VerticalDatumType.GEOIDAL



createEllipsoid
public synchronized Ellipsoid createEllipsoid(String code) throws FactoryException(Code)
Returns an ellipsoid from a code.
Parameters:
  code - The EPSG value. The ellipsoid object.
throws:
  NoSuchAuthorityCodeException - if this method can't find the requested code.
throws:
  FactoryException - if some other kind of failure occured in the backingstore. This exception usually have SQLException as its cause.



createExtent
public synchronized Extent createExtent(String code) throws FactoryException(Code)
Returns an area of use.
Parameters:
  code - Value allocated by authority. The area of use.
throws:
  NoSuchAuthorityCodeException - if this method can't find the requested code.
throws:
  FactoryException - if some other kind of failure occured in the backingstore. This exception usually have SQLException as its cause.



createFromCoordinateReferenceSystemCodes
public synchronized Set createFromCoordinateReferenceSystemCodes(String sourceCode, String targetCode) throws FactoryException(Code)
Creates operations from coordinate reference system codes. The returned set is ordered with the most accurate operations first.
Parameters:
  sourceCode - Coded value of source coordinate reference system.
Parameters:
  targetCode - Coded value of target coordinate reference system.
throws:
  FactoryException - if the object creation failed.



createObject
public synchronized IdentifiedObject createObject(String code) throws FactoryException(Code)
Returns an arbitrary object from a code. The default implementation invokes one of DirectEpsgFactory.createCoordinateReferenceSystem , DirectEpsgFactory.createCoordinateSystem , DirectEpsgFactory.createDatum , DirectEpsgFactory.createEllipsoid , or DirectEpsgFactory.createUnit methods according the object type.
Parameters:
  code - The EPSG value. The object.
throws:
  NoSuchAuthorityCodeException - if this method can't find the requested code.
throws:
  FactoryException - if some other kind of failure occured in the backingstore. This exception usually have SQLException as its cause.



createOperationMethod
public synchronized OperationMethod createOperationMethod(String code) throws FactoryException(Code)
Returns an operation method from a code.
Parameters:
  code - The operation method code allocated by EPSG authority.
throws:
  NoSuchAuthorityCodeException - if this method can't find the requested code.
throws:
  FactoryException - if some other kind of failure occured in the backingstore. This exception usually have SQLException as its cause.



createParameterDescriptor
public synchronized ParameterDescriptor createParameterDescriptor(String code) throws FactoryException(Code)
Returns a parameter descriptor from a code.
Parameters:
  code - The parameter descriptor code allocated by EPSG authority.
throws:
  NoSuchAuthorityCodeException - if this method can't find the requested code.
throws:
  FactoryException - if some other kind of failure occured in the backingstore. This exception usually have SQLException as its cause.



createPrimeMeridian
public synchronized PrimeMeridian createPrimeMeridian(String code) throws FactoryException(Code)
Returns a prime meridian, relative to Greenwich.
Parameters:
  code - Value allocated by authority. The prime meridian object.
throws:
  NoSuchAuthorityCodeException - if this method can't find the requested code.
throws:
  FactoryException - if some other kind of failure occured in the backingstore. This exception usually have SQLException as its cause.



createUnit
public synchronized Unit createUnit(String code) throws FactoryException(Code)
Returns an unit from a code.
Parameters:
  code - Value allocated by authority. The unit object.
throws:
  NoSuchAuthorityCodeException - if this method can't find the requested code.
throws:
  FactoryException - if some other kind of failure occured in the backingstore. This exception usually have SQLException as its cause.



dispose
public synchronized void dispose() throws FactoryException(Code)
Disposes any resources hold by this object.
throws:
  FactoryException - if an error occured while closing the connection.



finalize
final protected void finalize() throws Throwable(Code)
Invokes DirectEpsgFactory.dispose when this factory is garbage collected.
throws:
  Throwable - if an error occured while closing the connection.



getAuthority
public synchronized Citation getAuthority()(Code)
Returns the authority for this EPSG database. This authority will contains the database version in the attribute, together with the .



getAuthorityCodes
public Set getAuthorityCodes(Class type) throws FactoryException(Code)
Returns the set of authority codes of the given type.

NOTE: This method returns a living connection to the underlying database. This means that the returned set can executes efficiently idioms like the following one:

getAuthorityCodes(typeothers)
But do not keep the returned reference for a long time. The returned set should stay valid even if retained for a long time (as long as this factory has not been ), but the existence of those long-living connections may prevent this factory to release some resources. If the set of codes is needed for a long time, copy their values in an other collection object.
Parameters:
  type - The spatial reference objects type (may be Object.class ). 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 methodreturns an .
throws:
  FactoryException - if access to the underlying database failed.



getBackingStoreDescription
public synchronized String getBackingStoreDescription() throws FactoryException(Code)
Returns a description of the database engine.
throws:
  FactoryException - if the database's metadata can't be fetched.



getDescriptionText
public InternationalString getDescriptionText(String code) throws FactoryException(Code)
Gets a description of the object corresponding to a code.
Parameters:
  code - Value allocated by authority. A description of the object, or null if the objectcorresponding to the specified code has no description.
throws:
  NoSuchAuthorityCodeException - if the specified code was not found.
throws:
  FactoryException - if the query failed for some other reason.



getIdentifiedObjectFinder
public IdentifiedObjectFinder getIdentifiedObjectFinder(Class type) throws FactoryException(Code)
Returns a finder which can be used for looking up unidentified objects.
Parameters:
  type - The type of objects to look for. A finder to use for looking up unidentified objects.
throws:
  FactoryException - if the finder can not be created.



getImplementationHints
public Map getImplementationHints()(Code)
Returns the implementation hints for this factory. The returned map contains all the values specified in , with the addition of Hints.VERSION VERSION .



isPrimaryKey
protected boolean isPrimaryKey(String code) throws FactoryException(Code)
Returns true if the specified code may be a primary key in some table. This method do not needs to checks any entry in the database. It should just checks from the syntax if the code looks like a valid EPSG identifier. The default implementation returns true if all non-space characters are .

When this method returns false , some createFoo(...) methods look for the code in the name column instead of the primary key column. This allows to accept the "NTF (Paris) / France I" string (for example) in addition to the "27581" primary key. Both should fetch the same object.

If this method returns true in all cases, then this factory never search for matching names. In such case, an appropriate exception will be thrown in createFoo(...) methods if the code is not found in the primary key column. Subclasses can overrides this method that way if this is the intended behavior.
Parameters:
  code - The code the inspect. true if the code is probably a primary key.
throws:
  FactoryException - if an unexpected error occured while inspecting the code.




isProjection
final boolean isProjection(String code) throws SQLException(Code)
Returns true if the for the specified code is a . The caller must have ensured that the designed operation is a before to invoke this method.



shutdown
protected void shutdown(boolean active) throws SQLException(Code)
Shutdown the database engine. This method is invoked twice by ThreadedEpsgFactory at JVM shutdown: one time before the is closed, and a second time after. This shutdown hook is usefull for embedded database engine starting a server process in addition to the client process. Just closing the connection is not enough for them. Example:

  • HSQL database engine needs to execute a "SHUTDOWN" statement using the before it is closed.
  • Derby database engine needs to instruct the after all connections have been closed.

The default implementation does nothing, which is suffisient for implementations connecting to a distant server (i.e. non-embedded database engine), for example or .
Parameters:
  active - true if the is alive, or false otherwise. This method is invoked first with active set to true ,then a second time with active set to false .
throws:
  SQLException - if this method failed to shutdown the database engine.




Fields inherited from org.geotools.referencing.factory.DirectAuthorityFactory
final protected ReferencingFactoryContainer factories(Code)(Java Doc)

Methods inherited from org.geotools.referencing.factory.DirectAuthorityFactory
public Map getImplementationHints()(Code)(Java Doc)

Methods inherited from org.geotools.referencing.factory.AbstractAuthorityFactory
public CartesianCS createCartesianCS(String code) throws FactoryException(Code)(Java Doc)
public CompoundCRS createCompoundCRS(String code) throws FactoryException(Code)(Java Doc)
public CoordinateOperation createCoordinateOperation(String code) throws FactoryException(Code)(Java Doc)
public CoordinateReferenceSystem createCoordinateReferenceSystem(String code) throws FactoryException(Code)(Java Doc)
public CoordinateSystem createCoordinateSystem(String code) throws FactoryException(Code)(Java Doc)
public CoordinateSystemAxis createCoordinateSystemAxis(String code) throws FactoryException(Code)(Java Doc)
public CylindricalCS createCylindricalCS(String code) throws FactoryException(Code)(Java Doc)
public Datum createDatum(String code) throws FactoryException(Code)(Java Doc)
public DerivedCRS createDerivedCRS(String code) throws FactoryException(Code)(Java Doc)
public Ellipsoid createEllipsoid(String code) throws FactoryException(Code)(Java Doc)
public EllipsoidalCS createEllipsoidalCS(String code) throws FactoryException(Code)(Java Doc)
public EngineeringCRS createEngineeringCRS(String code) throws FactoryException(Code)(Java Doc)
public EngineeringDatum createEngineeringDatum(String code) throws FactoryException(Code)(Java Doc)
public Extent createExtent(String code) throws FactoryException(Code)(Java Doc)
public Set createFromCoordinateReferenceSystemCodes(String sourceCode, String targetCode) throws FactoryException(Code)(Java Doc)
public GeocentricCRS createGeocentricCRS(String code) throws FactoryException(Code)(Java Doc)
public GeodeticDatum createGeodeticDatum(String code) throws FactoryException(Code)(Java Doc)
public GeographicCRS createGeographicCRS(String code) throws FactoryException(Code)(Java Doc)
public ImageCRS createImageCRS(String code) throws FactoryException(Code)(Java Doc)
public ImageDatum createImageDatum(String code) throws FactoryException(Code)(Java Doc)
public IdentifiedObject createObject(String code) throws FactoryException(Code)(Java Doc)
public OperationMethod createOperationMethod(String code) throws FactoryException(Code)(Java Doc)
public ParameterDescriptor createParameterDescriptor(String code) throws FactoryException(Code)(Java Doc)
public PolarCS createPolarCS(String code) throws FactoryException(Code)(Java Doc)
public PrimeMeridian createPrimeMeridian(String code) throws FactoryException(Code)(Java Doc)
public ProjectedCRS createProjectedCRS(String code) throws FactoryException(Code)(Java Doc)
public SphericalCS createSphericalCS(String code) throws FactoryException(Code)(Java Doc)
public TemporalCRS createTemporalCRS(String code) throws FactoryException(Code)(Java Doc)
public TemporalDatum createTemporalDatum(String code) throws FactoryException(Code)(Java Doc)
public TimeCS createTimeCS(String code) throws FactoryException(Code)(Java Doc)
public Unit createUnit(String code) throws FactoryException(Code)(Java Doc)
public VerticalCRS createVerticalCRS(String code) throws FactoryException(Code)(Java Doc)
public VerticalCS createVerticalCS(String code) throws FactoryException(Code)(Java Doc)
public VerticalDatum createVerticalDatum(String code) throws FactoryException(Code)(Java Doc)
public void dispose() throws FactoryException(Code)(Java Doc)
abstract public Citation getAuthority()(Code)(Java Doc)
public String getBackingStoreDescription() throws FactoryException(Code)(Java Doc)
public IdentifiedObjectFinder getIdentifiedObjectFinder(Class type) throws FactoryException(Code)(Java Doc)
final protected NoSuchAuthorityCodeException noSuchAuthorityCode(Class type, String code)(Code)(Java Doc)
protected String trimAuthority(String code)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.