Class WebCRSFactory
-
- All Implemented Interfaces:
AuthorityFactory
,CRSAuthorityFactory
,Factory
,Factory
,RegistrableFactory
- Direct Known Subclasses:
OGCAPICRSFactory
public class WebCRSFactory extends DirectAuthorityFactory implements CRSAuthorityFactory
The factory for coordinate reference systems in theCRS
space.- Since:
- 2.2
- Author:
- Martin Desruisseaux
-
-
Field Summary
-
Fields inherited from class DirectAuthorityFactory
factories
-
Fields inherited from class ReferencingFactory
LOGGER
-
Fields inherited from class AbstractFactory
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority
-
-
Constructor Summary
Constructors Constructor Description WebCRSFactory()
Constructs a default factory for theCRS
authority.WebCRSFactory(Hints hints)
Constructs a factory for theCRS
authority using the specified hints.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CoordinateReferenceSystem
createCoordinateReferenceSystem(String code)
Creates a coordinate reference system from the specified code.IdentifiedObject
createObject(String code)
Creates an object from the specified code.Citation
getAuthority()
Returns the authority for this factory, which isCRS
.Set<String>
getAuthorityCodes(Class<? extends IdentifiedObject> type)
Provides a complete set of the known codes provided by this authority.InternationalString
getDescriptionText(String code)
Returns the CRS name for the given code.-
Methods inherited from class DirectAuthorityFactory
getImplementationHints
-
Methods inherited from class 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, getIdentifiedObjectFinder, noSuchAuthorityCode, trimAuthority
-
Methods inherited from class ReferencingFactory
ensureNonNull, getVendor
-
Methods inherited from class AbstractFactory
addImplementationHints, equals, getPriority, hashCode, onDeregistration, onRegistration, toString
-
Methods inherited from interface CRSAuthorityFactory
createCompoundCRS, createDerivedCRS, createEngineeringCRS, createGeocentricCRS, createGeographicCRS, createImageCRS, createProjectedCRS, createTemporalCRS, createVerticalCRS
-
-
-
-
Constructor Detail
-
WebCRSFactory
public WebCRSFactory()
Constructs a default factory for theCRS
authority.
-
WebCRSFactory
public WebCRSFactory(Hints hints)
Constructs a factory for theCRS
authority using the specified hints.
-
-
Method Detail
-
getAuthority
public Citation getAuthority()
Returns the authority for this factory, which isCRS
.- Specified by:
getAuthority
in interfaceAuthorityFactory
- Specified by:
getAuthority
in classAbstractAuthorityFactory
- Returns:
- The organization reponsible for definition of the database.
-
getAuthorityCodes
public Set<String> getAuthorityCodes(Class<? extends IdentifiedObject> type) throws FactoryException
Provides a complete set of the known codes provided by this authority. The returned set contains only numeric identifiers like"84"
,"27"
, etc. The authority name ("CRS"
) is not included. This is consistent with the codes returned by the EPSG factory and avoid duplication, since the authority is the same for every codes returned by this factory. It also make it easier for clients to prepend whatever authority name they wish, as for example in the all authorities factory.- Specified by:
getAuthorityCodes
in interfaceAuthorityFactory
- Parameters:
type
- The spatial reference objects type.- 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 {@linkplain java.util.Collections.emptySet() empty set}.
- Throws:
FactoryException
- if access to the underlying database failed.
-
getDescriptionText
public InternationalString getDescriptionText(String code) throws FactoryException
Returns the CRS name for the given 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.
-
createObject
public IdentifiedObject createObject(String code) throws FactoryException
Creates an object from the specified code. The default implementation delegates tocreateCoordinateReferenceSystem(code)
.- Specified by:
createObject
in interfaceAuthorityFactory
- Overrides:
createObject
in classAbstractAuthorityFactory
- 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:
AbstractAuthorityFactory.createCoordinateReferenceSystem(java.lang.String)
,AbstractAuthorityFactory.createDatum(java.lang.String)
,AbstractAuthorityFactory.createEllipsoid(java.lang.String)
,AbstractAuthorityFactory.createUnit(java.lang.String)
-
createCoordinateReferenceSystem
public CoordinateReferenceSystem createCoordinateReferenceSystem(String code) throws FactoryException
Creates a coordinate reference system from the specified code.- Specified by:
createCoordinateReferenceSystem
in interfaceCRSAuthorityFactory
- Overrides:
createCoordinateReferenceSystem
in classAbstractAuthorityFactory
- 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:
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)
-
-