Package org.geotools.referencing.factory
Class ReferencingFactoryContainer
- Object
-
- AbstractFactory
-
- ReferencingFactory
-
- ReferencingFactoryContainer
-
- All Implemented Interfaces:
Factory
,Factory
,RegistrableFactory
public class ReferencingFactoryContainer extends ReferencingFactory
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
Constructors Constructor Description ReferencingFactoryContainer(Hints userHints)
Creates an instance from the specified hints.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CRSFactory
getCRSFactory()
Returns the coordinate reference system factory.CSFactory
getCSFactory()
Returns the coordinate system factory.DatumFactory
getDatumFactory()
Returns the datum factory.Map<RenderingHints.Key,?>
getImplementationHints()
Returns all factories in this group.MathTransformFactory
getMathTransformFactory()
Returns the math transform factory.static ReferencingFactoryContainer
instance(Hints hints)
Creates an instance from the specified hints.CoordinateReferenceSystem
separate(CoordinateReferenceSystem crs, int[] dimensions)
Returns a new coordinate reference system with only the specified dimension.CoordinateReferenceSystem
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 Detail
-
ReferencingFactoryContainer
public ReferencingFactoryContainer(Hints userHints)
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 Detail
-
instance
public static ReferencingFactoryContainer instance(Hints hints)
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
public Map<RenderingHints.Key,?> 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
public DatumFactory getDatumFactory()
Returns the datum factory.- Returns:
- The Datum factory.
-
getCSFactory
public CSFactory getCSFactory()
Returns the coordinate system factory.- Returns:
- The Coordinate System factory.
-
getCRSFactory
public CRSFactory getCRSFactory()
Returns the coordinate reference system factory.- Returns:
- The Coordinate Reference System factory.
-
getMathTransformFactory
public MathTransformFactory getMathTransformFactory()
Returns the math transform factory.- Returns:
- The Math Transform factory.
-
toGeodetic3D
public CoordinateReferenceSystem toGeodetic3D(CompoundCRS crs) throws FactoryException
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.
-
-