Package org.opengis.test.referencing
Class AffineTransformTest
Object
TestCase
TransformTestCase
AffineTransformTest
Tests affine transforms
from the
org.opengis.referencing.operation package. Math transform instances are
created using the factory given at construction time.
Usage example:
in order to specify their factories and run the tests in a JUnit framework, implementers can define a subclass in their own test suite as in the example below:import org.opengis.test.referencing.AffineTransformTest;
public class MyTest extends AffineTransformTest {
public MyTest() {
super(new MyMathTransformFactory());
}
}
- Since:
- 3.1
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleantrueifMathTransformFactory.createAffineTransform(Matrix)accepts matrixes of size different than 3×3.protected booleantrueifMathTransformFactory.createAffineTransform(Matrix)accepts non-square matrixes.protected MatrixThe matrix of the math transform being tested.protected final MathTransformFactoryThe factory for creatingMathTransformobjects, ornullif none.Fields inherited from class org.opengis.test.referencing.TransformTestCase
derivativeDeltas, isDerivativeSupported, isDoubleToDoubleSupported, isDoubleToFloatSupported, isFloatToDoubleSupported, isFloatToFloatSupported, isInverseTransformSupported, isOverlappingArraySupported, tolerance, toleranceModifier, transformFields inherited from class org.opengis.test.TestCase
configurationTip, units, validators -
Constructor Summary
ConstructorsConstructorDescriptionAffineTransformTest(MathTransformFactory factory) Creates a new test using the given factory. -
Method Summary
Modifier and TypeMethodDescriptionReturns information about the configuration of the test which has been run.voidTests a transform swapping the axes in a two-dimensional space.voidTests a transform which reduce the number of dimensions from 4 to 2.voidTests using a combination of scale, rotation and translation in a two-dimensional space.voidTests using a non-uniform scale factor of (3,4) in a two-dimensional space.voidTests using an identity transform in an one-dimensional space.voidTests using an identity transform in a two-dimensional space.voidTests using an identity transform in a three-dimensional space.voidTests using an anticlockwise 30° rotation in a two-dimensional space.voidTests using a 180° rotation in a two-dimensional space.voidTests using a translation of (400000,-100000) metres in a two-dimensional space.voidTests using a uniform scale factor of 0.3048 in a two-dimensional space.Methods inherited from class org.opengis.test.referencing.TransformTestCase
assertAllTestsEnabled, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertMatrixEquals, normalize, tolerance, verifyConsistency, verifyDerivative, verifyInDomain, verifyInverse, verifyInverse, verifyTransformMethods inherited from class org.opengis.test.TestCase
getEnabledFlags
-
Field Details
-
mtFactory
The factory for creatingMathTransformobjects, ornullif none. -
matrix
The matrix of the math transform being tested. This field is set, together with thetransformfield, after the execution of everytestFoo()method in this class.If this field is non-null before a test is run, then those parameters will be used directly. This allow implementers to alter the parameters before to run the test one more time.
-
isNonSquareMatrixSupported
trueifMathTransformFactory.createAffineTransform(Matrix)accepts non-square matrixes. Transforms defined by non-square matrixes have a number of input dimensions different than the number of output dimensions. -
isNonBidimensionalSpaceSupported
trueifMathTransformFactory.createAffineTransform(Matrix)accepts matrixes of size different than 3×3. Iffalse, then only matrixes of size 3×3 (i.e. affine transforms between two-dimensional spaces) will be tested.
-
-
Constructor Details
-
AffineTransformTest
Creates a new test using the given factory. If the given factory isnull, then the tests will be skipped.- Parameters:
factory- factory for creatingMathTransforminstances.
-
-
Method Details
-
configuration
Returns information about the configuration of the test which has been run. This method returns a map containing:- All the entries defined in the parent class.
- All the following values associated to the
Configuration.Keyof the same name:
- Overrides:
configurationin classTransformTestCase- Returns:
- the configuration of the test being run, or an empty map if none. This method returns a modifiable map in order to allow subclasses to modify it.
-
testIdentity1D
Tests using an identity transform in an one-dimensional space. This test is executed only if theisNonBidimensionalSpaceSupportedflag is set totrue.- Throws:
FactoryException- should never happen.TransformException- should never happen.
-
testIdentity2D
Tests using an identity transform in a two-dimensional space.- Throws:
FactoryException- should never happen.TransformException- should never happen.
-
testIdentity3D
Tests using an identity transform in a three-dimensional space. This test is executed only if theisNonBidimensionalSpaceSupportedflag is set totrue.- Throws:
FactoryException- should never happen.TransformException- should never happen.
-
testAxisSwapping2D
Tests a transform swapping the axes in a two-dimensional space.- Throws:
FactoryException- should never happen.TransformException- should never happen.
-
testSouthOrientated2D
Tests using a 180° rotation in a two-dimensional space.- Throws:
FactoryException- should never happen.TransformException- should never happen.
-
testTranslatation2D
Tests using a translation of (400000,-100000) metres in a two-dimensional space. This translation is determined by theFalse easting
andFalse northing
parameter values of the OSGB 1936 / British National Grid projection.- Throws:
FactoryException- should never happen.TransformException- should never happen.
-
testUniformScale2D
Tests using a uniform scale factor of 0.3048 in a two-dimensional space. This is the conversion factor from feet to metres.- Throws:
FactoryException- should never happen.TransformException- should never happen.
-
testGenericScale2D
Tests using a non-uniform scale factor of (3,4) in a two-dimensional space.- Throws:
FactoryException- should never happen.TransformException- should never happen.
-
testRotation2D
Tests using an anticlockwise 30° rotation in a two-dimensional space.- Throws:
FactoryException- should never happen.TransformException- should never happen.
-
testGeneral
Tests using a combination of scale, rotation and translation in a two-dimensional space.- Throws:
FactoryException- should never happen.TransformException- should never happen.
-
testDimensionReduction
Tests a transform which reduce the number of dimensions from 4 to 2. This test is executed only if theisNonSquareMatrixSupportedflag is set totrue.- Throws:
FactoryException- should never happen.TransformException- should never happen.
-