public abstract class AbstractAuthorityFactory extends ReferencingFactory implements AuthorityFactory
"4326"
.
This class defines a default implementation for most methods defined in the DatumAuthorityFactory
, CSAuthorityFactory
and CRSAuthorityFactory
interfaces.
However, those interfaces do not appear in the implements
clause of this class
declaration. This is up to subclasses to decide which interfaces they declare to implement.
The default implementation for all createFoo
methods ultimately invokes createObject(java.lang.String)
, which may be the only method that a subclass need to override. However, other
methods may be overridden as well for better performances.
LOGGER
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority
Modifier | Constructor and Description |
---|---|
protected |
AbstractAuthorityFactory(int priority)
Constructs an instance using the specified priority level.
|
Modifier and Type | Method and Description |
---|---|
CartesianCS |
createCartesianCS(String code)
Creates a cartesian coordinate system from a code.
|
CompoundCRS |
createCompoundCRS(String code)
Creates a 3D coordinate reference system from a code.
|
CoordinateOperation |
createCoordinateOperation(String code)
Creates an operation from a single operation code.
|
CoordinateReferenceSystem |
createCoordinateReferenceSystem(String code)
Returns an arbitrary coordinate reference system from
a code.
|
CoordinateSystem |
createCoordinateSystem(String code)
Returns an arbitrary coordinate system from a code.
|
CoordinateSystemAxis |
createCoordinateSystemAxis(String code)
Returns a coordinate system axis from a code.
|
CylindricalCS |
createCylindricalCS(String code)
Creates a cylindrical coordinate system from a code.
|
Datum |
createDatum(String code)
Returns an arbitrary datum from a code.
|
DerivedCRS |
createDerivedCRS(String code)
Creates a derived coordinate reference system from a code.
|
Ellipsoid |
createEllipsoid(String code)
Returns an ellipsoid from a code.
|
EllipsoidalCS |
createEllipsoidalCS(String code)
Creates an ellipsoidal coordinate system from a code.
|
EngineeringCRS |
createEngineeringCRS(String code)
Creates a engineering coordinate reference system from a code.
|
EngineeringDatum |
createEngineeringDatum(String code)
Creates a engineering datum from a code.
|
Extent |
createExtent(String code)
Returns a extent (usually an area of validity) from a code.
|
Set<CoordinateOperation> |
createFromCoordinateReferenceSystemCodes(String sourceCRS,
String targetCRS)
Creates an operation from coordinate reference system codes.
|
GeocentricCRS |
createGeocentricCRS(String code)
Returns a geocentric coordinate reference system from a code.
|
GeodeticDatum |
createGeodeticDatum(String code)
Returns a geodetic datum from a code.
|
GeographicCRS |
createGeographicCRS(String code)
Returns a geographic coordinate reference system from a code.
|
ImageCRS |
createImageCRS(String code)
Creates a image coordinate reference system from a code.
|
ImageDatum |
createImageDatum(String code)
Creates a image datum from a code.
|
IdentifiedObject |
createObject(String code)
Returns an arbitrary object from a code.
|
OperationMethod |
createOperationMethod(String code)
Creates an operation method from a code.
|
ParameterDescriptor |
createParameterDescriptor(String code)
Creates a parameter descriptor from a code.
|
PolarCS |
createPolarCS(String code)
Creates a polar coordinate system from a code.
|
PrimeMeridian |
createPrimeMeridian(String code)
Returns a prime meridian from a code.
|
ProjectedCRS |
createProjectedCRS(String code)
Returns a projected coordinate reference system from a code.
|
SphericalCS |
createSphericalCS(String code)
Creates a spherical coordinate system from a code.
|
TemporalCRS |
createTemporalCRS(String code)
Creates a temporal coordinate reference system from a code.
|
TemporalDatum |
createTemporalDatum(String code)
Creates a temporal datum from a code.
|
TimeCS |
createTimeCS(String code)
Creates a temporal coordinate system from a code.
|
Unit<?> |
createUnit(String code)
Returns an unit from a code.
|
VerticalCRS |
createVerticalCRS(String code)
Creates a vertical coordinate reference system from a code.
|
VerticalCS |
createVerticalCS(String code)
Creates a vertical coordinate system from a code.
|
VerticalDatum |
createVerticalDatum(String code)
Creates a vertical datum from a code.
|
void |
dispose()
Releases resources immediately instead of waiting for the garbage collector.
|
abstract Citation |
getAuthority()
Returns the organization or party responsible for definition and maintenance of the database.
|
String |
getBackingStoreDescription()
Returns a description of the underlying backing store, or
null if unknown. |
IdentifiedObjectFinder |
getIdentifiedObjectFinder(Class<? extends IdentifiedObject> type)
Returns a finder which can be used for looking up unidentified objects.
|
protected NoSuchAuthorityCodeException |
noSuchAuthorityCode(Class type,
String code)
Creates an exception for an unknow authority code.
|
protected String |
trimAuthority(String code)
Trims the authority scope, if present.
|
ensureNonNull, getVendor
addImplementationHints, equals, getImplementationHints, getPriority, hashCode, onDeregistration, onRegistration, toString
getAuthorityCodes, getDescriptionText
protected AbstractAuthorityFactory(int priority)
priority
- The priority for this factory, as a number between MINIMUM_PRIORITY
and MAXIMUM_PRIORITY
inclusive.public abstract Citation getAuthority()
getAuthority
in interface AuthorityFactory
public String getBackingStoreDescription() throws FactoryException
null
if unknown. This is
for example the database software used for storing the data. The default implementation
returns always null
.null
.FactoryException
- if a failure occurs while fetching the engine description.public IdentifiedObject createObject(String code) throws NoSuchAuthorityCodeException, FactoryException
Datum
, CoordinateSystem
, CoordinateReferenceSystem
or CoordinateOperation
. The default implementation always throw an exception. Subclasses should
override this method if they are capable to automatically detect the object type from its
code.createObject
in interface AuthorityFactory
code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.createCoordinateReferenceSystem(java.lang.String)
,
createDatum(java.lang.String)
,
createEllipsoid(java.lang.String)
,
createUnit(java.lang.String)
public Datum createDatum(String code) throws NoSuchAuthorityCodeException, FactoryException
createObject(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.createGeodeticDatum(java.lang.String)
,
createVerticalDatum(java.lang.String)
,
createTemporalDatum(java.lang.String)
public EngineeringDatum createEngineeringDatum(String code) throws NoSuchAuthorityCodeException, FactoryException
createDatum(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.createEngineeringCRS(java.lang.String)
public ImageDatum createImageDatum(String code) throws NoSuchAuthorityCodeException, FactoryException
createDatum(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.createImageCRS(java.lang.String)
public VerticalDatum createVerticalDatum(String code) throws NoSuchAuthorityCodeException, FactoryException
createDatum(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.createVerticalCRS(java.lang.String)
public TemporalDatum createTemporalDatum(String code) throws NoSuchAuthorityCodeException, FactoryException
createDatum(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.createTemporalCRS(java.lang.String)
public GeodeticDatum createGeodeticDatum(String code) throws NoSuchAuthorityCodeException, FactoryException
createDatum(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.createEllipsoid(java.lang.String)
,
createPrimeMeridian(java.lang.String)
,
createGeographicCRS(java.lang.String)
,
createProjectedCRS(java.lang.String)
public Ellipsoid createEllipsoid(String code) throws NoSuchAuthorityCodeException, FactoryException
createObject(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.createGeodeticDatum(java.lang.String)
public PrimeMeridian createPrimeMeridian(String code) throws NoSuchAuthorityCodeException, FactoryException
createObject(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.createGeodeticDatum(java.lang.String)
public Extent createExtent(String code) throws NoSuchAuthorityCodeException, FactoryException
createObject(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public CoordinateSystem createCoordinateSystem(String code) throws NoSuchAuthorityCodeException, FactoryException
createObject(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public CartesianCS createCartesianCS(String code) throws NoSuchAuthorityCodeException, FactoryException
createCoordinateSystem(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public PolarCS createPolarCS(String code) throws NoSuchAuthorityCodeException, FactoryException
createCoordinateSystem(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public CylindricalCS createCylindricalCS(String code) throws NoSuchAuthorityCodeException, FactoryException
createCoordinateSystem(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public SphericalCS createSphericalCS(String code) throws NoSuchAuthorityCodeException, FactoryException
createCoordinateSystem(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public EllipsoidalCS createEllipsoidalCS(String code) throws NoSuchAuthorityCodeException, FactoryException
createCoordinateSystem(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public VerticalCS createVerticalCS(String code) throws NoSuchAuthorityCodeException, FactoryException
createCoordinateSystem(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public TimeCS createTimeCS(String code) throws NoSuchAuthorityCodeException, FactoryException
createCoordinateSystem(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public CoordinateSystemAxis createCoordinateSystemAxis(String code) throws NoSuchAuthorityCodeException, FactoryException
createObject(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public Unit<?> createUnit(String code) throws NoSuchAuthorityCodeException, FactoryException
createObject(code)
.code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public CoordinateReferenceSystem createCoordinateReferenceSystem(String code) throws NoSuchAuthorityCodeException, FactoryException
createGeographicCRS(code)
instead of
createCoordinateReferenceSystem(code)
if the caller know he is
asking for a geographic coordinate reference system).code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.createGeographicCRS(java.lang.String)
,
createProjectedCRS(java.lang.String)
,
createVerticalCRS(java.lang.String)
,
createTemporalCRS(java.lang.String)
,
createCompoundCRS(java.lang.String)
public CompoundCRS createCompoundCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public DerivedCRS createDerivedCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public EngineeringCRS createEngineeringCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public GeographicCRS createGeographicCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.createGeodeticDatum(java.lang.String)
public GeocentricCRS createGeocentricCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed.createGeodeticDatum(java.lang.String)
public ImageCRS createImageCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public ProjectedCRS createProjectedCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.createGeodeticDatum(java.lang.String)
public TemporalCRS createTemporalCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.createTemporalDatum(java.lang.String)
public VerticalCRS createVerticalCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.createVerticalDatum(java.lang.String)
public ParameterDescriptor createParameterDescriptor(String code) throws NoSuchAuthorityCodeException, FactoryException
code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public OperationMethod createOperationMethod(String code) throws NoSuchAuthorityCodeException, FactoryException
code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public CoordinateOperation createCoordinateOperation(String code) throws NoSuchAuthorityCodeException, FactoryException
code
- Value allocated by authority.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the object creation failed for some other reason.public Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS, String targetCRS) throws NoSuchAuthorityCodeException, FactoryException
Rational: Coordinate operation factory backed by an authority will invoke this method. If this method invoked the coordinate operation factory in turn, the application could be trapped in infinite recursive calls.
sourceCRS
- Coded value of source coordinate reference system.targetCRS
- Coded value of target coordinate reference system.sourceCRS
to targetCRS
.NoSuchAuthorityCodeException
- if a specified code was not found.FactoryException
- if the object creation failed for some other reason.public IdentifiedObjectFinder getIdentifiedObjectFinder(Class<? extends IdentifiedObject> type) throws FactoryException
AUTHORITY[...]
" element in Well Known
Text terminology.type
- The type of objects to look for. Should be a GeoAPI interface like GeographicCRS.class
, but this method accepts also implementation class. If the type is
unknown, use IdentifiedObject.class
. A more accurate type may help to speed up
the search, since it reduces the amount of tables to scan in some implementations like
the factories backed by EPSG database.FactoryException
- if the finder can not be created.public void dispose() throws FactoryException
create(...)
invocations may throw a FactoryException
. Disposing a previously-disposed factory, however, has no effect.FactoryException
- if an error occured while disposing the factory.protected String trimAuthority(String code)
code
- The code to trim.protected final NoSuchAuthorityCodeException noSuchAuthorityCode(Class type, String code)
createXXX
methods.type
- The GeoAPI interface that was to be created (e.g. CoordinateReferenceSystem.class
).code
- The unknow authority code.Copyright © 1996–2019 Geotools. All rights reserved.