org.geotools.referencing.crs
Class EPSGCRSAuthorityFactory

java.lang.Object
  extended byorg.geotools.referencing.crs.EPSGCRSAuthorityFactory
All Implemented Interfaces:
org.opengis.referencing.AuthorityFactory, org.opengis.referencing.crs.CRSAuthorityFactory, org.opengis.referencing.Factory

public class EPSGCRSAuthorityFactory
extends java.lang.Object
implements org.opengis.referencing.crs.CRSAuthorityFactory

Default implementation for a coordinate reference system authority factory backed by the EPSG property file. This gives most of the benifits of using the EPSG database backed authority factory, in a nice, portable property file.

Version:
$Id: EPSGCRSAuthorityFactory.java 17661 2006-01-18 07:55:11Z desruisseaux $
Author:
Jody Garnett, Rueben Schulz

Field Summary
static java.lang.String AUTHORITY
           
static java.lang.String AUTHORITY_PREFIX
           
protected  org.opengis.referencing.crs.CRSFactory crsFactory
           
protected static EPSGCRSAuthorityFactory DEFAULT
          The default coordinate system authority factory.
protected  java.util.Properties epsg
          The properties object for our properties file.
 
Constructor Summary
  EPSGCRSAuthorityFactory()
          Loads from epsg.properties if the file exists, defaults to internal defintions exported from postgis and cubeworks.
protected EPSGCRSAuthorityFactory(org.opengis.referencing.crs.CRSFactory factory)
          Loads from epsg.properties if the file exists, defaults to internal defintions exported from postgis and cubeworks.
protected EPSGCRSAuthorityFactory(org.opengis.referencing.crs.CRSFactory factory, java.net.URL definition)
           
 
Method Summary
 org.opengis.referencing.crs.CompoundCRS createCompoundCRS(java.lang.String str)
           
 org.opengis.referencing.crs.CoordinateReferenceSystem createCoordinateReferenceSystem(java.lang.String code)
           
 org.opengis.referencing.crs.DerivedCRS createDerivedCRS(java.lang.String str)
           
 org.opengis.referencing.crs.EngineeringCRS createEngineeringCRS(java.lang.String str)
           
 org.opengis.referencing.crs.GeocentricCRS createGeocentricCRS(java.lang.String str)
           
 org.opengis.referencing.crs.GeographicCRS createGeographicCRS(java.lang.String code)
           
 org.opengis.referencing.crs.ImageCRS createImageCRS(java.lang.String str)
           
 org.opengis.referencing.IdentifiedObject createObject(java.lang.String code)
           
 org.opengis.referencing.crs.ProjectedCRS createProjectedCRS(java.lang.String code)
           
 org.opengis.referencing.crs.TemporalCRS createTemporalCRS(java.lang.String str)
           
 org.opengis.referencing.crs.VerticalCRS createVerticalCRS(java.lang.String str)
           
 org.opengis.metadata.citation.Citation getAuthority()
           
 java.util.Set getAuthorityCodes(java.lang.Class clazz)
          Returns the set of authority codes of the given type.
static org.opengis.referencing.crs.CRSAuthorityFactory getDefault()
          Returns a default coordinate system factory backed by the EPSG property file.
 org.opengis.util.InternationalString getDescriptionText(java.lang.String code)
           
 org.opengis.referencing.ObjectFactory getObjectFactory()
           
 org.opengis.metadata.citation.Citation getVendor()
           
protected  void loadDefault()
          Loads from epsg.properties if the file exists, defaults to internal defintions exported from postgis and cubeworks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTHORITY

public static final java.lang.String AUTHORITY
See Also:
Constant Field Values

AUTHORITY_PREFIX

public static final java.lang.String AUTHORITY_PREFIX
See Also:
Constant Field Values

DEFAULT

protected static EPSGCRSAuthorityFactory DEFAULT
The default coordinate system authority factory. Will be constructed only when first requested.


epsg

protected java.util.Properties epsg
The properties object for our properties file. Keys are the EPSG code for a coordinate reference system and the associated value is a WKT string for the CRS.


crsFactory

protected org.opengis.referencing.crs.CRSFactory crsFactory
Constructor Detail

EPSGCRSAuthorityFactory

public EPSGCRSAuthorityFactory()
Loads from epsg.properties if the file exists, defaults to internal defintions exported from postgis and cubeworks.


EPSGCRSAuthorityFactory

protected EPSGCRSAuthorityFactory(org.opengis.referencing.crs.CRSFactory factory)
Loads from epsg.properties if the file exists, defaults to internal defintions exported from postgis and cubeworks.


EPSGCRSAuthorityFactory

protected EPSGCRSAuthorityFactory(org.opengis.referencing.crs.CRSFactory factory,
                                  java.net.URL definition)
                           throws org.opengis.referencing.FactoryException
Method Detail

loadDefault

protected void loadDefault()
                    throws java.io.IOException
Loads from epsg.properties if the file exists, defaults to internal defintions exported from postgis and cubeworks.

Throws:
java.io.IOException

getDefault

public static org.opengis.referencing.crs.CRSAuthorityFactory getDefault()
Returns a default coordinate system factory backed by the EPSG property file.

Returns:
The default factory.
Throws:
SQLException - if the connection to the database can't be etablished.

createCoordinateReferenceSystem

public org.opengis.referencing.crs.CoordinateReferenceSystem createCoordinateReferenceSystem(java.lang.String code)
                                                                                      throws org.opengis.referencing.FactoryException
Specified by:
createCoordinateReferenceSystem in interface org.opengis.referencing.crs.CRSAuthorityFactory
Throws:
org.opengis.referencing.FactoryException

createObject

public org.opengis.referencing.IdentifiedObject createObject(java.lang.String code)
                                                      throws org.opengis.referencing.FactoryException
Specified by:
createObject in interface org.opengis.referencing.AuthorityFactory
Throws:
org.opengis.referencing.FactoryException

createProjectedCRS

public org.opengis.referencing.crs.ProjectedCRS createProjectedCRS(java.lang.String code)
                                                            throws org.opengis.referencing.FactoryException
Specified by:
createProjectedCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Throws:
org.opengis.referencing.FactoryException

createGeographicCRS

public org.opengis.referencing.crs.GeographicCRS createGeographicCRS(java.lang.String code)
                                                              throws org.opengis.referencing.FactoryException
Specified by:
createGeographicCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Throws:
org.opengis.referencing.FactoryException

getAuthority

public org.opengis.metadata.citation.Citation getAuthority()
Specified by:
getAuthority in interface org.opengis.referencing.AuthorityFactory

getAuthorityCodes

public java.util.Set getAuthorityCodes(java.lang.Class clazz)
                                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 following implementaiton filters the set of codes based on the "PROJCS" and "GEOGCS" at the start of the WKT strings. It is assumed that we only have GeographicCRS and ProjectedCRS's here.

Specified by:
getAuthorityCodes in interface org.opengis.referencing.AuthorityFactory
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.

getObjectFactory

public org.opengis.referencing.ObjectFactory getObjectFactory()

getVendor

public org.opengis.metadata.citation.Citation getVendor()
Specified by:
getVendor in interface org.opengis.referencing.Factory

getDescriptionText

public 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

createCompoundCRS

public org.opengis.referencing.crs.CompoundCRS createCompoundCRS(java.lang.String str)
                                                          throws org.opengis.referencing.FactoryException
Specified by:
createCompoundCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Throws:
org.opengis.referencing.FactoryException

createDerivedCRS

public org.opengis.referencing.crs.DerivedCRS createDerivedCRS(java.lang.String str)
                                                        throws org.opengis.referencing.FactoryException
Specified by:
createDerivedCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Throws:
org.opengis.referencing.FactoryException

createEngineeringCRS

public org.opengis.referencing.crs.EngineeringCRS createEngineeringCRS(java.lang.String str)
                                                                throws org.opengis.referencing.FactoryException
Specified by:
createEngineeringCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Throws:
org.opengis.referencing.FactoryException

createGeocentricCRS

public org.opengis.referencing.crs.GeocentricCRS createGeocentricCRS(java.lang.String str)
                                                              throws org.opengis.referencing.FactoryException
Specified by:
createGeocentricCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Throws:
org.opengis.referencing.FactoryException

createImageCRS

public org.opengis.referencing.crs.ImageCRS createImageCRS(java.lang.String str)
                                                    throws org.opengis.referencing.FactoryException
Specified by:
createImageCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Throws:
org.opengis.referencing.FactoryException

createTemporalCRS

public org.opengis.referencing.crs.TemporalCRS createTemporalCRS(java.lang.String str)
                                                          throws org.opengis.referencing.FactoryException
Specified by:
createTemporalCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Throws:
org.opengis.referencing.FactoryException

createVerticalCRS

public org.opengis.referencing.crs.VerticalCRS createVerticalCRS(java.lang.String str)
                                                          throws org.opengis.referencing.FactoryException
Specified by:
createVerticalCRS in interface org.opengis.referencing.crs.CRSAuthorityFactory
Throws:
org.opengis.referencing.FactoryException


Copyright © GeoTools. All Rights Reserved.