|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.referencing.operation.DefaultMathTransformFactory
Low level factory for creating math transforms. Many high level GIS applications will never need to use this factory directly; they can use a coordinate operation factory instead. However, the interface 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 significantly easier than it would be otherwise. For example 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 . 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.
Constructor Summary | |
DefaultMathTransformFactory()
Constructs a default math transform factory. |
Method Summary | |
org.opengis.referencing.operation.MathTransform |
createAffineTransform(org.opengis.referencing.operation.Matrix matrix)
Creates an affine transform from a matrix. |
org.opengis.referencing.operation.MathTransform |
createConcatenatedTransform(org.opengis.referencing.operation.MathTransform transform1,
org.opengis.referencing.operation.MathTransform transform2)
Creates a transform by concatenating two existing transforms. |
org.opengis.referencing.operation.MathTransform |
createFromWKT(java.lang.String text)
Creates a math transform object from a Well Known Text (WKT). |
org.opengis.referencing.operation.MathTransform |
createFromXML(java.lang.String xml)
Creates a math transform object from a XML string. |
org.opengis.referencing.operation.MathTransform |
createParameterizedTransform(org.opengis.parameter.ParameterValueGroup parameters)
Creates a transform from a group of parameters. |
org.opengis.referencing.operation.MathTransform |
createParameterizedTransform(org.opengis.parameter.ParameterValueGroup parameters,
java.util.Collection methods)
Creates a transform from a group of parameters and add the method used to a list. |
org.opengis.referencing.operation.MathTransform |
createPassThroughTransform(int firstAffectedOrdinate,
org.opengis.referencing.operation.MathTransform subTransform,
int numTrailingOrdinates)
Creates a transform which passes through a subset of ordinates to another transform. |
java.util.Set |
getAvailableMethods(java.lang.Class type)
Returns a set of available methods for math transforms. |
org.opengis.parameter.ParameterValueGroup |
getDefaultParameters(java.lang.String method)
Returns the default parameter values for a math transform using the given method. |
org.opengis.referencing.operation.OperationMethod |
getOperationMethod(java.lang.String name)
Returns the operation method for the specified name. |
org.opengis.metadata.citation.Citation |
getVendor()
Returns the vendor responsible for creating this factory implementation. |
static void |
main(java.lang.String[] args)
Dump to the standard output stream a list of available operation method. |
void |
scanForPlugins()
Scans for factory plug-ins on the application class path. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultMathTransformFactory()
math transform
factory.
Method Detail |
public org.opengis.metadata.citation.Citation getVendor()
getVendor
in interface org.opengis.referencing.Factory
public java.util.Set getAvailableMethods(java.lang.Class type)
getDefaultParameters(java.lang.String)
method in this factory.
The set of available methods is implementation dependent.
getAvailableMethods
in interface org.opengis.referencing.operation.MathTransformFactory
type
- Operation.class
for fetching all operation methods,
or Projection.class
for fetching only map projection
methods.
getDefaultParameters(java.lang.String)
,
createParameterizedTransform(org.opengis.parameter.ParameterValueGroup)
public org.opengis.referencing.operation.OperationMethod getOperationMethod(java.lang.String name) throws org.opengis.referencing.NoSuchIdentifierException
name
- The case insensitive identifier code
of the operation method to search for (e.g. ).
org.opengis.referencing.NoSuchIdentifierException
- if there is no operation method registered for the
specified name.public org.opengis.parameter.ParameterValueGroup getDefaultParameters(java.lang.String method) throws org.opengis.referencing.NoSuchIdentifierException
getAvailableMethods(java.lang.Class)
method. A typical example is
"Transverse_Mercator"
).
This method creates new parameter instances at every call. It is intented to be modified
by the user before to be passed to createParameterizedTransform(parameters)
.
getDefaultParameters
in interface org.opengis.referencing.operation.MathTransformFactory
method
- The case insensitive name of the method to search for.
org.opengis.referencing.NoSuchIdentifierException
- if there is no transform registered for the specified
method.getAvailableMethods(java.lang.Class)
,
createParameterizedTransform(org.opengis.parameter.ParameterValueGroup)
,
AbstractMathTransform.getParameterValues()
public org.opengis.referencing.operation.MathTransform createParameterizedTransform(org.opengis.parameter.ParameterValueGroup parameters) throws org.opengis.referencing.NoSuchIdentifierException, org.opengis.referencing.FactoryException
ParameterValueGroup p = factory.getDefaultParameters("Transverse_Mercator"); p.parameter("semi_major").setValue(6378137.000); p.parameter("semi_minor").setValue(6356752.314); MathTransform mt = factory.createParameterizedTransform(p);
createParameterizedTransform
in interface org.opengis.referencing.operation.MathTransformFactory
parameters
- The parameter values.
org.opengis.referencing.NoSuchIdentifierException
- if there is no transform registered for the method.
org.opengis.referencing.FactoryException
- if the object creation failed. This exception is thrown
if some required parameter has not been supplied, or has illegal value.getDefaultParameters(java.lang.String)
,
getAvailableMethods(java.lang.Class)
public org.opengis.referencing.operation.MathTransform createParameterizedTransform(org.opengis.parameter.ParameterValueGroup parameters, java.util.Collection methods) throws org.opengis.referencing.NoSuchIdentifierException, org.opengis.referencing.FactoryException
parameters
- The parameter values.methods
- A collection where to add the operation method that apply to the transform,
or if none.
org.opengis.referencing.NoSuchIdentifierException
- if there is no transform registered for the method.
org.opengis.referencing.FactoryException
- if the object creation failed. This exception is thrown
if some required parameter has not been supplied, or has illegal value.public org.opengis.referencing.operation.MathTransform createAffineTransform(org.opengis.referencing.operation.Matrix matrix) throws org.opengis.referencing.FactoryException
createAffineTransform
in interface org.opengis.referencing.operation.MathTransformFactory
matrix
- The matrix used to define the affine transform.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.operation.MathTransform createConcatenatedTransform(org.opengis.referencing.operation.MathTransform transform1, org.opengis.referencing.operation.MathTransform transform2) throws org.opengis.referencing.FactoryException
createConcatenatedTransform
in interface org.opengis.referencing.operation.MathTransformFactory
transform1
- The first transform to apply to points.transform2
- The second transform to apply to points.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.operation.MathTransform createPassThroughTransform(int firstAffectedOrdinate, org.opengis.referencing.operation.MathTransform subTransform, int numTrailingOrdinates) throws org.opengis.referencing.FactoryException
createPassThroughTransform
in interface org.opengis.referencing.operation.MathTransformFactory
firstAffectedOrdinate
- The lowest index of the affected ordinates.subTransform
- Transform to use for affected ordinates.numTrailingOrdinates
- Number of trailing ordinates to pass through.
Affected ordinates will range from
inclusive to exclusive.
Source: firstAffectedOrdinate + subTransform.getSourceDimensions() + numTrailingOrdinates Target: firstAffectedOrdinate + subTransform.getTargetDimensions() + numTrailingOrdinates
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.operation.MathTransform createFromXML(java.lang.String xml) throws org.opengis.referencing.FactoryException
createFromXML
in interface org.opengis.referencing.operation.MathTransformFactory
xml
- Math transform encoded in XML format.
org.opengis.referencing.FactoryException
- if the object creation failed.public org.opengis.referencing.operation.MathTransform createFromWKT(java.lang.String text) throws org.opengis.referencing.FactoryException
createFromWKT
in interface org.opengis.referencing.operation.MathTransformFactory
text
- Math transform encoded in Well-Known Text format.
org.opengis.referencing.FactoryException
- if the Well-Known Text can't be parsed,
or if the math transform creation failed from some other reason.public void scanForPlugins()
public static void main(java.lang.String[] args)
java org.geotools.referencing.operation.DefaultMathTransformFactory
<options> <method>
where options are:
-projections |
List only projections |
-conversions |
List only conversions |
-all |
List the parameters for all transforms |
-encoding <code> |
Set the character encoding |
-locale <language> |
Set the language for the output (e.g. "fr" for French) |
and <method> is the optional name of an operation method
(e.g. "Affine"
, "EPSG:9624"
or just
"9624"
for the affine transform method).
Note for Windows users: If the output contains strange symbols, try to supply an "" argument. Example:
java org.geotools.referencing.operation.DefaultMathTransformFactory -encoding Cp850
The codepage number (850 in the previous example) can be obtained from the DOS commande line using the "" command with no arguments. This argument need to be supplied only once.
args
- Command line arguments.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |