|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.ct.MathTransformFactory
DefaultMathTransformFactory
in the org.geotools.referencing.operation
package.
Creates math transforms. MathTransformFactory
is a low level
factory that is used to create MathTransform
objects. Many high
level GIS applications will never need to use a MathTransformFactory
directly; they can use a CoordinateTransformationFactory
instead.
However, the MathTransformFactory
class is specified here,
since it can be used directly by applications that wish to transform other
types of coordinates (e.g. color coordinates, or image pixel coordinates).
A math transform is an object that actually does the work of applying
formulae to coordinate values. The math transform does not know or
care how the coordinates relate to positions in the real world. This
lack of semantics makes implementing MathTransformFactory
significantly easier than it would be otherwise.
For example MathTransformFactory
can create affine math
transforms. The affine transform applies a matrix to the coordinates
without knowing how what it is doing relates to the real world. So if
the matrix scales Z values by a factor of 1000, then it could
be converting meters into millimeters, or it could be converting kilometers
into meters.
Because math transforms have low semantic value (but high mathematical
value), programmers who do not have much knowledge of how GIS applications
use coordinate systems, or how those coordinate systems relate to the real
world can implement MathTransformFactory
.
The low semantic content of math transforms also means that they will be
useful in applications that have nothing to do with GIS coordinates. For
example, a math transform could be used to map color coordinates between
different color spaces, such as converting (red, green, blue) colors into
(hue, light, saturation) colors.
Since a math transform does not know what its source and target coordinate
systems mean, it is not necessary or desirable for a math transform object
to keep information on its source and target coordinate systems.
CT_MathTransformFactory
AbstractMathTransform
(for example
concatenante(MathTransformFactory, ...)
) and moves some code in
AbstractMathTransform
's sub-classes. It would simplify
MathTransformFactory
but would introduces dependencies
to the factory right inside the abstract math transform.Constructor Summary | |
MathTransformFactory(MathTransformProvider[] providers)
Deprecated. Construct a factory using the specified providers. |
Method Summary | |
MathTransform2D |
createAffineTransform(java.awt.geom.AffineTransform matrix)
Deprecated. Creates an affine transform from a matrix. |
MathTransform |
createAffineTransform(Matrix matrix)
Deprecated. Creates an affine transform from a matrix. |
MathTransform |
createConcatenatedTransform(MathTransform tr1,
MathTransform tr2)
Deprecated. Creates a transform by concatenating two existing transforms. |
MathTransform |
createFilterTransform(MathTransform transform,
javax.media.jai.IntegerSequence outputDimensions)
Deprecated. Creates a transform which retains only a subset of an other transform's outputs. |
MathTransform |
createFromWKT(java.lang.String text)
Deprecated. Creates a math transform object from a Well-Known Text (WKT) string. |
MathTransform |
createIdentityTransform(int dimension)
Deprecated. Creates an identity transform of the specified dimension. |
MathTransform |
createParameterizedTransform(Projection projection)
Deprecated. Creates a transform from a projection. |
MathTransform |
createParameterizedTransform(java.lang.String classification,
javax.media.jai.ParameterList parameters)
Deprecated. Creates a transform from a classification name and parameters. |
MathTransform |
createPassThroughTransform(int firstAffectedOrdinate,
MathTransform subTransform,
int numTrailingOrdinates)
Deprecated. Creates a transform which passes through a subset of ordinates to another transform. |
MathTransform |
createSubTransform(MathTransform transform,
javax.media.jai.IntegerSequence inputDimensions,
javax.media.jai.IntegerSequence outputDimensions)
Deprecated. Reduces the number of input dimensions for the specified transform. |
java.lang.String[] |
getAvailableTransforms()
Deprecated. Returns the classification names of every available transforms. |
static MathTransformFactory |
getDefault()
Deprecated. Returns the default math transform factory. |
MathTransformProvider |
getMathTransformProvider(java.lang.String classification)
Deprecated. Returns the provider for the specified classification. |
Unit |
getParameterUnit(java.lang.String parameter)
Deprecated. Returns the unit for the specified parameter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MathTransformFactory(MathTransformProvider[] providers)
Method Detail |
public static MathTransformFactory getDefault()
public MathTransform createIdentityTransform(int dimension)
dimension
- The source and target dimension.
public MathTransform2D createAffineTransform(java.awt.geom.AffineTransform matrix)
matrix
- The matrix used to define the affine transform.
public MathTransform createAffineTransform(Matrix matrix)
matrix
- The matrix used to define the affine transform.
CT_MathTransformFactory.createAffineTransform(org.opengis.pt.PT_Matrix)
public MathTransform createConcatenatedTransform(MathTransform tr1, MathTransform tr2)
tr1
- The first transform to apply to points.tr2
- The second transform to apply to points.
CT_MathTransformFactory.createConcatenatedTransform(org.opengis.ct.CT_MathTransform, org.opengis.ct.CT_MathTransform)
public MathTransform createPassThroughTransform(int firstAffectedOrdinate, MathTransform subTransform, int numTrailingOrdinates)
firstAffectedOrdinate
- Index of the first affected ordinate.subTransform
- The sub transform.numTrailingOrdinates
- Number of trailing ordinates to pass through.
Affected ordinates will range from firstAffectedOrdinate
inclusive to dimTarget-numTrailingOrdinates
exclusive.
Source: firstAffectedOrdinate + subTransform.getDimSource() + numTrailingOrdinates Target: firstAffectedOrdinate + subTransform.getDimTarget() + numTrailingOrdinates
CT_MathTransformFactory.createPassThroughTransform(int, org.opengis.ct.CT_MathTransform)
,
createSubTransform(org.geotools.ct.MathTransform, javax.media.jai.IntegerSequence, javax.media.jai.IntegerSequence)
public MathTransform createSubTransform(MathTransform transform, javax.media.jai.IntegerSequence inputDimensions, javax.media.jai.IntegerSequence outputDimensions) throws org.opengis.referencing.FactoryException
transform
has (x, y, z)
inputs and (longitude, latitude, height) outputs, then
createSubTransform(transform, new IntegerSequence(0,1),
null)
will returns a transform with (x, y) inputs and (probably)
(longitude, latitude) outputs. This method can be used in order to
separate a concatenation of
pass through transforms.
transform
- The transform to reduces.inputDimensions
- The input dimension to keep. This sequence can contains any integers
in the range 0 inclusive to transform.getDimSource()
exclusive.outputDimensions
- An optional sequence in which to store output dimensions. If
non-null, then this sequence will be filled with output dimensions selected by
this method. The integers will be in the range 0 inclusive to
transform.getDimTarget()
exclusive.
subTransform.getDimSource() == inputDimensions.getNumElements(); subTransform.getDimTarget() == outputDimensions.getNumElements();
org.opengis.referencing.FactoryException
- if the transform is not separable.public MathTransform createFilterTransform(MathTransform transform, javax.media.jai.IntegerSequence outputDimensions)
transform
has
(longitude, latitude, height) outputs, then a sub-transform
may be used to keep only the (longitude, latitude) part. In most cases,
the created sub-transform is non-invertible since it loose informations.
transform
. However, invoking
createFilterTransfom(...)
allows the optimization of some common cases.
transform
- The transform to reduces.outputDimensions
- The output dimension to keep.
This sequence can contains any integers in the range 0 inclusive to
transform.getDimTarget()
exclusive.
transform
keeping only the specified output dimensions.public MathTransform createParameterizedTransform(java.lang.String classification, javax.media.jai.ParameterList parameters) throws MissingParameterException, org.opengis.referencing.FactoryException
classification
- The classification name of the transform
(e.g. "Transverse_Mercator"). Leading and trailing spaces
are ignored, and comparaison is case-insensitive.parameters
- The parameter values in standard units.
NoSuchClassificationException
- if there is no transform for the specified
classification.
MissingParameterException
- if a parameter was required but not found.
org.opengis.referencing.FactoryException
- if the math transform creation failed from some other reason.CT_MathTransformFactory.createParameterizedTransform(java.lang.String, org.opengis.ct.CT_Parameter[])
,
getAvailableTransforms()
public MathTransform createParameterizedTransform(Projection projection) throws MissingParameterException, org.opengis.referencing.FactoryException
projection
- The projection.
NoSuchClassificationException
- if there is no transform for the specified projection.
MissingParameterException
- if a parameter was required but not found.
org.opengis.referencing.FactoryException
- if the math transform creation failed from some other reason.public java.lang.String[] getAvailableTransforms()
createParameterizedTransform(java.lang.String, javax.media.jai.ParameterList)
public MathTransformProvider getMathTransformProvider(java.lang.String classification) throws NoSuchClassificationException
getMathTransformProvider("Transverse_Mercator").getParameterList()
),
or the transform name in a given locale (e.g.
getMathTransformProvider("Transverse_Mercator").getName(Locale.FRENCH
)
)
classification
- The classification name of the transform
(e.g. "Transverse_Mercator"). It should be one of the name
returned by getAvailableTransforms()
. Leading and
trailing spaces are ignored. Comparisons are case-insensitive.
NoSuchClassificationException
- if there is no provider registered
with the specified classification name.public Unit getParameterUnit(java.lang.String parameter)
Unit.METRE
. Other linear units are not authorized.Unit.DEGREE
. Other angular units are not authorized.Unit.DIMENSIONLESS
or
null
.
parameter
- The parameter name (e.g. "false_easting"
or "central_meridian"
).
null
.public MathTransform createFromWKT(java.lang.String text) throws org.opengis.referencing.FactoryException
text
- The Well-Known Text.
null
).
org.opengis.referencing.FactoryException
- if the Well-Known Text can't be parsed,
or if the math transform creation failed from some other reason.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |