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 theCRSspace.- 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 theCRSauthority.WebCRSFactory(Hints hints)Constructs a factory for theCRSauthority using the specified hints.WebCRSFactory(Hints hints, int priority)Constructs a factory for theCRSauthority using the specified hints.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CoordinateReferenceSystemcreateCoordinateReferenceSystem(String code)Creates a coordinate reference system from the specified code.IdentifiedObjectcreateObject(String code)Creates an object from the specified code.CitationgetAuthority()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.InternationalStringgetDescriptionText(String code)Returns the CRS name for the given code.protected intgetIntegerCode(String code)Extracts the integer code from the given authority 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 theCRSauthority.
-
WebCRSFactory
public WebCRSFactory(Hints hints)
Constructs a factory for theCRSauthority using the specified hints.
-
WebCRSFactory
public WebCRSFactory(Hints hints, int priority)
Constructs a factory for theCRSauthority using the specified hints.
-
-
Method Detail
-
getAuthority
public Citation getAuthority()
Returns the authority for this factory, which isCRS.- Specified by:
getAuthorityin interfaceAuthorityFactory- Specified by:
getAuthorityin 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:
getAuthorityCodesin 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 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:
getDescriptionTextin interfaceAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- A description of the object, or
nullif the object corresponding to the specifiedcodehas no description. - Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas 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:
createObjectin interfaceAuthorityFactory- Overrides:
createObjectin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The object for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas 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:
createCoordinateReferenceSystemin interfaceCRSAuthorityFactory- Overrides:
createCoordinateReferenceSystemin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas 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)
-
getIntegerCode
protected int getIntegerCode(String code) throws NoSuchAuthorityCodeException
Extracts the integer code from the given authority code. The code is expected to be in the form"CRS84"or"84", where the"CRS"prefix is optional. The code is trimmed of leading and trailing spaces, and the case is ignored. If the code can't be parsed as an integer, then aNoSuchAuthorityCodeExceptionis thrown.- Throws:
NoSuchAuthorityCodeException
-
-