Class WebCRSFactory
- All Implemented Interfaces:
AuthorityFactory,CRSAuthorityFactory,Factory,Factory,RegistrableFactory
- Direct Known Subclasses:
OGCAPICRSFactory
The factory for coordinate reference systems in the
CRS space.- Since:
- 2.2
- Author:
- Martin Desruisseaux
-
Field Summary
Fields inherited from class DirectAuthorityFactory
factoriesFields inherited from class ReferencingFactory
LOGGERFields inherited from class AbstractFactory
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority -
Constructor Summary
ConstructorsConstructorDescriptionConstructs 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
Modifier and TypeMethodDescriptionCreates a coordinate reference system from the specified code.createObject(String code) Creates an object from the specified code.Returns the authority for this factory, which isCRS.getAuthorityCodes(Class<? extends IdentifiedObject> type) Provides a complete set of the known codes provided by this authority.getDescriptionText(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
getImplementationHintsMethods 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, trimAuthorityMethods inherited from class ReferencingFactory
ensureNonNull, getVendorMethods inherited from class AbstractFactory
addImplementationHints, equals, getPriority, hashCode, onDeregistration, onRegistration, toStringMethods inherited from interface CRSAuthorityFactory
createCompoundCRS, createDerivedCRS, createEngineeringCRS, createGeocentricCRS, createGeographicCRS, createImageCRS, createProjectedCRS, createTemporalCRS, createVerticalCRS
-
Constructor Details
-
WebCRSFactory
public WebCRSFactory()Constructs a default factory for theCRSauthority. -
WebCRSFactory
Constructs a factory for theCRSauthority using the specified hints. -
WebCRSFactory
Constructs a factory for theCRSauthority using the specified hints.
-
-
Method Details
-
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
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
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:
-
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
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
-