Search in sources :

Example 1 with Molodensky

use of org.apache.sis.internal.referencing.provider.Molodensky in project sis by apache.

the class MolodenskyTransformTest method testProvider.

/**
 * Tests the creation through the provider.
 *
 * @throws FactoryException if an error occurred while creating a transform step.
 * @throws TransformException if a transformation failed.
 */
@Test
@DependsOnMethod("testRandomPoints")
public void testProvider() throws FactoryException, TransformException {
    final MathTransformFactory factory = new MathTransformFactoryMock(new Molodensky());
    final ParameterValueGroup parameters = factory.getDefaultParameters("Molodenski");
    parameters.parameter("dim").setValue(3);
    parameters.parameter("dx").setValue(-3.0);
    parameters.parameter("dy").setValue(142.0);
    parameters.parameter("dz").setValue(183.0);
    parameters.parameter("src_semi_major").setValue(6378206.4);
    parameters.parameter("src_semi_minor").setValue(6356583.8);
    parameters.parameter("tgt_semi_major").setValue(6378137.0);
    parameters.parameter("tgt_semi_minor").setValue(6356752.31414036);
    transform = factory.createParameterizedTransform(parameters);
    assertEquals(3, transform.getSourceDimensions());
    assertEquals(3, transform.getTargetDimensions());
    tolerance = Formulas.ANGULAR_TOLERANCE * 5;
    zTolerance = Formulas.LINEAR_TOLERANCE * 5;
    verifyInDomain(CoordinateDomain.RANGE_10, ORDINATE_COUNT);
}
Also used : Molodensky(org.apache.sis.internal.referencing.provider.Molodensky) MathTransformFactory(org.opengis.referencing.operation.MathTransformFactory) ParameterValueGroup(org.opengis.parameter.ParameterValueGroup) GeocentricTranslationTest(org.apache.sis.internal.referencing.provider.GeocentricTranslationTest) Test(org.junit.Test) DependsOnMethod(org.apache.sis.test.DependsOnMethod)

Aggregations

GeocentricTranslationTest (org.apache.sis.internal.referencing.provider.GeocentricTranslationTest)1 Molodensky (org.apache.sis.internal.referencing.provider.Molodensky)1 DependsOnMethod (org.apache.sis.test.DependsOnMethod)1 Test (org.junit.Test)1 ParameterValueGroup (org.opengis.parameter.ParameterValueGroup)1 MathTransformFactory (org.opengis.referencing.operation.MathTransformFactory)1