|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectAbstractFactory
ReferencingFactory
AbstractCoordinateOperationFactory
public abstract class AbstractCoordinateOperationFactory
Base class for coordinate operation factories. This class provides helper methods for the construction of building blocks. It doesn't figure out any operation path by itself. This more "intelligent" job is left to subclasses.
Field Summary | |
---|---|
protected static ReferenceIdentifier |
AXIS_CHANGES
The identifier for conversion using an affine transform for axis swapping and/or unit conversions. |
protected static ReferenceIdentifier |
DATUM_SHIFT
The identifier for a transformation which is a datum shift. |
protected static ReferenceIdentifier |
ELLIPSOID_SHIFT
The identifier for a transformation which is a datum shift without Bursa Wolf parameters. |
protected static ReferenceIdentifier |
GEOCENTRIC_CONVERSION
The identifier for a geocentric conversion. |
protected static ReferenceIdentifier |
IDENTITY
The identifier for an identity operation. |
protected static ReferenceIdentifier |
INVERSE_OPERATION
The identifier for an inverse operation. |
Fields inherited from class ReferencingFactory |
---|
LOGGER |
Fields inherited from class AbstractFactory |
---|
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority |
Constructor Summary | |
---|---|
AbstractCoordinateOperationFactory(Hints userHints)
Constructs a coordinate operation factory using the specified hints. |
|
AbstractCoordinateOperationFactory(Hints userHints,
int priority)
Constructs a coordinate operation factory using the specified hints and priority. |
Method Summary | |
---|---|
protected CoordinateOperation |
concatenate(CoordinateOperation step1,
CoordinateOperation step2)
Concatenate two operation steps. |
protected CoordinateOperation |
concatenate(CoordinateOperation step1,
CoordinateOperation step2,
CoordinateOperation step3)
Concatenate three transformation steps. |
CoordinateOperation |
createConcatenatedOperation(Map<String,?> properties,
CoordinateOperation[] operations)
Creates a concatenated operation from a sequence of operations. |
Conversion |
createDefiningConversion(Map<String,?> properties,
OperationMethod method,
ParameterValueGroup parameters)
Constructs a defining conversion from a set of properties. |
protected CoordinateOperation |
createFromAffineTransform(ReferenceIdentifier name,
CoordinateReferenceSystem sourceCRS,
CoordinateReferenceSystem targetCRS,
Matrix matrix)
Creates a coordinate operation from a matrix, which usually describes an affine tranform. |
protected CoordinateOperation |
createFromMathTransform(Map<String,?> properties,
CoordinateReferenceSystem sourceCRS,
CoordinateReferenceSystem targetCRS,
MathTransform transform,
OperationMethod method,
Class<? extends CoordinateOperation> type)
Creates a coordinate operation from a math transform. |
protected CoordinateOperation |
createFromMathTransform(ReferenceIdentifier name,
CoordinateReferenceSystem sourceCRS,
CoordinateReferenceSystem targetCRS,
MathTransform transform)
Creates a coordinate operation from a math transform. |
protected CoordinateOperation |
createFromParameters(ReferenceIdentifier name,
CoordinateReferenceSystem sourceCRS,
CoordinateReferenceSystem targetCRS,
ParameterValueGroup parameters)
Creates a coordinate operation from a set of parameters. |
protected static void |
ensureNonNull(String name,
Object object)
Makes sure an argument is non-null. |
protected static String |
getErrorMessage(IdentifiedObject source,
IdentifiedObject target)
Returns an error message for "No path found from sourceCRS to targetCRS". |
Map<RenderingHints.Key,?> |
getImplementationHints()
Returns the implementation hints for this factory. |
MathTransformFactory |
getMathTransformFactory()
Returns the underlying math transform factory. |
protected CoordinateOperation |
inverse(CoordinateOperation operation)
Returns the inverse of the specified operation. |
protected Matrix |
swapAndScaleAxis(CoordinateSystem sourceCS,
CoordinateSystem targetCS)
Returns an affine transform between two coordinate systems. |
Methods inherited from class ReferencingFactory |
---|
getVendor |
Methods inherited from class AbstractFactory |
---|
addImplementationHints, equals, getPriority, hashCode, onDeregistration, onRegistration, toString |
Methods inherited from class Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface CoordinateOperationFactory |
---|
createOperation, createOperation |
Methods inherited from interface Factory |
---|
getVendor |
Field Detail |
---|
protected static final ReferenceIdentifier IDENTITY
protected static final ReferenceIdentifier AXIS_CHANGES
protected static final ReferenceIdentifier DATUM_SHIFT
PositionalAccuracyImpl.DATUM_SHIFT_APPLIED
protected static final ReferenceIdentifier ELLIPSOID_SHIFT
Hints.LENIENT_DATUM_SHIFT
set to
Boolean.TRUE
.
PositionalAccuracyImpl.DATUM_SHIFT_OMITTED
protected static final ReferenceIdentifier GEOCENTRIC_CONVERSION
protected static final ReferenceIdentifier INVERSE_OPERATION
Constructor Detail |
---|
public AbstractCoordinateOperationFactory(Hints userHints)
CRS
, CS
,
DATUM
and MATH_TRANSFORM
FACTORY
hints.
userHints
- The hints, or null
if none.public AbstractCoordinateOperationFactory(Hints userHints, int priority)
CRS
, CS
,
DATUM
and MATH_TRANSFORM
FACTORY
hints.
userHints
- The hints, or null
if none.priority
- The priority for this factory, as a number between
MINIMUM_PRIORITY
and
MAXIMUM_PRIORITY
inclusive.Method Detail |
---|
public Map<RenderingHints.Key,?> getImplementationHints()
CRS
, CS
, DATUM
and MATH_TRANSFORM
FACTORY
hints. Other values
may be provided as well, at implementation choice.
getImplementationHints
in interface Factory
getImplementationHints
in class AbstractFactory
public final MathTransformFactory getMathTransformFactory()
MathTransform
objects for
all coordinate operations.
protected Matrix swapAndScaleAxis(CoordinateSystem sourceCS, CoordinateSystem targetCS) throws OperationNotFoundException
Example: If coordinates in sourceCS
are (x,y) pairs in metres and
coordinates in targetCS
are (-y,x) pairs in centimetres, then the
transformation can be performed as below:
[-y(cm)] [ 0 -100 0 ] [x(m)] [ x(cm)] = [ 100 0 0 ] [y(m)] [ 1 ] [ 0 0 1 ] [1 ]
sourceCS
- The source coordinate system.targetCS
- The target coordinate system.
sourceCS
to targetCS
as
an affine transform. Only axis orientation and units are taken in account.
OperationNotFoundException
- If the affine transform can't be constructed.AbstractCS.swapAndScaleAxis(org.opengis.referencing.cs.CoordinateSystem, org.opengis.referencing.cs.CoordinateSystem)
protected CoordinateOperation createFromAffineTransform(ReferenceIdentifier name, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, Matrix matrix) throws FactoryException
OperationMethod
object is given to this transform. In the special case
where the name
identifier is DATUM_SHIFT
or ELLIPSOID_SHIFT
,
the operation will be an instance of Transformation
instead of the usual
Conversion
.
name
- The identifier for the operation to be created.sourceCRS
- The source coordinate reference system.targetCRS
- The target coordinate reference system.matrix
- The matrix which describe an affine transform operation.
FactoryException
- if the operation can't be created.protected CoordinateOperation createFromParameters(ReferenceIdentifier name, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, ParameterValueGroup parameters) throws FactoryException
name
- The identifier for the operation to be created.sourceCRS
- The source coordinate reference system.targetCRS
- The target coordinate reference system.parameters
- The parameters.
FactoryException
- if the operation can't be created.protected CoordinateOperation createFromMathTransform(ReferenceIdentifier name, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, MathTransform transform) throws FactoryException
name
- The identifier for the operation to be created.sourceCRS
- The source coordinate reference system.targetCRS
- The destination coordinate reference system.transform
- The math transform.
FactoryException
- if the operation can't be constructed.protected CoordinateOperation createFromMathTransform(Map<String,?> properties, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, MathTransform transform, OperationMethod method, Class<? extends CoordinateOperation> type) throws FactoryException
transform
is returned with no change.
Otherwise, a new coordinate operation is created.
properties
- The properties to give to the operation.sourceCRS
- The source coordinate reference system.targetCRS
- The destination coordinate reference system.transform
- The math transform.method
- The operation method, or null
.type
- The required super-class (e.g. Transformation.class
).
FactoryException
- if the operation can't be constructed.public Conversion createDefiningConversion(Map<String,?> properties, OperationMethod method, ParameterValueGroup parameters) throws FactoryException
createDefiningConversion
in interface CoordinateOperationFactory
properties
- Set of properties. Should contains at least "name"
.method
- The operation method.parameters
- The parameter values.
FactoryException
- if the object creation failed.DefiningConversion
public CoordinateOperation createConcatenatedOperation(Map<String,?> properties, CoordinateOperation[] operations) throws FactoryException
createConcatenatedOperation
in interface CoordinateOperationFactory
properties
- Set of properties. Should contains at least "name"
.operations
- The sequence of operations.
FactoryException
- if the object creation failed.protected CoordinateOperation concatenate(CoordinateOperation step1, CoordinateOperation step2) throws FactoryException
AXIS_CHANGES
,
it will be included as part of the second operation instead of creating an
ConcatenatedOperation
. If a concatenated operation is created, it
will get an automatically generated name.
step1
- The first step, or null
for the identity operation.step2
- The second step, or null
for the identity operation.
null
if all arguments was nul.
FactoryException
- if the operation can't be constructed.protected CoordinateOperation concatenate(CoordinateOperation step1, CoordinateOperation step2, CoordinateOperation step3) throws FactoryException
AXIS_CHANGES
, it will be included as part of the second operation instead of
creating an ConcatenatedOperation
. If a concatenated operation is created, it
will get an automatically generated name.
step1
- The first step, or null
for the identity operation.step2
- The second step, or null
for the identity operation.step3
- The third step, or null
for the identity operation.
null
if all arguments were null.
FactoryException
- if the operation can't be constructed.protected CoordinateOperation inverse(CoordinateOperation operation) throws NoninvertibleTransformException, FactoryException
operation
- The operation to invert.
operation
.
NoninvertibleTransformException
- if the operation is not invertible.
FactoryException
- if the operation creation failed for an other reason.protected static String getErrorMessage(IdentifiedObject source, IdentifiedObject target)
OperationNotFoundException
.
source
- The source CRS.target
- The target CRS.
protected static void ensureNonNull(String name, Object object) throws IllegalArgumentException
name
- Argument name.object
- User argument.
IllegalArgumentException
- if object
is null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |