- All Superinterfaces:
Factory
- All Known Subinterfaces:
CoordinateOperationAuthorityFactory
,CRSAuthorityFactory
,CSAuthorityFactory
,DatumAuthorityFactory
,RegisterOperations
- All Known Implementing Classes:
PseudoEpsgFactory
@UML(identifier="CS_CoordinateSystemAuthorityFactory",
specification=OGC_01009)
public interface AuthorityFactory
extends Factory
Base interface for all authority factories.
An authority is an organization that maintains definitions of authority codes.
An authority code is a compact string defined by an authority to reference a particular referencing object.
For example, the EPSG geodetic registry is a database of coordinate
reference systems, and other spatial referencing objects, where each object has a code number ID.
For example, the EPSG code for a WGS84 Lat/Lon
CRS is 4326
.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault IdentifiedObject
createObject
(String code) Deprecated, for removal: This API element is subject to removal in a future version.This method is ambiguous because the EPSG geodetic registry may allocate the same code to different kinds of object.Returns the organization or party responsible for definition and maintenance of the database.getAuthorityCodes
(Class<? extends IdentifiedObject> type) Returns the set of authority codes for objects of the given type.default Optional
<InternationalString> getDescriptionText
(Class<? extends IdentifiedObject> type, String code) Returns a description of the object corresponding to a code.default InternationalString
getDescriptionText
(String code) Deprecated, for removal: This API element is subject to removal in a future version.This method is ambiguous because the EPSG geodetic registry may allocate the same code to different kinds of object.
-
Method Details
-
getAuthority
Returns the organization or party responsible for definition and maintenance of the database.- Returns:
- the organization responsible for definition of the database.
-
getAuthorityCodes
Returns the set of authority codes for objects of the given type. Thetype
argument specifies the base type of identified objects.Example
Assuming that this factory is an instance ofCRSAuthorityFactory
, if thetype
argument value is set toCoordinateReferenceSystem.class
, then this method should return all authority codes accepted by methods such ascreateGeographicCRS(…)
,createProjectedCRS(…)
,createVerticalCRS(…)
,createTemporalCRS(…)
and any other method returning a sub-type ofCoordinateReferenceSystem
. By contrast, if thetype
argument value is set toProjectedCRS.class
, then this method should return only the authority codes accepted bycreateProjectedCRS(…)
.- Parameters:
type
- the type of referencing object for which to get authority codes.- Returns:
- the set of authority codes for referencing objects of the given type.
- Throws:
FactoryException
- if access to the underlying database failed.
Extension to OGC/ISO standard
This method is not part of the OGC specification but has been added as a way to publish the capabilities of a factory. -
getDescriptionText
@UML(identifier="descriptionText", obligation=OPTIONAL, specification=OGC_01009) default Optional<InternationalString> getDescriptionText(Class<? extends IdentifiedObject> type, String code) throws FactoryException Returns a description of the object corresponding to a code. The description may be used in graphical user interfaces. It may be empty if the object corresponding to the specified code has no description.- Parameters:
type
- the type of object for which to get a description.code
- value allocated by the authority for an object of the given type.- Returns:
- a description of the object, or empty if the object has no description.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the query failed for some other reason.- Since:
- 3.1
-
getDescriptionText
@Deprecated(since="3.1", forRemoval=true) default InternationalString getDescriptionText(String code) throws FactoryException Deprecated, for removal: This API element is subject to removal in a future version.This method is ambiguous because the EPSG geodetic registry may allocate the same code to different kinds of object.Returns a description of the object corresponding to a code.- 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
@Deprecated(since="3.1", forRemoval=true) default IdentifiedObject createObject(String code) throws FactoryException Deprecated, for removal: This API element is subject to removal in a future version.This method is ambiguous because the EPSG geodetic registry may allocate the same code to different kinds of object. A more specialized method such ascreateDatum(…)
,createCoordinateSystem(…)
orcreateCoordinateReferenceSystem(…)
should be invoked instead.Returns an arbitrary object from a code. The returned object will typically be an instance ofDatum
,CoordinateSystem
,ReferenceSystem
orCoordinateOperation
.If the object type is known at compile time, then it is recommended to invoke the most precise method instead of this one. For example, it is usually better to invoke
createCoordinateReferenceSystem(code)
instead ofcreateObject(code)
if the requested object is known to be aCoordinateReferenceSystem
instance.- 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:
Departure from OGC/ISO standard by generalization
This method is not part of the OGC specification. It has been added to leverage the capability of factories that can automatically determine the type of the requested object at runtime.
-