Package org.geotools.referencing.factory
Class ReferencingFactoryContainer
Object
AbstractFactory
ReferencingFactory
ReferencingFactoryContainer
- All Implemented Interfaces:
Factory
,Factory
,RegistrableFactory
A set of utilities methods working on factories. Many of those methods requires more than one factory. Consequently,
they can't be a method in a single factory. Furthermore, since they are helper methods and somewhat
implementation-dependent, they are not part of GeoAPI.
- Since:
- 2.4
- Author:
- Martin Desruisseaux (IRD)
-
Field Summary
Fields inherited from class ReferencingFactory
LOGGER
Fields inherited from class AbstractFactory
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority
-
Constructor Summary
ConstructorsConstructorDescriptionReferencingFactoryContainer
(Hints userHints) Creates an instance from the specified hints. -
Method Summary
Modifier and TypeMethodDescriptionReturns the coordinate reference system factory.Returns the coordinate system factory.Returns the datum factory.Returns all factories in this group.Returns the math transform factory.static ReferencingFactoryContainer
Creates an instance from the specified hints.separate
(CoordinateReferenceSystem crs, int[] dimensions) Returns a new coordinate reference system with only the specified dimension.toGeodetic3D
(CompoundCRS crs) Converts a 2D + 1D compound CRS into a 3D CRS, if possible.Methods inherited from class ReferencingFactory
ensureNonNull, getVendor
Methods inherited from class AbstractFactory
addImplementationHints, equals, getPriority, hashCode, onDeregistration, onRegistration, toString
-
Constructor Details
-
ReferencingFactoryContainer
Creates an instance from the specified hints. This constructor recognizes theCRS
,CS
,DATUM
andMATH_TRANSFORM
FACTORY
hints.This constructor is public mainly for
FactoryCreator
usage. Consider invokingcreateInstance(userHints)
instead.- Parameters:
userHints
- The hints, ornull
if none.
-
-
Method Details
-
instance
Creates an instance from the specified hints. This method recognizes theCRS
,CS
,DATUM
andMATH_TRANSFORM
FACTORY
hints.- Parameters:
hints
- The hints, ornull
if none.- Returns:
- A factory group created from the specified set of hints.
-
getImplementationHints
Returns all factories in this group. The returned map contains values for theCRS
,CS
,DATUM
andMATH_TRANSFORM
FACTORY
hints.- Specified by:
getImplementationHints
in interfaceFactory
- Overrides:
getImplementationHints
in classAbstractFactory
- Returns:
- The map of hints, or an empty map if none.
-
getDatumFactory
Returns the datum factory.- Returns:
- The Datum factory.
-
getCSFactory
Returns the coordinate system factory.- Returns:
- The Coordinate System factory.
-
getCRSFactory
Returns the coordinate reference system factory.- Returns:
- The Coordinate Reference System factory.
-
getMathTransformFactory
Returns the math transform factory.- Returns:
- The Math Transform factory.
-
toGeodetic3D
Converts a 2D + 1D compound CRS into a 3D CRS, if possible. More specifically, if the specified compound CRS is made of a geographic (or projected) and a vertical CRS, and if the vertical CRS datum type is height above the ellipsoid, then this method converts the compound CRS in a single 3D CRS. Otherwise, thecrs
argument is returned unchanged.- Parameters:
crs
- The compound CRS to converts in a 3D geographic or projected CRS.- Returns:
- The 3D geographic or projected CRS, or
crs
if the change can't be applied. - Throws:
FactoryException
- if the object creation failed.
-
separate
public CoordinateReferenceSystem separate(CoordinateReferenceSystem crs, int[] dimensions) throws FactoryException Returns a new coordinate reference system with only the specified dimension. This method is used for example in order to get a component of a compound CRS.- Parameters:
crs
- The original (usually compound) CRS.dimensions
- The dimensions to keep.- Returns:
- The CRS with only the specified dimensions.
- Throws:
FactoryException
- if the given dimensions can not be isolated in the given CRS.
-