org.deegree.cs.transformations.polynomial
Class LeastSquareApproximation

java.lang.Object
  extended by org.deegree.cs.CRSIdentifiable
      extended by org.deegree.cs.transformations.Transformation
          extended by org.deegree.cs.transformations.polynomial.PolynomialTransformation
              extended by org.deegree.cs.transformations.polynomial.LeastSquareApproximation
All Implemented Interfaces:
Object, TypedObjectNode, CRSResource

public class LeastSquareApproximation
extends PolynomialTransformation

LeastSquareApproximation is a polynomial transformation which uses the least square method to approximate a function given by some measured values.

Version:
$Revision: 30120 $, $Date: 2011-03-22 10:04:15 +0100 (Tue, 22 Mar 2011) $
Author:
Rutger Bezema, last edited by: $Author: aschmitz $

Constructor Summary
LeastSquareApproximation(List<Double> firstParameters, List<Double> secondParameters, ICRS sourceCRS, ICRS targetCRS, float scaleX, float scaleY)
          Sets the id to EPSG::9645 ( General polynomial of degree 2 ).
LeastSquareApproximation(List<Double> firstParameters, List<Double> secondParameters, ICRS sourceCRS, ICRS targetCRS, float scaleX, float scaleY, CRSResource id)
           
 
Method Summary
 List<javax.vecmath.Point3d> applyPolynomial(List<javax.vecmath.Point3d> srcPts)
          The central method, which actually transforms the points by applying the implemented polynomial.
 float[][] createVariables(List<javax.vecmath.Point3d> originalPoints, List<javax.vecmath.Point3d> projectedPoints, int polynomalOrder)
           
 String getImplementationName()
           
 int getOrder()
           
 float getScaleX()
           
 float getScaleY()
           
 
Methods inherited from class org.deegree.cs.transformations.polynomial.PolynomialTransformation
doTransform, getFirstParams, getSecondParams, inverse, isIdentity, isInverseTransform
 
Methods inherited from class org.deegree.cs.transformations.Transformation
areInverse, canTransform, contains, copyTransformation, createFromTo, doTransform, doTransform, equalOnCRS, equals, getSourceCRS, getSourceDimension, getTargetCRS, getTargetDimension, getTransformationName, getTransformationPath, setSourceCRS
 
Methods inherited from class org.deegree.cs.CRSIdentifiable
addAreaOfUse, addName, checkForNullObject, checkForNullObject, checkForNullObject, getAreaOfUse, getAreaOfUseBBox, getAreasOfUse, getCode, getCodeAndName, getCodes, getDescription, getDescriptions, getId, getName, getNames, getOrignalCodeStrings, getVersion, getVersions, hasCode, hashCode, hasId, hasIdOrName, setDefaultAreaOfUse, setDefaultDescription, setDefaultId, setDefaultName, setDefaultVersion, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LeastSquareApproximation

public LeastSquareApproximation(List<Double> firstParameters,
                                List<Double> secondParameters,
                                ICRS sourceCRS,
                                ICRS targetCRS,
                                float scaleX,
                                float scaleY,
                                CRSResource id)
Parameters:
firstParameters - of the polynomial
secondParameters - of the polynomial
sourceCRS - of this transformation
targetCRS - of this transformation
scaleX - to apply to incoming data's x value, if 1 (or 0) no scale will be applied.
scaleY - to apply to incoming data's y value, if 1 (or 0) no scale will be applied.
id - an identifiable instance containing information about this transformation

LeastSquareApproximation

public LeastSquareApproximation(List<Double> firstParameters,
                                List<Double> secondParameters,
                                ICRS sourceCRS,
                                ICRS targetCRS,
                                float scaleX,
                                float scaleY)
Sets the id to EPSG::9645 ( General polynomial of degree 2 ).

Parameters:
firstParameters - of the polynomial
secondParameters - of the polynomial
sourceCRS - of this transformation
targetCRS - of this transformation
scaleX - to apply to incoming data's x value, if 1 (or 0) no scale will be applied.
scaleY - to apply to incoming data's y value, if 1 (or 0) no scale will be applied.
Method Detail

applyPolynomial

public List<javax.vecmath.Point3d> applyPolynomial(List<javax.vecmath.Point3d> srcPts)
                                            throws TransformationException
Description copied from class: PolynomialTransformation
The central method, which actually transforms the points by applying the implemented polynomial.

Specified by:
applyPolynomial in class PolynomialTransformation
Parameters:
srcPts - to transform
Returns:
the transformed points.
Throws:
TransformationException - if for some reason one of the incoming points could not be transformed.

getImplementationName

public String getImplementationName()
Specified by:
getImplementationName in class Transformation
Returns:
the name of the transformation.

createVariables

public float[][] createVariables(List<javax.vecmath.Point3d> originalPoints,
                                 List<javax.vecmath.Point3d> projectedPoints,
                                 int polynomalOrder)
Specified by:
createVariables in class PolynomialTransformation
Parameters:
originalPoints - of the projection
projectedPoints - the 'function' values
polynomalOrder - the order of the polynomial function to use.
Returns:
the variables the polynomial used for this transformation.

getOrder

public int getOrder()
Specified by:
getOrder in class PolynomialTransformation
Returns:
the order of the Polynomial used for this transformation.

getScaleX

public final float getScaleX()
Returns:
the scale which will be applied to the x value of all incoming data

getScaleY

public final float getScaleY()
Returns:
the scale which will be applied to the y value of all incoming data


Copyright © 2011. All Rights Reserved.