public class CoordinateOperationFinder extends Object
createOperation(sourceCRS, targetCRS)
is invoked,
this class first tries to
find the authority codes for the given source and target CRS. If such codes are found, they are
submitted to a registry of coordinate operations. If an operation is found, it will be returned.
createOperationStep(…)
protected methods defined in this class.
Those methods use properties associated to the CRS, including BOUNDCRS
or TOWGS84
elements found in Well Known Text (WKT).
TOWGS84
is known as the
early-binding approach. The operation found by this approach may be sub-optimal.
The early-binding approach is used only as a fallback when the late-binding approach gave no result.DefaultCoordinateOperationFactory
.
The only public method is createOperation(CoordinateReferenceSystem, CoordinateReferenceSystem)
,
which dispatches its work to the createOperationStep(…)
protected methods.
Developers can override those protected methods if they want to alter the way some operations are created.
DefaultCoordinateOperationFactory.createOperation(CoordinateReferenceSystem, CoordinateReferenceSystem, CoordinateOperationContext)
Defined in the sis-referencing
module
Modifier and Type | Field and Description |
---|---|
protected Extent |
areaOfInterest
The spatio-temporal area of interest, or
null if none. |
protected double |
desiredAccuracy
The desired accuracy in metres, or 0 for the best accuracy available.
|
protected CoordinateOperationFactory |
factory
The factory to use for creating coordinate operations not found in the registry.
|
protected CoordinateOperationAuthorityFactory |
registry
The factory to use for creating operations as defined by authority, or
null if none. |
Constructor and Description |
---|
CoordinateOperationFinder(CoordinateOperationAuthorityFactory registry,
CoordinateOperationFactory factory,
CoordinateOperationContext context)
Creates a new instance for the given factory and context.
|
Modifier and Type | Method and Description |
---|---|
CoordinateOperation |
createOperation(CoordinateReferenceSystem sourceCRS,
CoordinateReferenceSystem targetCRS)
Infers an operation for conversion or transformation between two coordinate reference systems.
|
protected CoordinateOperation |
createOperationStep(CoordinateReferenceSystem sourceCRS,
List<? extends SingleCRS> sourceComponents,
CoordinateReferenceSystem targetCRS,
List<? extends SingleCRS> targetComponents)
Creates an operation between at least one
CompoundCRS (usually the source) and an arbitrary CRS. |
protected CoordinateOperation |
createOperationStep(GeneralDerivedCRS sourceCRS,
GeneralDerivedCRS targetCRS)
Creates an operation between two derived coordinate reference systems.
|
protected CoordinateOperation |
createOperationStep(GeneralDerivedCRS sourceCRS,
SingleCRS targetCRS)
Creates an operation from a derived CRS to an arbitrary single coordinate reference system.
|
protected CoordinateOperation |
createOperationStep(GeodeticCRS sourceCRS,
GeodeticCRS targetCRS)
Creates an operation between two geodetic (geographic or geocentric) coordinate reference systems.
|
protected CoordinateOperation |
createOperationStep(GeodeticCRS sourceCRS,
VerticalCRS targetCRS)
Creates an operation between a geodetic and a vertical coordinate reference systems.
|
protected CoordinateOperation |
createOperationStep(SingleCRS sourceCRS,
GeneralDerivedCRS targetCRS)
Creates an operation from an arbitrary single CRS to a derived coordinate reference system.
|
protected CoordinateOperation |
createOperationStep(TemporalCRS sourceCRS,
TemporalCRS targetCRS)
Creates an operation between two temporal coordinate reference systems.
|
protected CoordinateOperation |
createOperationStep(VerticalCRS sourceCRS,
VerticalCRS targetCRS)
Creates an operation between two vertical coordinate reference systems.
|
protected final CoordinateOperationAuthorityFactory registry
null
if none.
This is the factory used by the late-binding approach.protected final CoordinateOperationFactory factory
protected Extent areaOfInterest
null
if none.
When a new CoordinateOperationFinder
instance is created with a non-null
CoordinateOperationContext
, the context is used for initializing this value.
After initialization, this field may be updated as CoordinateOperationFinder
progresses in its search for a coordinate operation.protected double desiredAccuracy
public CoordinateOperationFinder(CoordinateOperationAuthorityFactory registry, CoordinateOperationFactory factory, CoordinateOperationContext context) throws FactoryException
registry
- the factory to use for creating operations as defined by authority, or null
if none.factory
- the factory to use for creating operations not found in the registry.context
- the area of interest and desired accuracy, or null
if none.FactoryException
- if an error occurred while initializing this CoordinateOperationFinder
.DefaultCoordinateOperationFactory.createOperationFinder(CoordinateOperationAuthorityFactory, CoordinateOperationContext)
public CoordinateOperation createOperation(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS) throws OperationNotFoundException, FactoryException
createOperationStep(…)
methods (early-binding approach).
At first, this method is invoked with the sourceCRS
and targetCRS
arguments given to the
CoordinateOperationFactory.createOperation(…)
method. But then, this method may
be invoked recursively by some createOperationStep(…)
methods with different source or target CRS,
for example in order to process the base geographic CRS of a projected CRS.
sourceCRS
- input coordinate reference system.targetCRS
- output coordinate reference system.sourceCRS
to targetCRS
.OperationNotFoundException
- if no operation path was found from sourceCRS
to targetCRS
.FactoryException
- if the operation creation failed for some other reason.protected CoordinateOperation createOperationStep(SingleCRS sourceCRS, GeneralDerivedCRS targetCRS) throws FactoryException
GeographicCRS
to ProjectedCRS
are also handled by this method,
since projected CRS are a special kind of GeneralDerivedCRS
.
The default implementation constructs the following operation chain:
sourceCRS → baseCRS → targetCRS
where the conversion from baseCRS
to targetCRS
is obtained from
targetCRS.getConversionFromBase()
.sourceCRS
- input coordinate reference system.targetCRS
- output coordinate reference system.sourceCRS
to targetCRS
.FactoryException
- if the operation can not be constructed.protected CoordinateOperation createOperationStep(GeneralDerivedCRS sourceCRS, SingleCRS targetCRS) throws FactoryException
ProjectedCRS
to GeographicCRS
are also handled by this method,
since projected CRS are a special kind of GeneralDerivedCRS
.
The default implementation constructs the following operation chain:
sourceCRS → baseCRS → targetCRS
where the conversion from sourceCRS
to baseCRS
is obtained from the inverse of
sourceCRS.getConversionFromBase()
.sourceCRS
- input coordinate reference system.targetCRS
- output coordinate reference system.sourceCRS
to targetCRS
.FactoryException
- if the operation can not be constructed.protected CoordinateOperation createOperationStep(GeneralDerivedCRS sourceCRS, GeneralDerivedCRS targetCRS) throws FactoryException
sourceCRS
to its base CRS.targetCRS
.sourceCRS
- input coordinate reference system.targetCRS
- output coordinate reference system.sourceCRS
to targetCRS
.FactoryException
- if the operation can not be constructed.protected CoordinateOperation createOperationStep(GeodeticCRS sourceCRS, GeodeticCRS targetCRS) throws FactoryException
sourceCRS
- input coordinate reference system.targetCRS
- output coordinate reference system.sourceCRS
to targetCRS
.FactoryException
- if the operation can not be constructed.protected CoordinateOperation createOperationStep(GeodeticCRS sourceCRS, VerticalCRS targetCRS) throws FactoryException
sourceCRS
- input coordinate reference system.targetCRS
- output coordinate reference system.sourceCRS
to targetCRS
.FactoryException
- if the operation can not be constructed.protected CoordinateOperation createOperationStep(VerticalCRS sourceCRS, VerticalCRS targetCRS) throws FactoryException
sourceCRS
- input coordinate reference system.targetCRS
- output coordinate reference system.sourceCRS
to targetCRS
.FactoryException
- if the operation can not be constructed.protected CoordinateOperation createOperationStep(TemporalCRS sourceCRS, TemporalCRS targetCRS) throws FactoryException
sourceCRS
- input coordinate reference system.targetCRS
- output coordinate reference system.sourceCRS
to targetCRS
.FactoryException
- if the operation can not be constructed.protected CoordinateOperation createOperationStep(CoordinateReferenceSystem sourceCRS, List<? extends SingleCRS> sourceComponents, CoordinateReferenceSystem targetCRS, List<? extends SingleCRS> targetComponents) throws FactoryException
CompoundCRS
(usually the source) and an arbitrary CRS.
The default implementation tries to invoke the createOperation(…)
method with
various combinations of source and target components. A preference is given for components of the same
type (e.g. source GeodeticCRS
with target GeodeticCRS
, etc.).sourceCRS
- input coordinate reference system.sourceComponents
- components of the source CRS.targetCRS
- output coordinate reference system.targetComponents
- components of the target CRS.sourceCRS
to targetCRS
.FactoryException
- if the operation can not be constructed.Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.