|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.factory.AbstractFactory
org.geotools.referencing.factory.ReferencingFactory
org.geotools.referencing.operation.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 org.opengis.referencing.ReferenceIdentifier |
AXIS_CHANGES
The identifier for conversion using an affine transform for axis swapping and/or unit conversions. |
protected static org.opengis.referencing.ReferenceIdentifier |
DATUM_SHIFT
The identifier for a transformation which is a datum shift. |
protected static org.opengis.referencing.ReferenceIdentifier |
ELLIPSOID_SHIFT
The identifier for a transformation which is a datum shift without Bursa Wolf parameters. |
protected static org.opengis.referencing.ReferenceIdentifier |
GEOCENTRIC_CONVERSION
The identifier for a geocentric conversion. |
protected static org.opengis.referencing.ReferenceIdentifier |
IDENTITY
The identifier for an identity operation. |
protected static org.opengis.referencing.ReferenceIdentifier |
INVERSE_OPERATION
The identifier for an inverse operation. |
Fields inherited from class org.geotools.referencing.factory.ReferencingFactory |
---|
LOGGER |
Fields inherited from class org.geotools.factory.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 org.opengis.referencing.operation.CoordinateOperation |
concatenate(org.opengis.referencing.operation.CoordinateOperation step1,
org.opengis.referencing.operation.CoordinateOperation step2)
Concatenate two operation steps. |
protected org.opengis.referencing.operation.CoordinateOperation |
concatenate(org.opengis.referencing.operation.CoordinateOperation step1,
org.opengis.referencing.operation.CoordinateOperation step2,
org.opengis.referencing.operation.CoordinateOperation step3)
Concatenate three transformation steps. |
org.opengis.referencing.operation.CoordinateOperation |
createConcatenatedOperation(java.util.Map<java.lang.String,?> properties,
org.opengis.referencing.operation.CoordinateOperation[] operations)
Creates a concatenated operation from a sequence of operations. |
org.opengis.referencing.operation.Conversion |
createDefiningConversion(java.util.Map<java.lang.String,?> properties,
org.opengis.referencing.operation.OperationMethod method,
org.opengis.parameter.ParameterValueGroup parameters)
Constructs a defining conversion from a set of properties. |
protected org.opengis.referencing.operation.CoordinateOperation |
createFromAffineTransform(org.opengis.referencing.ReferenceIdentifier name,
org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS,
org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS,
org.opengis.referencing.operation.Matrix matrix)
Creates a coordinate operation from a matrix, which usually describes an affine tranform. |
protected org.opengis.referencing.operation.CoordinateOperation |
createFromMathTransform(java.util.Map<java.lang.String,?> properties,
org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS,
org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS,
org.opengis.referencing.operation.MathTransform transform,
org.opengis.referencing.operation.OperationMethod method,
java.lang.Class<? extends org.opengis.referencing.operation.CoordinateOperation> type)
Creates a coordinate operation from a math transform. |
protected org.opengis.referencing.operation.CoordinateOperation |
createFromMathTransform(org.opengis.referencing.ReferenceIdentifier name,
org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS,
org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS,
org.opengis.referencing.operation.MathTransform transform)
Creates a coordinate operation from a math transform. |
protected org.opengis.referencing.operation.CoordinateOperation |
createFromParameters(org.opengis.referencing.ReferenceIdentifier name,
org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS,
org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS,
org.opengis.parameter.ParameterValueGroup parameters)
Creates a coordinate operation from a set of parameters. |
protected static void |
ensureNonNull(java.lang.String name,
java.lang.Object object)
Makes sure an argument is non-null. |
protected static java.lang.String |
getErrorMessage(org.opengis.referencing.IdentifiedObject source,
org.opengis.referencing.IdentifiedObject target)
Returns an error message for "No path found from sourceCRS to targetCRS". |
java.util.Map<java.awt.RenderingHints.Key,?> |
getImplementationHints()
Returns the implementation hints for this factory. |
org.opengis.referencing.operation.MathTransformFactory |
getMathTransformFactory()
Returns the underlying math transform factory. |
protected org.opengis.referencing.operation.CoordinateOperation |
inverse(org.opengis.referencing.operation.CoordinateOperation operation)
Returns the inverse of the specified operation. |
protected org.opengis.referencing.operation.Matrix |
swapAndScaleAxis(org.opengis.referencing.cs.CoordinateSystem sourceCS,
org.opengis.referencing.cs.CoordinateSystem targetCS)
Returns an affine transform between two coordinate systems. |
Methods inherited from class org.geotools.referencing.factory.ReferencingFactory |
---|
getVendor |
Methods inherited from class org.geotools.factory.AbstractFactory |
---|
addImplementationHints, equals, getPriority, hashCode, onDeregistration, onRegistration, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.opengis.referencing.operation.CoordinateOperationFactory |
---|
createOperation, createOperation |
Methods inherited from interface org.opengis.referencing.Factory |
---|
getVendor |
Field Detail |
---|
protected static final org.opengis.referencing.ReferenceIdentifier IDENTITY
protected static final org.opengis.referencing.ReferenceIdentifier AXIS_CHANGES
protected static final org.opengis.referencing.ReferenceIdentifier DATUM_SHIFT
PositionalAccuracyImpl.DATUM_SHIFT_APPLIED
protected static final org.opengis.referencing.ReferenceIdentifier ELLIPSOID_SHIFT
Hints.LENIENT_DATUM_SHIFT
set to
Boolean.TRUE
.
PositionalAccuracyImpl.DATUM_SHIFT_OMITTED
protected static final org.opengis.referencing.ReferenceIdentifier GEOCENTRIC_CONVERSION
protected static final org.opengis.referencing.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 java.util.Map<java.awt.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 org.opengis.referencing.operation.MathTransformFactory getMathTransformFactory()
MathTransform
objects for
all coordinate operations.
protected org.opengis.referencing.operation.Matrix swapAndScaleAxis(org.opengis.referencing.cs.CoordinateSystem sourceCS, org.opengis.referencing.cs.CoordinateSystem targetCS) throws org.opengis.referencing.operation.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.
org.opengis.referencing.operation.OperationNotFoundException
- If the affine transform can't be constructed.AbstractCS.swapAndScaleAxis(org.opengis.referencing.cs.CoordinateSystem, org.opengis.referencing.cs.CoordinateSystem)
protected org.opengis.referencing.operation.CoordinateOperation createFromAffineTransform(org.opengis.referencing.ReferenceIdentifier name, org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, org.opengis.referencing.operation.Matrix matrix) throws org.opengis.referencing.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.
org.opengis.referencing.FactoryException
- if the operation can't be created.protected org.opengis.referencing.operation.CoordinateOperation createFromParameters(org.opengis.referencing.ReferenceIdentifier name, org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, org.opengis.parameter.ParameterValueGroup parameters) throws org.opengis.referencing.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.
org.opengis.referencing.FactoryException
- if the operation can't be created.protected org.opengis.referencing.operation.CoordinateOperation createFromMathTransform(org.opengis.referencing.ReferenceIdentifier name, org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, org.opengis.referencing.operation.MathTransform transform) throws org.opengis.referencing.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.
org.opengis.referencing.FactoryException
- if the operation can't be constructed.protected org.opengis.referencing.operation.CoordinateOperation createFromMathTransform(java.util.Map<java.lang.String,?> properties, org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, org.opengis.referencing.operation.MathTransform transform, org.opengis.referencing.operation.OperationMethod method, java.lang.Class<? extends org.opengis.referencing.operation.CoordinateOperation> type) throws org.opengis.referencing.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
).
org.opengis.referencing.FactoryException
- if the operation can't be constructed.public org.opengis.referencing.operation.Conversion createDefiningConversion(java.util.Map<java.lang.String,?> properties, org.opengis.referencing.operation.OperationMethod method, org.opengis.parameter.ParameterValueGroup parameters) throws org.opengis.referencing.FactoryException
createDefiningConversion
in interface org.opengis.referencing.operation.CoordinateOperationFactory
properties
- Set of properties. Should contains at least "name"
.method
- The operation method.parameters
- The parameter values.
org.opengis.referencing.FactoryException
- if the object creation failed.DefiningConversion
public org.opengis.referencing.operation.CoordinateOperation createConcatenatedOperation(java.util.Map<java.lang.String,?> properties, org.opengis.referencing.operation.CoordinateOperation[] operations) throws org.opengis.referencing.FactoryException
createConcatenatedOperation
in interface org.opengis.referencing.operation.CoordinateOperationFactory
properties
- Set of properties. Should contains at least "name"
.operations
- The sequence of operations.
org.opengis.referencing.FactoryException
- if the object creation failed.protected org.opengis.referencing.operation.CoordinateOperation concatenate(org.opengis.referencing.operation.CoordinateOperation step1, org.opengis.referencing.operation.CoordinateOperation step2) throws org.opengis.referencing.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.
org.opengis.referencing.FactoryException
- if the operation can't be constructed.protected org.opengis.referencing.operation.CoordinateOperation concatenate(org.opengis.referencing.operation.CoordinateOperation step1, org.opengis.referencing.operation.CoordinateOperation step2, org.opengis.referencing.operation.CoordinateOperation step3) throws org.opengis.referencing.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.
org.opengis.referencing.FactoryException
- if the operation can't be constructed.protected org.opengis.referencing.operation.CoordinateOperation inverse(org.opengis.referencing.operation.CoordinateOperation operation) throws org.opengis.referencing.operation.NoninvertibleTransformException, org.opengis.referencing.FactoryException
operation
- The operation to invert.
operation
.
org.opengis.referencing.operation.NoninvertibleTransformException
- if the operation is not invertible.
org.opengis.referencing.FactoryException
- if the operation creation failed for an other reason.protected static java.lang.String getErrorMessage(org.opengis.referencing.IdentifiedObject source, org.opengis.referencing.IdentifiedObject target)
OperationNotFoundException
.
source
- The source CRS.target
- The target CRS.
protected static void ensureNonNull(java.lang.String name, java.lang.Object object) throws java.lang.IllegalArgumentException
name
- Argument name.object
- User argument.
java.lang.IllegalArgumentException
- if object
is null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |