Class ParameterizedTransformTest

Object
TestCase
TransformTestCase
ParameterizedTransformTest

public class ParameterizedTransformTest extends TransformTestCase
Tests parameterized math transforms from the org.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 a NoSuchIdentifierException during the invocation of one of the following methods:

then the tests is skipped. If any other kind of exception is thrown, or if 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. Implementers can modify the kind of tests being executed and the tolerance threshold in different ways:

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. That example shows also how implementers 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 the MathTransform2D 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:
  • Field Details

    • mtFactory

      protected final MathTransformFactory mtFactory
      The factory for creating MathTransform objects, or null if none.
    • parameters

      protected ParameterValueGroup parameters
      The parameters of the math transform being tested. This field is set, together with the transform field, during the execution of every testFoo() 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.

    • 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.
  • Constructor Details

    • ParameterizedTransformTest

      public ParameterizedTransformTest(MathTransformFactory factory)
      Creates a new test using the given factory. If the given factory is null, then the tests will be skipped.
      Parameters:
      factory - factory for creating MathTransform instances.
  • Method Details

    • 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 of subclassed by the implementer. The factories are fetched as documented in the TestCase.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:
      Overrides:
      configuration in class TransformTestCase
      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.
    • 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 the MathTransform 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 coordinates Expected results
      120°E
      3°S
      5009726.58 m
      569150.82 m
      110°E
      0°N
      3900000.00 m
      900000.00 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
      See Also:
    • 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 the MathTransform 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 coordinates Expected results
      53°E
      53°N
      165704.29 m
      5171848.07 m
      51°E
      0°N
      0.00 m
      0.00 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
      See Also:
    • 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 the MathTransform 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 coordinates Expected results
      53°E
      53°N
      165704.29 m
      1351950.22 m
      51°E
      42°N
      0.00 m
      0.00 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot 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 the MathTransform 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 coordinates Expected results
      100°20'00.000"W
      24°22'54.433"N
      -11156569.90 m
      2796869.94 m
      0°E
      0°N
      0.00 m
      0.00 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot 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 the MathTransform 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 coordinates Expected results
      100°20'00.000"W
      24°22'54.433"N
      -11169055.58 m
      2800000.00 m
      0°E
      0°N
      0.00 m
      0.00 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
      See Also:
    • testMiller

      public void testMiller() throws FactoryException, TransformException
      Tests the "IGNF:MILLER" projection. First, this method transforms the point given below and compares the MathTransform 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 coordinates Expected results
      2.478917°E
      48.805639°N
      275951.78 m
      5910061.78 m
      0°E
      0°N
      0.00 m
      0.00 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
    • 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 the MathTransform 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 coordinates Expected results
      115°48'19.8196"E
      5°23'14.1129"N
      679245.73 m
      596562.78 m
      115°E
      4°N
      590476.87 m
      442857.65 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
      See Also:
    • 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 the MathTransform 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 coordinates Expected results
      00°30'E
      50°30'N
      577274.98 m
      69740.49 m
      2°W
      49°N
      400000.00 m
      -100000.00 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
      See Also:
    • 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 the MathTransform 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
      Longitude of natural origin 29°
      Scale factor at natural origin 1
      False easting 0 m
      False northing 0 m
      Test points
      Source coordinates Expected results
      28°16'57.479"E
      25°43'55.302"S
      71984.48 m
      2847342.74 m
      20°E
      0°S
      0 m
      0 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot 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 the MathTransform 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 coordinates Expected results
      60°00'00"W
      10°00'00"N
      66644.94 links
      82536.22 links
      61°20'00"W
      10°26'30"N
      430000.00 links
      325000.00 links

      1 link = 0.66 feet
      1 feet = 0.3048 metre

      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
      See Also:
    • testHyperbolicCassiniSoldner

      public void testHyperbolicCassiniSoldner() throws FactoryException, TransformException
      Tests the "Hyperbolic Cassini-Soldner" (EPSG:9833) projection method. First, this method transforms the point given in the Example section of the EPSG guidance note and compares the MathTransform 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 6378306.3696 m
      semi-minor axis 6356571.9960 m
      Latitude of natural origin -16.25°
      Longitude of natural origin 179.33333333333333°
      False easting 251727.9155424 m
      False northing 334519.9537680 m
      Test points
      Source coordinates Expected results
      179°59′39.6115″E
      16°50′29.2435″S
      1601528.90 links
      1336966.01 links
      16°15'00"S
      179°20'00"E
      41251331.8 links
      1662888.5 links

      1 link = 0.66 feet
      1 feet = 0.3048 metre

      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
      See Also:
    • 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 the MathTransform 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 coordinates Expected results
      76°56'37.26"W
      17°55'55.80"N
      255966.58 m
      142493.51 m
      77°W
      18°N
      250000.00 m
      150000.00 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
      See Also:
    • 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 the MathTransform 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 coordinates Expected results
      96°00'W
      28°30'N
      2963503.91 US feet
      254759.80 US feet
      99°00'W
      27°30'N
      2000000.00 US feet
      0 US feet

      1 metre = 3.2808333… US feet

      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
      See Also:
    • 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 the MathTransform 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 coordinates Expected results
      5°48'26.533"E
      50°40'46.461"N
      251763.20 m
      153034.13 m
      4°21'24.983"E
      90°00'00.000"N
      150000.01 m
      5400088.44 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
      See Also:
    • 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 the MathTransform 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 coordinates Expected results
      83°10"W
      43°45'N
      2308335.75 US feet
      160210.48 US feet
      84°20'W
      43°19'N
      2000000.00 US feet
      0 US feet

      1 metre = 3.2808333… US feet

      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot 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 the MathTransform 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 coordinates Expected results
      5°E
      50°N
      3962799.45 m
      2999718.85 m
      10°E
      52°N
      4321000.00 m
      3210000.00 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
      See Also:
    • 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 the MathTransform 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 coordinates Expected results
      44°E
      73°N
      3320416.75 m
      632668.43 m
      0°E
      90°N
      2000000.00 m
      2000000.00 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
      See Also:
    • 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 the MathTransform 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 coordinates 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 coordinates Expected results
      120°E
      75°S
      7255380.79 m
      7053389.56 m
      70°E
      90°S
      6000000.00 m
      6000000.00 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
      See Also:
    • 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 the MathTransform 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 coordinates 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 coordinates Expected results
      140°04'17.040"E
      66°36'18.820"S
      303169.52 m
      244055.72 m
      67°E
      90°S
      300000.00 m
      200000.00 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
      See Also:
    • 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 the MathTransform 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 coordinates Expected results
      6°E
      53°N
      196105.283 m
      557057.739 m
      5°23'15.500"E
      52°09'22.178"N
      155000.000 m
      463000.000 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
      See Also:
    • 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 coordinates Expected results
      See source See source
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot 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 the MathTransform 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 coordinates Expected results
      16°50'59.179"E
      50°12'32.442"N
      -568990.997 m
      -1050538.643 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
      See Also:
    • testOrthographic

      public void testOrthographic() throws FactoryException, TransformException
      Tests the "Orthographic" (EPSG:9840) projection. First, this method transforms the point given in the Example section of the EPSG guidance note and compares the MathTransform 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 55.0°
      Longitude of natural origin 5.0°
      False easting 0.0 m
      False northing 0.0 m
      Test points
      Source coordinates Expected results
      2°07'46.38"E
      53°48'33.82"N
      –189011.711 m
      –128 640.567 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
    • testModifiedAzimuthalEquidistant

      public void testModifiedAzimuthalEquidistant() throws FactoryException, TransformException
      Tests the "Modified Azimuthal Equidistant" (EPSG:9832) projection. First, this method transforms the point given in the Example section of the EPSG guidance note and compares the MathTransform 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 9.546708333333333°
      Longitude of natural origin 138.168744444444444°
      False easting 40000.0 m
      False northing 60000.0 m
      Test points
      Source coordinates Expected results
      138°11'34.908"E
      9°35'47.493"N
      42665.90 m
      65509.82 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
    • 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 the MathTransform 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:

      Conversion 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 coordinates Expected results
      2°7'46.380"E
      53°48'33.820"N
      73.000 m
      2°7'51.477"E
      53°48'36.563"N
      28.091 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
    • testGeographicTopocentric

      public void testGeographicTopocentric() throws FactoryException, TransformException
      Tests the "Geographic/topocentric conversions" (EPSG:9837). This method transforms the point given in the Example section of the EPSG guidance note and compares the MathTransform result with the expected result.

      A CRS using this method is "EPSG topocentric example A" (EPSG:5819)". The math transform parameters and the sample coordinates are:

      Conversion characteristics
      Parameter Value
      semi_major 6378137.0 m
      semi_minor 6356752.314245179 m
      Latitude of topocentric origin 55°00'00.000"N
      Longitude of topocentric origin 5°00'00.000"E
      Ellipsoidal height of topocentric origin 200 m
      Test points
      Source coordinates Expected results
      2°07'46.38"E
      53°48'33.82"N
      73.0 m
      –189013.869 m
      –128642.040 m
      –4220.171 m
      5°00'00.000"E
      55°00'00.000"N
      200 m
      0 m
      0 m
      0 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
    • testGeocentricTopocentric

      public void testGeocentricTopocentric() throws FactoryException, TransformException
      Tests the "Geocentric/topocentric conversions" (EPSG:9836). This method transforms the point given in the Example section of the EPSG guidance note and compares the MathTransform result with the expected result.

      A CRS using this method is "EPSG topocentric example B" (EPSG:5820)". The math transform parameters and the sample coordinates are:

      Conversion characteristics
      Parameter Value
      semi_major 6378137.0 m
      semi_minor 6356752.314245179 m
      Geocentric X of topocentric origin 3652755.3058 m
      Geocentric Y of topocentric origin 319574.6799 m
      Geocentric Z of topocentric origin 5201547.3536 m
      Test points
      Source coordinates Expected results
      3771793.968 m
      140253.342 m
      5124304.349 m
      –189013.869 m
      –128642.040 m
      –4220.171 m
      3652755.3058 m
      319574.6799 m
      5201547.3536 m
      0 m
      0 m
      0 m
      Throws:
      FactoryException - if the math transform cannot be created.
      TransformException - if the example point cannot be transformed.
    • assertMatrixEquals

      protected void assertMatrixEquals(String message, Matrix expected, Matrix actual, Matrix tolmat) throws DerivativeFailure
      Asserts that a matrix of derivatives is equal to the expected ones within a positive delta.
      Overrides:
      assertMatrixEquals in class TransformTestCase
      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, or null for a strict comparison.
      Throws:
      DerivativeFailure - if at least one matrix element is not equal to the expected value.
      See Also: