Class EPSGCRSAuthorityFactory
Object
AbstractFactory
EPSGCRSAuthorityFactory
- All Implemented Interfaces:
AuthorityFactory
,CRSAuthorityFactory
,Factory
,Factory
,RegistrableFactory
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.
- Author:
- Jody Garnett, Rueben Schulz
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
protected CRSFactory
protected static EPSGCRSAuthorityFactory
The default coordinate system authority factory.protected Properties
The properties object for our properties file.Fields inherited from class AbstractFactory
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority
-
Constructor Summary
ConstructorsModifierConstructorDescriptionLoads from epsg.properties if the file exists, defaults to internal defintions exported from postgis and cubeworks.protected
EPSGCRSAuthorityFactory
(CRSFactory factory) Loads from epsg.properties if the file exists, defaults to internal defintions exported from postgis and cubeworks.protected
EPSGCRSAuthorityFactory
(CRSFactory factory, URL definition) -
Method Summary
Modifier and TypeMethodDescriptioncreateCompoundCRS
(String str) Creates a 3D coordinate reference system from a code.Returns an arbitrary coordinate reference system from a code.createDerivedCRS
(String str) Creates a derived coordinate reference system from a code.Create a engineering coordinate reference system from a code.Returns a geocentric coordinate reference system from a code.createGeographicCRS
(String code) Returns a geographic coordinate reference system from a code.createImageCRS
(String str) Create a image coordinate reference system from a code.createObject
(String code) Returns an arbitrary object from a code.createProjectedCRS
(String code) Returns a projected coordinate reference system from a code.createTemporalCRS
(String str) Create a temporal coordinate reference system from a code.createVerticalCRS
(String str) Create a vertical coordinate reference system from a code.Returns the organization or party responsible for definition and maintenance of the database.getAuthorityCodes
(Class clazz) Returns the set of authority codes of the given type.static CRSAuthorityFactory
Returns a default coordinate system factory backed by the EPSG property file.getDescriptionText
(String code) Gets a description of the object corresponding to a code.Returns the vendor responsible for creating this factory implementation.protected void
Loads from epsg.properties if the file exists, defaults to internal defintions exported from postgis and cubeworks.Methods inherited from class AbstractFactory
addImplementationHints, equals, getImplementationHints, getPriority, hashCode, onDeregistration, onRegistration, toString
-
Field Details
-
AUTHORITY
- See Also:
-
AUTHORITY_PREFIX
- See Also:
-
DEFAULT
The default coordinate system authority factory. Will be constructed only when first requested. -
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
-
-
Constructor Details
-
EPSGCRSAuthorityFactory
public EPSGCRSAuthorityFactory()Loads from epsg.properties if the file exists, defaults to internal defintions exported from postgis and cubeworks. -
EPSGCRSAuthorityFactory
Loads from epsg.properties if the file exists, defaults to internal defintions exported from postgis and cubeworks. -
EPSGCRSAuthorityFactory
- Throws:
FactoryException
-
-
Method Details
-
loadDefault
Loads from epsg.properties if the file exists, defaults to internal defintions exported from postgis and cubeworks.- Throws:
IOException
-
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 CoordinateReferenceSystem createCoordinateReferenceSystem(String code) throws FactoryException Description copied from interface:CRSAuthorityFactory
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 examplecreateGeographicCRS(code)
instead ofcreateCoordinateReferenceSystem(code)
if the caller know he is asking for a geographic coordinate reference system).- Specified by:
createCoordinateReferenceSystem
in interfaceCRSAuthorityFactory
- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
-
createObject
Description copied from interface:AuthorityFactory
Returns an arbitrary object from a code. The returned object will typically be an instance ofDatum
,CoordinateSystem
,ReferenceSystem
orCoordinateOperation
. If the type of the object is know at compile time, it is recommended to invoke the most precise method instead of this one (for examplecreateCoordinateReferenceSystem(code)
instead ofcreateObject(code)
if the caller know he is asking for a coordinate reference system).- Specified by:
createObject
in interfaceAuthorityFactory
- Parameters:
code
- Value allocated by authority.- Returns:
- The object for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
-
createProjectedCRS
Description copied from interface:CRSAuthorityFactory
Returns a projected coordinate reference system from a code.- Specified by:
createProjectedCRS
in interfaceCRSAuthorityFactory
- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
-
createGeographicCRS
Description copied from interface:CRSAuthorityFactory
Returns a geographic coordinate reference system from a code.- Specified by:
createGeographicCRS
in interfaceCRSAuthorityFactory
- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
-
getAuthority
Description copied from interface:AuthorityFactory
Returns the organization or party responsible for definition and maintenance of the database.- Specified by:
getAuthority
in interfaceAuthorityFactory
- Returns:
- The organization reponsible for definition of the database.
-
getAuthorityCodes
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:- CoordinateReferenceSystem.class asks for all authority codes accepted by createGeographicCRS, createProjectedCRS, createVerticalCRS, createTemporalCRS and their friends.
- ProjectedCRS.class asks only for authority codes accepted by createProjectedCRS.
- Specified by:
getAuthorityCodes
in interfaceAuthorityFactory
- Parameters:
clazz
- The spatial reference objects type (may be Object.class).- 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:
FactoryException
- if access to the underlying database failed.
-
getObjectFactory
-
getVendor
Description copied from interface:Factory
Returns the vendor responsible for creating this factory implementation. Many implementations may be available for the same factory interface. Implementations are usually managed by a service registry. -
getDescriptionText
Description copied from interface:AuthorityFactory
Gets a description of the object corresponding to a code.- Specified by:
getDescriptionText
in interfaceAuthorityFactory
- Parameters:
code
- Value allocated by authority.- Returns:
- A description of the object, or
null
if the object corresponding to the specifiedcode
has no description. - Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the query failed for some other reason.
-
createCompoundCRS
Description copied from interface:CRSAuthorityFactory
Creates a 3D coordinate reference system from a code.- Specified by:
createCompoundCRS
in interfaceCRSAuthorityFactory
- Parameters:
str
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createDerivedCRS
Description copied from interface:CRSAuthorityFactory
Creates a derived coordinate reference system from a code.- Specified by:
createDerivedCRS
in interfaceCRSAuthorityFactory
- Parameters:
str
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createEngineeringCRS
Description copied from interface:CRSAuthorityFactory
Create a engineering coordinate reference system from a code.- Specified by:
createEngineeringCRS
in interfaceCRSAuthorityFactory
- Parameters:
str
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createGeocentricCRS
Description copied from interface:CRSAuthorityFactory
Returns a geocentric coordinate reference system from a code.- Specified by:
createGeocentricCRS
in interfaceCRSAuthorityFactory
- Parameters:
str
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed.- See Also:
-
createImageCRS
Description copied from interface:CRSAuthorityFactory
Create a image coordinate reference system from a code.- Specified by:
createImageCRS
in interfaceCRSAuthorityFactory
- Parameters:
str
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createTemporalCRS
Description copied from interface:CRSAuthorityFactory
Create a temporal coordinate reference system from a code.- Specified by:
createTemporalCRS
in interfaceCRSAuthorityFactory
- Parameters:
str
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
-
createVerticalCRS
Description copied from interface:CRSAuthorityFactory
Create a vertical coordinate reference system from a code.- Specified by:
createVerticalCRS
in interfaceCRSAuthorityFactory
- Parameters:
str
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
-