/** * Verifies the consistency of elliptical formulas with the spherical formulas. * This test compares the results of elliptical formulas with the spherical ones * for some random points. * * @throws FactoryException if an error occurred while creating the map projection. * @throws TransformException if an error occurred while projecting a coordinate. */ @Test @DependsOnMethod({"testSphericalCaseSouth", "testSphericalCaseNorth"}) public void compareEllipticalWithSpherical() throws FactoryException, TransformException { compareEllipticalWithSpherical(CoordinateDomain.GEOGRAPHIC_SOUTH_POLE, -90, 17326686); compareEllipticalWithSpherical(CoordinateDomain.GEOGRAPHIC_NORTH_POLE, +90, 970559366); } }
/** * Verifies the consistency of elliptical formulas with the spherical formulas. * This test compares the results of elliptical formulas with the spherical ones * for some random points. * * @throws FactoryException if an error occurred while creating the map projection. * @throws TransformException if an error occurred while projecting a coordinate. */ private void compareEllipticalWithSpherical(final CoordinateDomain domain, final double latitudeOfOrigin, final long randomSeed) throws FactoryException, TransformException { createCompleteProjection(new PolarStereographicA(), 6371007, // Semi-major axis length 6371007, // Semi-minor axis length 0.5, // Central meridian latitudeOfOrigin, // Latitude of origin NaN, // Standard parallel 1 (none) NaN, // Standard parallel 2 (none) 0.994, // Scale factor 200, // False easting 100); // False northing tolerance = Formulas.LINEAR_TOLERANCE; compareEllipticalWithSpherical(domain, randomSeed); }