Class ParameterizedTransformTest
- Object
-
- TestCase
-
- TransformTestCase
-
- ParameterizedTransformTest
-
public class ParameterizedTransformTest extends TransformTestCase
Tests parameterized math transforms from theorg.opengis.referencing.operation
package. Math transform instances are created using the factory given at construction time.Skipping tests for unsupported operations:
If the tested factory throws aNoSuchIdentifierException
during the invocation of one of the following methods:MathTransformFactory.getDefaultParameters(String)
MathTransformFactory.createParameterizedTransform(ParameterValueGroup)
NoSuchIdentifierException
is thrown under other circumstances than the invocation of above methods, then the test fails.Tests and accuracy:
By default, every tests expect an accuracy of 1 centimetre. This accuracy matches the precision of most example points given in the EPSG guidance notice. Implementors can modify the kind of tests being executed and the tolerance threshold in different ways:- Set some
is<Operation>Supported
fields tofalse
. - Override some of the
testFoo()
method and set thetolerance
field before to invokesuper.testFoo()
. - Override
normalize(DirectPosition, DirectPosition, CalculationType)
. - Override
assertMatrixEquals(String, Matrix, Matrix, Matrix)
.
Usage example: in order to specify their factories and run the tests in a JUnit framework, implementors can define a subclass in their own test suite as in the example below. That example shows also how implementors can alter some tests (here the tolerance value for the Lambert Azimuthal Equal Area projection) and add more checks to be executed after every tests (here ensuring that the transform implements theMathTransform2D
interface):import org.junit.*; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.opengis.test.referencing.ParameterizedTransformTest; import static org.junit.Assert.*; @RunWith(JUnit4.class) public class MyTest extends ParameterizedTransformTest { public MyTest() { super(new MyMathTransformFactory()); } @Test @Override public void testLambertAzimuthalEqualArea() throws FactoryException, TransformException { tolerance = 0.1; // Increase the tolerance value to 10 cm. super.testLambertAzimuthalEqualArea(); // If more tests specific to this projection are wanted, do them here. // In this example, we replace the ellipsoid by a sphere and test again. // Note that spherical formulas can have an error up to 30 km compared // to ellipsoidal formulas, so we have to relax again the tolerance threshold. parameters.parameter("semi_minor").setValue(parameters.parameter("semi_major").doubleValue()); tolerance = 30000; // Increase the tolerance value to 30 km. super.testLambertAzimuthalEqualArea(); } @After public void ensureAllTransformAreMath2D() { assertTrue(transform instanceof MathTransform2D); } }
- Since:
- 3.1
- See Also:
AffineTransformTest
,AuthorityFactoryTest
,TestSuite
-
-
Field Summary
Fields Modifier and Type Field Description protected String
description
A description of the test being run.protected MathTransformFactory
mtFactory
The factory for creatingMathTransform
objects, ornull
if none.protected ParameterValueGroup
parameters
The parameters of the math transform being tested.-
Fields inherited from class TransformTestCase
derivativeDeltas, isDerivativeSupported, isDoubleToDoubleSupported, isDoubleToFloatSupported, isFloatToDoubleSupported, isFloatToFloatSupported, isInverseTransformSupported, isOverlappingArraySupported, tolerance, toleranceModifier, transform
-
Fields inherited from class TestCase
configurationTip, listener, units, validators
-
-
Constructor Summary
Constructors Constructor Description ParameterizedTransformTest(MathTransformFactory factory)
Creates a new test using the given factory.
-
Method Summary
Modifier and Type Method Description protected void
assertMatrixEquals(String message, Matrix expected, Matrix actual, Matrix tolmat)
Asserts that a matrix of derivatives is equals to the expected ones within a positive delta.Configuration
configuration()
Returns information about the configuration of the test which has been run.static List<Factory[]>
factories()
Returns a default set of factories to use for running the tests.void
testAbridgedMolodensky()
Tests the "Abridged Molodensky" (EPSG:9605) datum shift operation.void
testCassiniSoldner()
Tests the "Cassini-Soldner" (EPSG:9806) projection method.void
testHotineObliqueMercator()
Tests the "Hotine Oblique Mercator (variant B)" (EPSG:9815) projection method.void
testKrovak()
Tests the "Krovak" (EPSG:9819) projection.void
testLambertAzimuthalEqualArea()
Tests the "Lambert Azimuthal Equal Area" (EPSG:9820) projection method.void
testLambertConicConformal1SP()
Tests the "Lambert Conic Conformal (1SP)" (EPSG:9801) projection method.void
testLambertConicConformal2SP()
Tests the "Lambert Conic Conformal (2SP)" (EPSG:9802) projection method.void
testLambertConicConformalBelgium()
Tests the "Lambert Conic Conformal (2SP Belgium)" (EPSG:9803) projection method.void
testLambertConicConformalMichigan()
Tests the "Lambert Conic Conformal (2SP Michigan)" (EPSG:1051) projection method.void
testMercator1SP()
Tests the "Mercator (variant A)" (EPSG:9804) projection method.void
testMercator2SP()
Tests the "Mercator (variant B)" (EPSG:9805) projection method.void
testMercatorSpherical()
Tests the "Mercator (Spherical)" (EPSG:1026) projection method.void
testMercatorVariantC()
Tests the "Mercator (variant C)" (EPSG:1044) projection method.void
testMiller()
Tests the "IGNF:MILLER" projection.void
testObliqueStereographic()
Tests the "Oblique Stereographic" (EPSG:9809) projection method.void
testPolarStereographicA()
Tests the "Polar Stereographic (variant A)" (EPSG:9810) projection method.void
testPolarStereographicB()
Tests the "Polar Stereographic (variant B)" (EPSG:9829) projection method.void
testPolarStereographicC()
Tests the "Polar Stereographic (variant C)" (EPSG:9830) projection method.void
testPolyconic()
Tests the "American Polyconic" (EPSG:9818) projection.void
testPseudoMercator()
Tests the "Mercator Popular Visualisation Pseudo Mercator" (EPSG:1024) projection method.void
testTransverseMercator()
Tests the "Transverse Mercator" (EPSG:9807) projection method.void
testTransverseMercatorSouthOrientated()
Tests the Transverse Mercator (South Orientated) (EPSG:9808) projection method.-
Methods inherited from class TransformTestCase
assertAllTestsEnabled, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, normalize, tolerance, verifyConsistency, verifyDerivative, verifyInDomain, verifyInverse, verifyInverse, verifyTransform
-
Methods inherited from class TestCase
factories, factories, getEnabledFlags
-
-
-
-
Field Detail
-
mtFactory
protected final MathTransformFactory mtFactory
The factory for creatingMathTransform
objects, ornull
if none.
-
parameters
protected ParameterValueGroup parameters
The parameters of the math transform being tested. This field is set, together with thetransform
field, 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 implementors to alter the parameters before to run the test one more time.
-
description
protected String description
A description of the test being run. This field is provided only for information purpose (typically for producing logging or error messages); it is not actually used by the tests. The value can be:- The name of the target
ProjectedCRS
when the transform being tested is a map projection - The transformation name when the transform being tested is a datum shift operation.
- The name of the target
-
-
Constructor Detail
-
ParameterizedTransformTest
public ParameterizedTransformTest(MathTransformFactory factory)
Creates a new test using the given factory. If the given factory isnull
, then the tests will be skipped.- Parameters:
factory
- factory for creatingMathTransform
instances.
-
-
Method Detail
-
factories
public static List<Factory[]> factories()
Returns a default set of factories to use for running the tests. Those factories are given in arguments to the constructor when this test class is instantiated directly by JUnit (for example as a suite element), instead than subclassed by the implementor. The factories are fetched as documented in theTestCase.factories(Class[])
javadoc.- Returns:
- the default set of arguments to be given to the
ParameterizedTransformTest
constructor.
-
configuration
public Configuration 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.Key
of the same name:
- Overrides:
configuration
in 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.
- See Also:
ImplementationDetails.configuration(Factory[])
-
testMercator1SP
public void testMercator1SP() throws FactoryException, TransformException
Tests the "Mercator (variant A)" (EPSG:9804) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi-major axis 6377397.155 m semi-minor axis 6356078.962818189 m Latitude of natural origin 0.0° Longitude of natural origin 110.0° Scale factor at natural origin 0.997 False easting 3900000.0 m False northing 900000.0 m Test points Source ordinates Expected results 110°E
0°N3900000.00 m
900000.00 m120°E
3°S5009726.58 m
569150.82 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.- See Also:
AuthorityFactoryTest.testEPSG_3002()
-
testMercator2SP
public void testMercator2SP() throws FactoryException, TransformException
Tests the "Mercator (variant B)" (EPSG:9805) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi-major axis 6378245.0 m semi-minor axis 6356863.018773047 m Latitude of 1st standard parallel 42.0° Longitude of natural origin 51.0° False easting 0.0 m False northing 0.0 m Test points Source ordinates Expected results 51°E
0°N0.00 m
0.00 m53°E
53°N165704.29 m
5171848.07 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.- See Also:
AuthorityFactoryTest.testEPSG_3388()
-
testMercatorVariantC
public void testMercatorVariantC() throws FactoryException, TransformException
Tests the "Mercator (variant C)" (EPSG:1044) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are below. Note that this is similar to
testMercator2SP()
, except that the "latitude of false origin" parameter is set to 42°N.CRS characteristics Parameter Value semi-major axis 6378245.0 m semi-minor axis 6356863.018773047 m Latitude of 1st standard parallel 42.0° Longitude of natural origin 51.0° Latitude of false origin 42.0° Easting at false origin 0.0 m Northing at false origin 0.0 m Test points Source ordinates Expected results 51°E
42°N0.00 m
0.00 m53°E
53°N165704.29 m
1351950.22 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.
-
testMercatorSpherical
public void testMercatorSpherical() throws FactoryException, TransformException
Tests the "Mercator (Spherical)" (EPSG:1026) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are below. Note that the sample point is the same than for
testPseudoMercator()
, but with a different result in projected coordinates.CRS characteristics Parameter Value semi-major axis 6371007.0 m semi-minor axis 6371007.0 m Longitude of natural origin 0.0° False easting 0.0 m False northing 0.0 m Test points Source ordinates Expected results 0°E
0°N0.00 m
0.00 m100°20'00.000"W
24°22'54.433"N-11156569.90 m
2796869.94 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.
-
testPseudoMercator
public void testPseudoMercator() throws FactoryException, TransformException
Tests the "Mercator Popular Visualisation Pseudo Mercator" (EPSG:1024) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi-major axis 6378137.0 m semi-minor axis 6356752.314247833 m Latitude of natural origin 0.0° Longitude of natural origin 0.0° False easting 0.0 m False northing 0.0 m Test points Source ordinates Expected results 0°E
0°N0.00 m
0.00 m100°20'00.000"W
24°22'54.433"N-11169055.58 m
2800000.00 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.- See Also:
AuthorityFactoryTest.testEPSG_3857()
-
testMiller
public void testMiller() throws FactoryException, TransformException
Tests the "IGNF:MILLER" projection. First, this method transforms the point given below and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi_major 6378137.0 m semi_minor 6378137.0 m central_meridian 0.0° false_easting 0.0 m false_northing 0.0 m Test points Source ordinates Expected results 0°E
0°N0.00 m
0.00 m2.478917°E
48.805639°N275951.78 m
5910061.78 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.- See Also:
AuthorityFactoryTest.testIGNF_MILLER()
-
testHotineObliqueMercator
public void testHotineObliqueMercator() throws FactoryException, TransformException
Tests the "Hotine Oblique Mercator (variant B)" (EPSG:9815) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi-major axis 6377298.556 m semi-minor axis 6356097.550300896 m Latitude of projection centre 4.0° Longitude of projection centre 109.6855202029758° Azimuth of initial line 53.31582047222222° Angle from Rectified to Skew Grid 53.13010236111111° Scale factor on initial line 0.99984 Easting at projection centre 590476.87 m Northing at projection centre 442857.65 m Test points Source ordinates Expected results 115°E
4°N590476.87 m
442857.65 m115°48'19.8196"E
5°23'14.1129"N679245.73 m
596562.78 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.- See Also:
AuthorityFactoryTest.testEPSG_29873()
-
testTransverseMercator
public void testTransverseMercator() throws FactoryException, TransformException
Tests the "Transverse Mercator" (EPSG:9807) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi-major axis 6377563.396 m semi-minor axis 6356256.908909849 m Latitude of natural origin 49.0° Longitude of natural origin -2.0° Scale factor at natural origin 0.9996012717 False easting 400000.0 m False northing -100000.0 m Test points Source ordinates Expected results 2°W
49°N400000.00 m
-100000.00 m00°30'E
50°30'N577274.98 m
69740.49 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.- See Also:
AuthorityFactoryTest.testEPSG_27700()
-
testTransverseMercatorSouthOrientated
public void testTransverseMercatorSouthOrientated() throws FactoryException, TransformException
Tests the Transverse Mercator (South Orientated) (EPSG:9808) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi-major axis 6378137.0 m semi-minor axis 6356752.314247833 m Latitude of natural origin 0° Longitude of natural origin 29° Scale factor at natural origin 1 False easting 0 m False northing 0 m Test points Source ordinates Expected results 20°E
0°S0 m
0 m28°16'57.479"E
25°43'55.302"S71984.48 m
2847342.74 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.
-
testCassiniSoldner
public void testCassiniSoldner() throws FactoryException, TransformException
Tests the "Cassini-Soldner" (EPSG:9806) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi-major axis 6378350.8704 m semi-minor axis 6356675.0184 m Latitude of natural origin 10.441666666666666° Longitude of natural origin -61.33333333333333° False easting 86501.46392052001 m False northing 65379.0134283 m Test points Source ordinates Expected results 61°20'00"W
10°26'30"N430000.00 links
325000.00 links60°00'00"W
10°00'00"N66644.94 links
82536.22 links1 link = 0.66 feet
1 feet = 0.3048 metre- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.- See Also:
AuthorityFactoryTest.testEPSG_2314()
-
testLambertConicConformal1SP
public void testLambertConicConformal1SP() throws FactoryException, TransformException
Tests the "Lambert Conic Conformal (1SP)" (EPSG:9801) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi-major axis 6378206.4 m semi-minor axis 6356583.8 m Latitude of natural origin 18.0° Longitude of natural origin -77.0° Scale factor at natural origin 1.0 False easting 250000.0 m False northing 150000.0 m Test points Source ordinates Expected results 77°W
18°N250000.00 m
150000.00 m76°56'37.26"W
17°55'55.80"N255966.58 m
142493.51 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.- See Also:
AuthorityFactoryTest.testEPSG_24200()
-
testLambertConicConformal2SP
public void testLambertConicConformal2SP() throws FactoryException, TransformException
Tests the "Lambert Conic Conformal (2SP)" (EPSG:9802) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi-major axis 6378206.4 m semi-minor axis 6356583.8 m Latitude of false origin 27.833333333333333° Longitude of false origin -99.0° Latitude of 1st standard parallel 28.383333333333333° Latitude of 2nd standard parallel 30.283333333333333° Easting at false origin 609601.2192024385 m Northing at false origin 0.0 m Test points Source ordinates Expected results 99°00'W
27°30'N2000000.00 US feet
0 US feet96°00'W
28°30'N2963503.91 US feet
254759.80 US feet1 metre = 3.2808333… US feet
- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.- See Also:
AuthorityFactoryTest.testEPSG_32040()
-
testLambertConicConformalBelgium
public void testLambertConicConformalBelgium() throws FactoryException, TransformException
Tests the "Lambert Conic Conformal (2SP Belgium)" (EPSG:9803) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi-major axis 6378388.0 m semi-minor axis 6356911.9461279465 m Latitude of false origin 90.0° Longitude of false origin 4.356939722222222° Latitude of 1st standard parallel 49.83333333333333° Latitude of 2nd standard parallel 51.16666666666667° Easting at false origin 150000.01256 m Northing at false origin 5400088.4378 m Test points Source ordinates Expected results 4°21'24.983"E
90°00'00.000"N150000.01 m
5400088.44 m5°48'26.533"E
50°40'46.461"N251763.20 m
153034.13 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.- See Also:
AuthorityFactoryTest.testEPSG_31300()
-
testLambertConicConformalMichigan
public void testLambertConicConformalMichigan() throws FactoryException, TransformException
Tests the "Lambert Conic Conformal (2SP Michigan)" (EPSG:1051) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi-major axis 6378206.4 m semi-minor axis 6356583.8 m Latitude of false origin 43.316666666666667° Longitude of false origin -84.333333333333333° Latitude of 1st standard parallel 44.183333333333333° Latitude of 2nd standard parallel 45.7° Easting at false origin 609601.2192024385 m Northing at false origin 0.0 m Test points Source ordinates Expected results 84°20'W
43°19'N2000000.00 US feet
0 US feet83°10"W
43°45'N2308335.75 US feet
160210.48 US feet1 metre = 3.2808333… US feet
- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.
-
testLambertAzimuthalEqualArea
public void testLambertAzimuthalEqualArea() throws FactoryException, TransformException
Tests the "Lambert Azimuthal Equal Area" (EPSG:9820) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi-major axis 6378137.0 m semi-minor axis 6356752.314140284 m Latitude of natural origin 52.0° Longitude of natural origin 10.0° False easting 4321000.0 m False northing 3210000.0 m Test points Source ordinates Expected results 10°E
52°N4321000.00 m
3210000.00 m5°E
50°N3962799.45 m
2999718.85 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.- See Also:
AuthorityFactoryTest.testEPSG_3035()
-
testPolarStereographicA
public void testPolarStereographicA() throws FactoryException, TransformException
Tests the "Polar Stereographic (variant A)" (EPSG:9810) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi-major axis 6378137.0 m semi-minor axis 6356752.314247833 m Latitude of natural origin 90.0° Longitude of natural origin 0.0° Scale factor at natural origin 0.994 False easting 2000000.0 m False northing 2000000.0 m Test points Source ordinates Expected results 0°E
90°N2000000.00 m
2000000.00 m44°E
73°N3320416.75 m
632668.43 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.- See Also:
AuthorityFactoryTest.testEPSG_5041()
,AuthorityFactoryTest.testEPSG_32661()
-
testPolarStereographicB
public void testPolarStereographicB() throws FactoryException, TransformException
Tests the "Polar Stereographic (variant B)" (EPSG:9829) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value Source ordinates Expected results semi-major axis 6378137.0 m semi-minor axis 6356752.314247833 m Latitude of standard parallel -71.0° Longitude of origin 70.0° False easting 6000000.0 m False northing 6000000.0 m Test points Source ordinates Expected results 70°E
90°S6000000.00 m
6000000.00 m120°E
75°S7255380.79 m
7053389.56 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.- See Also:
AuthorityFactoryTest.testEPSG_3032()
-
testPolarStereographicC
public void testPolarStereographicC() throws FactoryException, TransformException
Tests the "Polar Stereographic (variant C)" (EPSG:9830) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value Source ordinates Expected results semi-major axis 6378388.0 m semi-minor axis 6356911.9461279465 m Latitude of standard parallel -67° Longitude of origin 140° False easting 300000 m False northing 200000 m Test points Source ordinates Expected results 67°E
90°S300000.00 m
200000.00 m140°04'17.040"E
66°36'18.820"S303169.52 m
244055.72 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.- See Also:
AuthorityFactoryTest.testEPSG_3032()
-
testObliqueStereographic
public void testObliqueStereographic() throws FactoryException, TransformException
Tests the "Oblique Stereographic" (EPSG:9809) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi-major axis 6377397.155 m semi-minor axis 6356078.9626186555 m Latitude of natural origin 52.15616055555556° Longitude of natural origin 5.38763888888889° Scale factor at natural origin 0.9999079 False easting 155000.0 m False northing 463000.0 m Test points Source ordinates Expected results 5°23'15.500"E
52°09'22.178"N155000.000 m
463000.000 m6°E
53°N196105.283 m
557057.739 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.- See Also:
AuthorityFactoryTest.testEPSG_28992()
-
testPolyconic
public void testPolyconic() throws FactoryException, TransformException
Tests the "American Polyconic" (EPSG:9818) projection. First, this method transforms the some of the points given in Table 19, p 132 of Map Projections, a working manual by John P.Snyder. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi-major axis 6378206.4 m semi-minor axis 6356583.8 m Latitude of natural origin 0.0° Longitude of natural origin 0.0° False easting 0.0 m False northing 0.0 m Test points Source ordinates Expected results See source See source - Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.
-
testKrovak
public void testKrovak() throws FactoryException, TransformException
Tests the "Krovak" (EPSG:9819) projection. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of points in the projection area of validity and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value semi-major axis 6377397.155 m semi-minor axis 6356078.9626186555 m Latitude of projection centre 49.5° Longitude of origin 24.5° Co-latitude of cone axis 30.288139722222222° Latitude of pseudo standard parallel 78.5° Scale factor on pseudo standard parallel 0.9999 False easting 0.0 m False northing 0.0 m Test points Source ordinates Expected results 16°50'59.179"E
50°12'32.442"N-568990.997 m
-1050538.643 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.- See Also:
AuthorityFactoryTest.testEPSG_2065()
-
testAbridgedMolodensky
public void testAbridgedMolodensky() throws FactoryException, TransformException
Tests the "Abridged Molodensky" (EPSG:9605) datum shift operation. First, this method transforms the point given in the Example section of the EPSG guidance note and compares theMathTransform
result with the expected result. Next, this method transforms a random set of geographic coordinates and ensures that the inverse transform and the derivatives are coherent.The math transform parameters and the sample coordinates are:
CRS characteristics Parameter Value dim 3 src_semi_major 6378137.0 m src_semi_minor 6356752.314247833 m X-axis translation 84.87 m Y-axis translation 96.49 m Z-axis translation 116.95 m Semi-major axis length difference 251 m Flattening difference 1.41927E-05 Test points Source ordinates Expected results 2°7'46.380"E
53°48'33.820"N
73.000 m2°7'51.477"E
53°48'36.563"N
28.091 m- Throws:
FactoryException
- if the math transform can not be created.TransformException
- if the example point can not be transformed.
-
assertMatrixEquals
protected void assertMatrixEquals(String message, Matrix expected, Matrix actual, Matrix tolmat) throws DerivativeFailure
Asserts that a matrix of derivatives is equals to the expected ones within a positive delta.- Overrides:
assertMatrixEquals
in classTransformTestCase
- Parameters:
message
- the message to print in case of failure.expected
- the expected matrix of derivative values, estimated by finite differences.actual
- the actual matrix computed by the transform to be tested.tolmat
- the tolerance value for each matrix elements, ornull
for a strict comparison.- Throws:
DerivativeFailure
- if at least one matrix element is not equal to the expected value.- See Also:
TransformTestCase.verifyDerivative(double[])
,Assert.assertMatrixEquals(String, Matrix, Matrix, double)
-
-