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 CRSFactorygetCRSFactory()Returns the coordinate reference system factory.CSFactorygetCSFactory()Returns the coordinate system factory.DatumFactorygetDatumFactory()Returns the datum factory.Map<RenderingHints.Key,?>getImplementationHints()Returns all factories in this group.MathTransformFactorygetMathTransformFactory()Returns the math transform factory.static ReferencingFactoryContainerinstance(Hints hints)Creates an instance from the specified hints.CoordinateReferenceSystemseparate(CoordinateReferenceSystem crs, int[] dimensions)Returns a new coordinate reference system with only the specified dimension.CoordinateReferenceSystemtoGeodetic3D(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,DATUMandMATH_TRANSFORMFACTORYhints.This constructor is public mainly for
FactoryCreatorusage. Consider invokingcreateInstance(userHints)instead.- Parameters:
userHints- The hints, ornullif none.
-
-
Method Detail
-
instance
public static ReferencingFactoryContainer instance(Hints hints)
Creates an instance from the specified hints. This method recognizes theCRS,CS,DATUMandMATH_TRANSFORMFACTORYhints.- Parameters:
hints- The hints, ornullif 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,DATUMandMATH_TRANSFORMFACTORYhints.- Specified by:
getImplementationHintsin interfaceFactory- Overrides:
getImplementationHintsin 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, thecrsargument 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
crsif 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.
-
-