| java.lang.Object org.geotools.referencing.operation.builder.MathTransformBuilder
All known Subclasses: org.geotools.referencing.operation.builder.BursaWolfTransformBuilder, org.geotools.referencing.operation.builder.RubberSheetBuilder, org.geotools.referencing.operation.builder.ProjectiveTransformBuilder,
MathTransformBuilder | abstract public class MathTransformBuilder (Code) | | Provides a basic implementation for
builders.
Math transform builders create
MathTransform objects for transforming
coordinates from a source CRS
(
) to
a target CRS using empirical parameters. Usually, one of those CRS is a
or
one with a well known relationship to the earth. The other CRS is often an
or
one
tied to some ship. For example a remote sensing image before
georectification may be referenced by an
.
Design note:
It is technically possible to reference such remote sensing images with a
from the geographic or projected CRS,
where the
is the math transform
.
Such approach is advantageous for
implementations, since they can determine the
operation just by inspection of the
DerivedCRS instance. However this
is conceptually incorrect since
DerivedCRS can be related to an other
CRS only through
, which by definition are
accurate up to rounding errors. The operations created by math transform
builders are rather
, which can't
be used for
DerivedCRS creation.
The math transform from
to
is calculated by
MathTransformBuilder from
a set of
in both CRS.
Subclasses must implement at least the
MathTransformBuilder.getMinimumPointCount() and
MathTransformBuilder.computeMathTransform() methods.
since: 2.4 version: $Id: MathTransformBuilder.java 28982 2008-01-28 16:27:33Z acuster $ author: Jan Jezek author: Martin Desruisseaux |
Field Summary | |
final protected MathTransformFactory | mtFactory The factory to use for creating
MathTransform math transform instances. |
mtFactory | final protected MathTransformFactory mtFactory(Code) | | The factory to use for creating
MathTransform math transform instances.
|
MathTransformBuilder | public MathTransformBuilder()(Code) | | Creates a builder with the default factories.
|
MathTransformBuilder | public MathTransformBuilder(Hints hints)(Code) | | Creates a builder from the specified hints.
|
computeMathTransform | abstract protected MathTransform computeMathTransform() throws FactoryException(Code) | | Calculates the math transform immediately.
Math transform from MathTransformBuilder.setMappedPositions MappedPosition. throws: FactoryException - if the math transform can't be created. |
getCoordinateSystemType | public Class getCoordinateSystemType()(Code) | | Returns the required coordinate system type. The default implementation returns
CoordinateSystem.class , which means that every kind of coordinate system
is legal. Some subclasses will restrict to
.
|
getErrorStatistics | public Statistics getErrorStatistics() throws FactoryException(Code) | | Returns statistics about the errors. The errors are computed as the distance between
transformed by the math transform computed
by this
MathTransformBuilder , and the
.
Use
Statistics.rms for the Root Mean Squared error.
throws: FactoryException - If the math transform can't be created or used. |
getMappedPositions | public List getMappedPositions()(Code) | | Returns the list of mapped positions.
|
getMathTransform | final public MathTransform getMathTransform() throws FactoryException(Code) | | Returns the calculated math transform. This method
the first time it is requested.
Math transform from MathTransformBuilder.setMappedPositions MappedPosition. throws: FactoryException - if the math transform can't be created. |
getMinimumPointCount | abstract public int getMinimumPointCount()(Code) | | Returns the minimum number of points required by this builder. This minimum depends on the
algorithm used. For example
require at least 3 points, while
requires only 2 points.
|
getName | public String getName()(Code) | | Returns the name for the
to
be created by this builder.
|
getSourceCRS | public CoordinateReferenceSystem getSourceCRS() throws FactoryException(Code) | | Returns the coordinate reference system for the
MathTransformBuilder.getSourcePoints source points .
This method determines the CRS as below:
- If at least one source points has a CRS, then this CRS is selected
as the source one and returned.
- If no source point has a CRS, then this method creates an
using the same
than the one used
by the
.
throws: FactoryException - if the CRS can't be created. |
getSourcePoints | public DirectPosition[] getSourcePoints()(Code) | | Returns the source points. This convenience method extracts those points from
the
.
|
getTargetCRS | public CoordinateReferenceSystem getTargetCRS() throws FactoryException(Code) | | Returns the coordinate reference system for the
MathTransformBuilder.getTargetPoints target points .
This method determines the CRS as below:
- If at least one target points has a CRS, then this CRS is selected
as the target one and returned.
- If no target point has a CRS, then this method creates an
using the same
than the one used
by the
.
throws: FactoryException - if the CRS can't be created. |
getTargetPoints | public DirectPosition[] getTargetPoints()(Code) | | Returns the target points. This convenience method extracts those points from
the
.
|
getTransformation | public Transformation getTransformation() throws FactoryException(Code) | | Returns the coordinate operation wrapping the
. The
will be set to the Root Mean Square (RMS) of the differences between the
source points transformed to the target CRS, and the expected target points.
|
printPoints | public void printPoints(Writer out, Locale locale) throws IOException(Code) | | Prints a table of all source and target points stored in this builder.
Parameters: out - The output device where to print all points. Parameters: locale - The locale, or null for the default. throws: IOException - if an error occured while printing. |
setMappedPositions | public void setMappedPositions(List positions) throws MismatchedSizeException, MismatchedDimensionException, MismatchedReferenceSystemException(Code) | | Set the list of mapped positions.
throws: MismatchedSizeException - if the list doesn't have the expected number of points. throws: MismatchedDimensionException - if some points doesn't have the. throws: MismatchedReferenceSystemException - if CRS is not the same for all points. |
setSourcePoints | public void setSourcePoints(DirectPosition[] points) throws MismatchedSizeException, MismatchedDimensionException, MismatchedReferenceSystemException(Code) | | Convenience method setting the
in mapped positions.
Parameters: points - The source points. throws: MismatchedSizeException - if the list doesn't have the expected number of points. throws: MismatchedDimensionException - if some points doesn't have the. throws: MismatchedReferenceSystemException - if CRS is not the same for all points. |
setTargetPoints | public void setTargetPoints(DirectPosition[] points) throws MismatchedSizeException, MismatchedDimensionException, MismatchedReferenceSystemException(Code) | | Convenience method setting the
in mapped positions.
Parameters: points - The target points. throws: MismatchedSizeException - if the list doesn't have the expected number of points. throws: MismatchedDimensionException - if some points doesn't have the. throws: MismatchedReferenceSystemException - if CRS is not the same for all points. |
toString | public String toString()(Code) | | Returns a string representation of this builder. The default implementation
returns a table containing all source and target points.
|
|
|