001/*
002 *    GeoAPI - Java interfaces for OGC/ISO standards
003 *    http://www.geoapi.org
004 *
005 *    Copyright (C) 2011-2019 Open Geospatial Consortium, Inc.
006 *    All Rights Reserved. http://www.opengeospatial.org/ogc/legal
007 *
008 *    Permission to use, copy, and modify this software and its documentation, with
009 *    or without modification, for any purpose and without fee or royalty is hereby
010 *    granted, provided that you include the following on ALL copies of the software
011 *    and documentation or portions thereof, including modifications, that you make:
012 *
013 *    1. The full text of this NOTICE in a location viewable to users of the
014 *       redistributed or derivative work.
015 *    2. Notice of any changes or modifications to the OGC files, including the
016 *       date changes were made.
017 *
018 *    THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE
019 *    NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
020 *    TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
021 *    THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
022 *    PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
023 *
024 *    COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
025 *    CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
026 *
027 *    The name and trademarks of copyright holders may NOT be used in advertising or
028 *    publicity pertaining to the software without specific, written prior permission.
029 *    Title to copyright in this software and any associated documentation will at all
030 *    times remain with copyright holders.
031 */
032package org.opengis.test.referencing.gigs;
033
034import java.util.List;
035import javax.measure.Unit;
036import javax.measure.quantity.Length;
037
038import org.opengis.util.Factory;
039import org.opengis.util.FactoryException;
040import org.opengis.referencing.datum.DatumAuthorityFactory;
041import org.opengis.referencing.NoSuchAuthorityCodeException;
042import org.opengis.referencing.datum.Ellipsoid;
043import org.opengis.test.Configuration;
044import org.opengis.test.FactoryFilter;
045
046import org.junit.Test;
047import org.junit.runner.RunWith;
048import org.junit.runners.Parameterized;
049
050import static org.junit.Assume.*;
051import static org.junit.Assert.*;
052
053
054/**
055 * Verifies reference ellipsoid parameters bundled with the geoscience software.
056 *
057 * <table class="gigs" summary="Test description"><tr>
058 *   <th>Test method:</th>
059 *   <td>Compare ellipsoid definitions included in the software against the EPSG Dataset.</td>
060 * </tr><tr>
061 *   <th>Test data:</th>
062 *   <td><a href="doc-files/GIGS_2002_libEllipsoid.csv">{@code GIGS_2002_libEllipsoid.csv}</a>
063 *   and EPSG Dataset.
064 *   Contains EPSG {@linkplain #code code} and {@linkplain #name name} for the ellipsoid,
065 *   commonly encountered {@linkplain #aliases alternative name(s)} for the same object,
066 *   the value and units for the {@link #semiMajorAxis semi-major axis},
067 *   the conversion ratio to metres for these units, and then a second parameter which will be either
068 *   the value of the {@linkplain #inverseFlattening inverse flattening} (unitless) or
069 *   the value of the {@link #semiMinorAxis semi-minor axis} (in the same units as the semi-major axis).
070 *   This class additionally contain a flag to indicate that the figure {@linkplain #isSphere is a sphere}:
071 *   if {@code false} the figure is an oblate ellipsoid.</td>
072 * </tr><tr>
073 *   <th>Tested API:</th>
074 *   <td>{@link DatumAuthorityFactory#createEllipsoid(String)}.</td>
075 * </tr><tr>
076 *   <th>Expected result:</th>
077 *   <td>Ellipsoid definitions bundled with software, if any, should have same name and defining parameters
078 *   as in the EPSG Dataset. Equivalent alternative parameters are acceptable but should be reported.
079 *   The values of the parameters should be correct to at least 10 significant figures.
080 *   For ellipsoids defined by Clarke and Everest, as well as those adopted by IUGG as International,
081 *   several variants exist. These must be clearly distinguished.
082 *   Ellipsoids missing from the software or at variance with those in the EPSG Dataset should be reported.</td>
083 * </tr></table>
084 *
085 *
086 * <div class="note"><b>Usage example:</b>
087 * in order to specify their factories and run the tests in a JUnit framework, implementors can
088 * define a subclass in their own test suite as in the example below:
089 *
090 * <blockquote><pre>import org.junit.runner.RunWith;
091 *import org.junit.runners.JUnit4;
092 *import org.opengis.test.referencing.gigs.GIGS2002;
093 *
094 *&#64;RunWith(JUnit4.class)
095 *public class MyTest extends GIGS2002 {
096 *    public MyTest() {
097 *        super(new MyDatumAuthorityFactory());
098 *    }
099 *}</pre></blockquote>
100 * </div>
101 *
102 * @author  GIGS (IOGP)
103 * @author  Martin Desruisseaux (Geomatys)
104 * @author  Alexis Manin (Geomatys)
105 * @version 3.1
106 * @since   3.1
107 */
108@RunWith(Parameterized.class)
109public strictfp class GIGS2002 extends AuthorityFactoryTestCase<Ellipsoid> {
110    /**
111     * The conversion factor from the unit of {@link #semiMajorAxis} to metres.
112     */
113    private double toMetres;
114
115    /**
116     * The {@link #semiMajorAxis} value converted to a length in metres.
117     */
118    private double semiMajorInMetres;
119
120    /**
121     * The expected semi-major axis length, in the units specified by the EPSG dataset.
122     * This value can also be obtained as a length in metres by a call to the {@link #getSemiMajorAxis(boolean)} method.
123     *
124     * @see #getSemiMajorAxis(boolean)
125     */
126    public double semiMajorAxis;
127
128    /**
129     * The expected semi-minor axis length, or {@link Double#NaN} if the second defining parameters is not this field.
130     * If not {@code NaN}, the value is in the same units than {@link #semiMajorAxis}.
131     * This value can be obtained as a length in metres by a call to the {@link #getSemiMinorAxis(boolean)} method.
132     *
133     * @see #getSemiMinorAxis(boolean)
134     */
135    public double semiMinorAxis;
136
137    /**
138     * The expected inverse flattening, or {@link Double#NaN} if the second defining parameters is not this field.
139     */
140    public double inverseFlattening;
141
142    /**
143     * Indicates if the figure of the Earth is a sphere.
144     * If {@code false} the figure is an oblate ellipsoid.
145     */
146    public boolean isSphere;
147
148    /**
149     * The ellipsoid created by the factory,
150     * or {@code null} if not yet created or if the ellipsoid creation failed.
151     *
152     * @see #datumAuthorityFactory
153     */
154    private Ellipsoid ellipsoid;
155
156    /**
157     * Factory to use for building {@link Ellipsoid} instances, or {@code null} if none.
158     * This is the factory used by the {@link #getIdentifiedObject()} method.
159     */
160    protected final DatumAuthorityFactory datumAuthorityFactory;
161
162    /**
163     * Returns a default set of factories to use for running the tests. Those factories are given
164     * in arguments to the constructor when this test class is instantiated directly by JUnit (for
165     * example as a {@linkplain org.junit.runners.Suite.SuiteClasses suite} element), instead than
166     * subclassed by the implementor. The factories are fetched as documented in the
167     * {@link #factories(Class[])} javadoc.
168     *
169     * @return the default set of arguments to be given to the {@code GIGS2002} constructor.
170     */
171    @Parameterized.Parameters
172    @SuppressWarnings("unchecked")
173    public static List<Factory[]> factories() {
174        return factories(FactoryFilter.ByAuthority.EPSG, DatumAuthorityFactory.class);
175    }
176
177    /**
178     * Creates a new test using the given factory. If a given factory is {@code null},
179     * then the tests which depend on it will be skipped.
180     *
181     * @param datumFactory  factory for creating {@link Ellipsoid} instances.
182     */
183    public GIGS2002(final DatumAuthorityFactory datumFactory) {
184        super(datumFactory);
185        datumAuthorityFactory = datumFactory;
186    }
187
188    /**
189     * Returns information about the configuration of the test which has been run.
190     * This method returns a map containing:
191     *
192     * <ul>
193     *   <li>All the following values associated to the {@link org.opengis.test.Configuration.Key} of the same name:
194     *     <ul>
195     *       <li>{@link #isStandardNameSupported}</li>
196     *       <li>{@link #isStandardAliasSupported}</li>
197     *       <li>{@link #isDependencyIdentificationSupported}</li>
198     *       <li>{@link #datumAuthorityFactory}</li>
199     *     </ul>
200     *   </li>
201     * </ul>
202     *
203     * @return the configuration of the test being run.
204     */
205    @Override
206    public Configuration configuration() {
207        final Configuration op = super.configuration();
208        assertNull(op.put(Configuration.Key.datumAuthorityFactory, datumAuthorityFactory));
209        return op;
210    }
211
212    /**
213     * Returns the ellipsoid instance to be tested. When this method is invoked for the first time, it creates the
214     * ellipsoid to test by invoking the {@link DatumAuthorityFactory#createEllipsoid(String)} method with the current
215     * {@link #code} value in argument. The created object is then cached and returned in all subsequent invocations of
216     * this method.
217     *
218     * @return the ellipsoid instance to test.
219     * @throws FactoryException if an error occurred while creating the ellipsoid instance.
220     */
221    @Override
222    public Ellipsoid getIdentifiedObject() throws FactoryException {
223        if (ellipsoid == null) {
224            assumeNotNull(datumAuthorityFactory);
225            try {
226                ellipsoid = datumAuthorityFactory.createEllipsoid(String.valueOf(code));
227            } catch (NoSuchAuthorityCodeException e) {
228                unsupportedCode(Ellipsoid.class, code);
229                throw e;
230            }
231        }
232        return ellipsoid;
233    }
234
235    /**
236     * Returns the length of the semi-major axis, either in the units specified by the EPSG dataset or in metres.
237     *
238     * @param  inMetres {@code true} for the length in metres.
239     * @return the semi-major axis length, guaranteed to be in metres if {@code inMetres} is {@code true}.
240     *
241     * @see #semiMajorAxis
242     */
243    public double getSemiMajorAxis(final boolean inMetres) {
244        assertEquals("Inconsistent semi-major axis length in metres.", semiMajorInMetres, semiMajorAxis*toMetres, 0.01);
245        return inMetres ? semiMajorInMetres : semiMajorAxis;
246    }
247
248    /**
249     * Returns the length of the semi-minor axis, either in the units specified by the EPSG dataset or in metres.
250     * This method can be invoked only if the semi-minor axis length is the second defining parameter.
251     *
252     * @param  inMetres {@code true} for the length in metres.
253     * @return the semi-minor axis length, guaranteed to be in metres if {@code inMetres} is {@code true}.
254     *
255     * @see #semiMinorAxis
256     */
257    public double getSemiMinorAxis(final boolean inMetres) {
258        double value = semiMinorAxis;
259        assertFalse("Semi-minor axis length is not the second defining parameter.", Double.isNaN(value));
260        if (inMetres) {
261            semiMinorAxis *= toMetres;
262        }
263        return value;
264    }
265
266    /**
267     * Verifies the properties of the ellipsoid given by {@link #getIdentifiedObject()}.
268     */
269    private void verifyEllipsoid() throws FactoryException {
270        final Ellipsoid ellipsoid = getIdentifiedObject();
271        assertNotNull("Ellipsoid", ellipsoid);
272        validators.validate(ellipsoid);
273
274        // Ellipsoid identifier.
275        assertContainsCode("Ellipsoid.getIdentifiers()", "EPSG", code, ellipsoid.getIdentifiers());
276
277        // Ellipsoid name.
278        if (isStandardNameSupported) {
279            configurationTip = Configuration.Key.isStandardNameSupported;
280            assertEquals("Ellipsoid.getName()", name, getVerifiableName(ellipsoid));
281            configurationTip = null;
282        }
283
284        // Ellipsoid alias.
285        if (isStandardAliasSupported) {
286            configurationTip = Configuration.Key.isStandardAliasSupported;
287            assertContainsAll("Ellipsoid.getAlias()", aliases, ellipsoid.getAlias());
288            configurationTip = null;
289        }
290        /*
291         * Get the axis lengths and their unit. Null units are assumed to mean metres
292         * (whether we accept null unit or not is determined by the validators).
293         * If the implementation uses metre units but the EPSG definition expected
294         * another unit, convert the axis lengths from the later units to metre units.
295         */
296        final Unit<Length> unit = ellipsoid.getAxisUnit();
297        final boolean inMetres = toMetres != 1 && (unit == null || unit.equals(units.metre()));
298        double expectedAxisLength = getSemiMajorAxis(inMetres);
299        assertEquals("Ellipsoid.getSemiMajorAxis()",
300                expectedAxisLength, ellipsoid.getSemiMajorAxis(), TOLERANCE*expectedAxisLength);
301
302        if (!Double.isNaN(semiMinorAxis)) {
303            expectedAxisLength = getSemiMinorAxis(inMetres);
304            assertEquals("Ellipsoid.getSemiMinorAxis()", expectedAxisLength,
305                    ellipsoid.getSemiMinorAxis(), TOLERANCE*expectedAxisLength);
306        }
307        if (!Double.isNaN(inverseFlattening)) {
308            assertEquals("Ellipsoid.getInverseFlattening()", inverseFlattening,
309                    ellipsoid.getInverseFlattening(), TOLERANCE*inverseFlattening);
310        }
311        assertEquals("Ellipsoid.isSphere()", isSphere, ellipsoid.isSphere());
312    }
313
314    /**
315     * Tests “Airy 1830” ellipsoid creation from the factory.
316     *
317     * <ul>
318     *   <li>EPSG ellipsoid code: <b>7001</b></li>
319     *   <li>EPSG ellipsoid name: <b>Airy 1830</b></li>
320     *   <li>Semi-major axis (<var>a</var>): <b>6377563.396</b></li>
321     *   <li>Inverse flattening (1/<var>f</var>): <b>299.3249646</b></li>
322     *   <li>Particularly important to E&amp;P industry.</li>
323     * </ul>
324     *
325     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
326     *
327     * @see GIGS3002#testAiry()
328     */
329    @Test
330    public void testAiry() throws FactoryException {
331        important         = true;
332        code              = 7001;
333        name              = "Airy 1830";
334        aliases           = NONE;
335        toMetres          = 1.0;
336        semiMajorInMetres = 6377563.396;
337        semiMajorAxis     = 6377563.396;
338        semiMinorAxis     = Double.NaN;
339        inverseFlattening = 299.3249646;
340        verifyEllipsoid();
341    }
342
343    /**
344     * Tests “Airy Modified 1849” ellipsoid creation from the factory.
345     *
346     * <ul>
347     *   <li>EPSG ellipsoid code: <b>7002</b></li>
348     *   <li>EPSG ellipsoid name: <b>Airy Modified 1849</b></li>
349     *   <li>Semi-major axis (<var>a</var>): <b>6377340.189</b></li>
350     *   <li>Inverse flattening (1/<var>f</var>): <b>299.3249646</b></li>
351     *   <li>Particularly important to E&amp;P industry.</li>
352     * </ul>
353     *
354     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
355     */
356    @Test
357    public void testAiryModified() throws FactoryException {
358        important         = true;
359        code              = 7002;
360        name              = "Airy Modified 1849";
361        aliases           = NONE;
362        toMetres          = 1.0;
363        semiMajorInMetres = 6377340.189;
364        semiMajorAxis     = 6377340.189;
365        semiMinorAxis     = Double.NaN;
366        inverseFlattening = 299.3249646;
367        verifyEllipsoid();
368    }
369
370    /**
371     * Tests “Australian National Spheroid” ellipsoid creation from the factory.
372     *
373     * <ul>
374     *   <li>EPSG ellipsoid code: <b>7003</b></li>
375     *   <li>EPSG ellipsoid name: <b>Australian National Spheroid</b></li>
376     *   <li>Alias(es) given by EPSG: <b>ANS</b></li>
377     *   <li>Semi-major axis (<var>a</var>): <b>6378160</b></li>
378     *   <li>Inverse flattening (1/<var>f</var>): <b>298.25</b></li>
379     *   <li>Particularly important to E&amp;P industry.</li>
380     * </ul>
381     *
382     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
383     *
384     * @see GIGS3002#testAustralianNationalSpheroid()
385     */
386    @Test
387    public void testAustralianNationalSpheroid() throws FactoryException {
388        important         = true;
389        code              = 7003;
390        name              = "Australian National Spheroid";
391        aliases           = new String[] {"ANS"};
392        toMetres          = 1.0;
393        semiMajorInMetres = 6378160.0;
394        semiMajorAxis     = 6378160.0;
395        semiMinorAxis     = Double.NaN;
396        inverseFlattening = 298.25;
397        verifyEllipsoid();
398    }
399
400    /**
401     * Tests “Bessel 1841” ellipsoid creation from the factory.
402     *
403     * <ul>
404     *   <li>EPSG ellipsoid code: <b>7004</b></li>
405     *   <li>EPSG ellipsoid name: <b>Bessel 1841</b></li>
406     *   <li>Semi-major axis (<var>a</var>): <b>6377397.155</b></li>
407     *   <li>Inverse flattening (1/<var>f</var>): <b>299.1528128</b></li>
408     *   <li>Particularly important to E&amp;P industry.</li>
409     * </ul>
410     *
411     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
412     *
413     * @see GIGS3002#testBessel()
414     */
415    @Test
416    public void testBessel() throws FactoryException {
417        important         = true;
418        code              = 7004;
419        name              = "Bessel 1841";
420        aliases           = NONE;
421        toMetres          = 1.0;
422        semiMajorInMetres = 6377397.155;
423        semiMajorAxis     = 6377397.155;
424        semiMinorAxis     = Double.NaN;
425        inverseFlattening = 299.1528128;
426        verifyEllipsoid();
427    }
428
429    /**
430     * Tests “Bessel Namibia (GLM)” ellipsoid creation from the factory.
431     *
432     * <ul>
433     *   <li>EPSG ellipsoid code: <b>7046</b></li>
434     *   <li>EPSG ellipsoid name: <b>Bessel Namibia (GLM)</b></li>
435     *   <li>Semi-major axis (<var>a</var>): <b>6377397.155</b></li>
436     *   <li>Inverse flattening (1/<var>f</var>): <b>299.1528128</b></li>
437     *   <li>Particularly important to E&amp;P industry.</li>
438     * </ul>
439     *
440     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
441     */
442    @Test
443    public void testBesselNamibia() throws FactoryException {
444        important         = true;
445        code              = 7046;
446        name              = "Bessel Namibia (GLM)";
447        aliases           = NONE;
448        toMetres          = 1.000013597;
449        semiMajorInMetres = 6377483.865;
450        semiMajorAxis     = 6377397.155;
451        semiMinorAxis     = Double.NaN;
452        inverseFlattening = 299.1528128;
453        verifyEllipsoid();
454    }
455
456    /**
457     * Tests “Clarke 1858” ellipsoid creation from the factory.
458     *
459     * <ul>
460     *   <li>EPSG ellipsoid code: <b>7007</b></li>
461     *   <li>EPSG ellipsoid name: <b>Clarke 1858</b></li>
462     *   <li>Semi-major axis (<var>a</var>): <b>20926348</b></li>
463     *   <li>Semi-minor axis (<var>b</var>): <b>20855233</b></li>
464     *   <li>Particularly important to E&amp;P industry.</li>
465     * </ul>
466     *
467     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
468     */
469    @Test
470    public void testClarke1858() throws FactoryException {
471        important         = true;
472        code              = 7007;
473        name              = "Clarke 1858";
474        aliases           = NONE;
475        toMetres          = 0.304797265;
476        semiMajorInMetres = 6378293.645;
477        semiMajorAxis     = 20926348.0;
478        semiMinorAxis     = 20855233.0;
479        inverseFlattening = Double.NaN;
480        verifyEllipsoid();
481    }
482
483    /**
484     * Tests “Clarke 1866” ellipsoid creation from the factory.
485     *
486     * <ul>
487     *   <li>EPSG ellipsoid code: <b>7008</b></li>
488     *   <li>EPSG ellipsoid name: <b>Clarke 1866</b></li>
489     *   <li>Semi-major axis (<var>a</var>): <b>6378206.4</b></li>
490     *   <li>Semi-minor axis (<var>b</var>): <b>6356583.8</b></li>
491     *   <li>Particularly important to E&amp;P industry.</li>
492     * </ul>
493     *
494     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
495     *
496     * @see GIGS3002#testClarke1866()
497     */
498    @Test
499    public void testClarke1866() throws FactoryException {
500        important         = true;
501        code              = 7008;
502        name              = "Clarke 1866";
503        aliases           = NONE;
504        toMetres          = 1.0;
505        semiMajorInMetres = 6378206.4;
506        semiMajorAxis     = 6378206.4;
507        semiMinorAxis     = 6356583.8;
508        inverseFlattening = Double.NaN;
509        verifyEllipsoid();
510    }
511
512    /**
513     * Tests “Clarke 1866 Michigan” ellipsoid creation from the factory <em>(deprecated)</em>.
514     * This is test is executed only if {@link #isDeprecatedObjectCreationSupported} is {@code true}.
515     *
516     * <ul>
517     *   <li>EPSG ellipsoid code: <b>7009</b></li>
518     *   <li>EPSG ellipsoid name: <b>Clarke 1866 Michigan</b></li>
519     *   <li>Semi-major axis (<var>a</var>): <b>20926631.531</b></li>
520     *   <li>Semi-minor axis (<var>b</var>): <b>20855688.674</b></li>
521     *   <li><b>Deprecated:</b> Ellipsoid scaling moved from datum to map projection to accord with NGS practice.</li>
522     * </ul>
523     *
524     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
525     */
526    @Test
527    public void testClarkeMichigan() throws FactoryException {
528        important         = true;
529        code              = 7009;
530        name              = "Clarke 1866 Michigan";
531        aliases           = NONE;
532        toMetres          = 0.30480061;
533        semiMajorInMetres = 6378450.048;
534        semiMajorAxis     = 20926631.531;
535        semiMinorAxis     = 20855688.674;
536        inverseFlattening = Double.NaN;
537        assumeTrue("Creation of deprecated objects not supported.", isDeprecatedObjectCreationSupported);
538        verifyEllipsoid();
539    }
540
541    /**
542     * Tests “Clarke 1880 (IGN)” ellipsoid creation from the factory.
543     *
544     * <ul>
545     *   <li>EPSG ellipsoid code: <b>7011</b></li>
546     *   <li>EPSG ellipsoid name: <b>Clarke 1880 (IGN)</b></li>
547     *   <li>Semi-major axis (<var>a</var>): <b>6378249.2</b></li>
548     *   <li>Semi-minor axis (<var>b</var>): <b>6356515</b></li>
549     *   <li>Particularly important to E&amp;P industry.</li>
550     * </ul>
551     *
552     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
553     *
554     * @see GIGS3002#testClarkeIGN()
555     */
556    @Test
557    public void testClarkeIGN() throws FactoryException {
558        important         = true;
559        code              = 7011;
560        name              = "Clarke 1880 (IGN)";
561        aliases           = NONE;
562        toMetres          = 1.0;
563        semiMajorInMetres = 6378249.2;
564        semiMajorAxis     = 6378249.2;
565        semiMinorAxis     = 6356515.0;
566        inverseFlattening = Double.NaN;
567        verifyEllipsoid();
568    }
569
570    /**
571     * Tests “Clarke 1880 (RGS)” ellipsoid creation from the factory.
572     *
573     * <ul>
574     *   <li>EPSG ellipsoid code: <b>7012</b></li>
575     *   <li>EPSG ellipsoid name: <b>Clarke 1880 (RGS)</b></li>
576     *   <li>Alias(es) given by EPSG: <b>Clarke Modified 1880</b></li>
577     *   <li>Semi-major axis (<var>a</var>): <b>6378249.145</b></li>
578     *   <li>Inverse flattening (1/<var>f</var>): <b>293.465</b></li>
579     *   <li>Particularly important to E&amp;P industry.</li>
580     * </ul>
581     *
582     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
583     */
584    @Test
585    public void testClarkeRGS() throws FactoryException {
586        important         = true;
587        code              = 7012;
588        name              = "Clarke 1880 (RGS)";
589        aliases           = new String[] {"Clarke Modified 1880"};
590        toMetres          = 1.0;
591        semiMajorInMetres = 6378249.145;
592        semiMajorAxis     = 6378249.145;
593        semiMinorAxis     = Double.NaN;
594        inverseFlattening = 293.465;
595        verifyEllipsoid();
596    }
597
598    /**
599     * Tests “Everest 1830 (1937 Adjustment)” ellipsoid creation from the factory.
600     *
601     * <ul>
602     *   <li>EPSG ellipsoid code: <b>7015</b></li>
603     *   <li>EPSG ellipsoid name: <b>Everest 1830 (1937 Adjustment)</b></li>
604     *   <li>Semi-major axis (<var>a</var>): <b>6377276.345</b></li>
605     *   <li>Inverse flattening (1/<var>f</var>): <b>300.8017</b></li>
606     *   <li>Particularly important to E&amp;P industry.</li>
607     * </ul>
608     *
609     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
610     */
611    @Test
612    public void testEverest1937() throws FactoryException {
613        important         = true;
614        code              = 7015;
615        name              = "Everest 1830 (1937 Adjustment)";
616        aliases           = NONE;
617        toMetres          = 1.0;
618        semiMajorInMetres = 6377276.345;
619        semiMajorAxis     = 6377276.345;
620        semiMinorAxis     = Double.NaN;
621        inverseFlattening = 300.8017;
622        verifyEllipsoid();
623    }
624
625    /**
626     * Tests “Everest 1830 (1962 Definition)” ellipsoid creation from the factory.
627     *
628     * <ul>
629     *   <li>EPSG ellipsoid code: <b>7044</b></li>
630     *   <li>EPSG ellipsoid name: <b>Everest 1830 (1962 Definition)</b></li>
631     *   <li>Semi-major axis (<var>a</var>): <b>6377301.243</b></li>
632     *   <li>Inverse flattening (1/<var>f</var>): <b>300.8017255</b></li>
633     *   <li>Particularly important to E&amp;P industry.</li>
634     * </ul>
635     *
636     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
637     */
638    @Test
639    public void testEverest1962() throws FactoryException {
640        important         = true;
641        code              = 7044;
642        name              = "Everest 1830 (1962 Definition)";
643        aliases           = NONE;
644        toMetres          = 1.0;
645        semiMajorInMetres = 6377301.243;
646        semiMajorAxis     = 6377301.243;
647        semiMinorAxis     = Double.NaN;
648        inverseFlattening = 300.8017255;
649        verifyEllipsoid();
650    }
651
652    /**
653     * Tests “Everest 1830 (1967 Definition)” ellipsoid creation from the factory.
654     *
655     * <ul>
656     *   <li>EPSG ellipsoid code: <b>7016</b></li>
657     *   <li>EPSG ellipsoid name: <b>Everest 1830 (1967 Definition)</b></li>
658     *   <li>Semi-major axis (<var>a</var>): <b>6377298.556</b></li>
659     *   <li>Inverse flattening (1/<var>f</var>): <b>300.8017</b></li>
660     *   <li>Particularly important to E&amp;P industry.</li>
661     * </ul>
662     *
663     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
664     */
665    @Test
666    public void testEverest1967() throws FactoryException {
667        important         = true;
668        code              = 7016;
669        name              = "Everest 1830 (1967 Definition)";
670        aliases           = NONE;
671        toMetres          = 1.0;
672        semiMajorInMetres = 6377298.556;
673        semiMajorAxis     = 6377298.556;
674        semiMinorAxis     = Double.NaN;
675        inverseFlattening = 300.8017;
676        verifyEllipsoid();
677    }
678
679    /**
680     * Tests “Everest 1830 (1975 Definition)” ellipsoid creation from the factory.
681     *
682     * <ul>
683     *   <li>EPSG ellipsoid code: <b>7045</b></li>
684     *   <li>EPSG ellipsoid name: <b>Everest 1830 (1975 Definition)</b></li>
685     *   <li>Semi-major axis (<var>a</var>): <b>6377299.151</b></li>
686     *   <li>Inverse flattening (1/<var>f</var>): <b>300.8017255</b></li>
687     *   <li>Particularly important to E&amp;P industry.</li>
688     * </ul>
689     *
690     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
691     */
692    @Test
693    public void testEverest1975() throws FactoryException {
694        important         = true;
695        code              = 7045;
696        name              = "Everest 1830 (1975 Definition)";
697        aliases           = NONE;
698        toMetres          = 1.0;
699        semiMajorInMetres = 6377299.151;
700        semiMajorAxis     = 6377299.151;
701        semiMinorAxis     = Double.NaN;
702        inverseFlattening = 300.8017255;
703        verifyEllipsoid();
704    }
705
706    /**
707     * Tests “Everest 1830 Modified” ellipsoid creation from the factory.
708     *
709     * <ul>
710     *   <li>EPSG ellipsoid code: <b>7018</b></li>
711     *   <li>EPSG ellipsoid name: <b>Everest 1830 Modified</b></li>
712     *   <li>Semi-major axis (<var>a</var>): <b>6377304.063</b></li>
713     *   <li>Inverse flattening (1/<var>f</var>): <b>300.8017</b></li>
714     *   <li>Particularly important to E&amp;P industry.</li>
715     * </ul>
716     *
717     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
718     */
719    @Test
720    public void testEverestModified() throws FactoryException {
721        important         = true;
722        code              = 7018;
723        name              = "Everest 1830 Modified";
724        aliases           = NONE;
725        toMetres          = 1.0;
726        semiMajorInMetres = 6377304.063;
727        semiMajorAxis     = 6377304.063;
728        semiMinorAxis     = Double.NaN;
729        inverseFlattening = 300.8017;
730        verifyEllipsoid();
731    }
732
733    /**
734     * Tests “GRS 1967” ellipsoid creation from the factory.
735     *
736     * <ul>
737     *   <li>EPSG ellipsoid code: <b>7036</b></li>
738     *   <li>EPSG ellipsoid name: <b>GRS 1967</b></li>
739     *   <li>Alias(es) given by EPSG: <b>International 1967</b></li>
740     *   <li>Semi-major axis (<var>a</var>): <b>6378160</b></li>
741     *   <li>Inverse flattening (1/<var>f</var>): <b>298.2471674</b></li>
742     *   <li>Particularly important to E&amp;P industry.</li>
743     * </ul>
744     *
745     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
746     *
747     * @see GIGS3002#testGRS1967()
748     */
749    @Test
750    public void testGRS1967() throws FactoryException {
751        important         = true;
752        code              = 7036;
753        name              = "GRS 1967";
754        aliases           = new String[] {"International 1967"};
755        toMetres          = 1.0;
756        semiMajorInMetres = 6378160.0;
757        semiMajorAxis     = 6378160.0;
758        semiMinorAxis     = Double.NaN;
759        inverseFlattening = 298.2471674;
760        verifyEllipsoid();
761    }
762
763    /**
764     * Tests “GRS 1967 Modified” ellipsoid creation from the factory.
765     *
766     * <ul>
767     *   <li>EPSG ellipsoid code: <b>7050</b></li>
768     *   <li>EPSG ellipsoid name: <b>GRS 1967 Modified</b></li>
769     *   <li>Alias(es) given by EPSG: <b>GRS 1967</b></li>
770     *   <li>Semi-major axis (<var>a</var>): <b>6378160</b></li>
771     *   <li>Inverse flattening (1/<var>f</var>): <b>298.25</b></li>
772     *   <li>Particularly important to E&amp;P industry.</li>
773     * </ul>
774     *
775     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
776     */
777    @Test
778    public void testGRS1967Modified() throws FactoryException {
779        important         = true;
780        code              = 7050;
781        name              = "GRS 1967 Modified";
782        aliases           = new String[] {"GRS 1967"};
783        toMetres          = 1.0;
784        semiMajorInMetres = 6378160.0;
785        semiMajorAxis     = 6378160.0;
786        semiMinorAxis     = Double.NaN;
787        inverseFlattening = 298.25;
788        verifyEllipsoid();
789    }
790
791    /**
792     * Tests “GRS 1980” ellipsoid creation from the factory.
793     *
794     * <ul>
795     *   <li>EPSG ellipsoid code: <b>7019</b></li>
796     *   <li>EPSG ellipsoid name: <b>GRS 1980</b></li>
797     *   <li>Alias(es) given by EPSG: <b>International 1979</b></li>
798     *   <li>Semi-major axis (<var>a</var>): <b>6378137</b></li>
799     *   <li>Inverse flattening (1/<var>f</var>): <b>298.2572221</b></li>
800     *   <li>Particularly important to E&amp;P industry.</li>
801     * </ul>
802     *
803     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
804     *
805     * @see GIGS3002#testGRS1980()
806     */
807    @Test
808    public void testGRS1980() throws FactoryException {
809        important         = true;
810        code              = 7019;
811        name              = "GRS 1980";
812        aliases           = new String[] {"International 1979"};
813        toMetres          = 1.0;
814        semiMajorInMetres = 6378137.0;
815        semiMajorAxis     = 6378137.0;
816        semiMinorAxis     = Double.NaN;
817        inverseFlattening = 298.2572221;
818        verifyEllipsoid();
819    }
820
821    /**
822     * Tests “Helmert 1906” ellipsoid creation from the factory.
823     *
824     * <ul>
825     *   <li>EPSG ellipsoid code: <b>7020</b></li>
826     *   <li>EPSG ellipsoid name: <b>Helmert 1906</b></li>
827     *   <li>Semi-major axis (<var>a</var>): <b>6378200</b></li>
828     *   <li>Inverse flattening (1/<var>f</var>): <b>298.3</b></li>
829     *   <li>Particularly important to E&amp;P industry.</li>
830     * </ul>
831     *
832     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
833     */
834    @Test
835    public void testHelmert() throws FactoryException {
836        important         = true;
837        code              = 7020;
838        name              = "Helmert 1906";
839        aliases           = NONE;
840        toMetres          = 1.0;
841        semiMajorInMetres = 6378200.0;
842        semiMajorAxis     = 6378200.0;
843        semiMinorAxis     = Double.NaN;
844        inverseFlattening = 298.3;
845        verifyEllipsoid();
846    }
847
848    /**
849     * Tests “Indonesian National Spheroid” ellipsoid creation from the factory.
850     *
851     * <ul>
852     *   <li>EPSG ellipsoid code: <b>7021</b></li>
853     *   <li>EPSG ellipsoid name: <b>Indonesian National Spheroid</b></li>
854     *   <li>Semi-major axis (<var>a</var>): <b>6378160</b></li>
855     *   <li>Inverse flattening (1/<var>f</var>): <b>298.247</b></li>
856     *   <li>Particularly important to E&amp;P industry.</li>
857     * </ul>
858     *
859     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
860     */
861    @Test
862    public void testIndonesianNational() throws FactoryException {
863        important         = true;
864        code              = 7021;
865        name              = "Indonesian National Spheroid";
866        aliases           = NONE;
867        toMetres          = 1.0;
868        semiMajorInMetres = 6378160.0;
869        semiMajorAxis     = 6378160.0;
870        semiMinorAxis     = Double.NaN;
871        inverseFlattening = 298.247;
872        verifyEllipsoid();
873    }
874
875    /**
876     * Tests “International 1924” ellipsoid creation from the factory.
877     *
878     * <ul>
879     *   <li>EPSG ellipsoid code: <b>7022</b></li>
880     *   <li>EPSG ellipsoid name: <b>International 1924</b></li>
881     *   <li>Alias(es) given by EPSG: <b>Hayford 1909</b></li>
882     *   <li>Semi-major axis (<var>a</var>): <b>6378388</b></li>
883     *   <li>Inverse flattening (1/<var>f</var>): <b>297</b></li>
884     *   <li>Particularly important to E&amp;P industry.</li>
885     * </ul>
886     *
887     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
888     *
889     * @see GIGS3002#testInternational1924()
890     */
891    @Test
892    public void testInternational1924() throws FactoryException {
893        important         = true;
894        code              = 7022;
895        name              = "International 1924";
896        aliases           = new String[] {"Hayford 1909"};
897        toMetres          = 1.0;
898        semiMajorInMetres = 6378388.0;
899        semiMajorAxis     = 6378388.0;
900        semiMinorAxis     = Double.NaN;
901        inverseFlattening = 297.0;
902        verifyEllipsoid();
903    }
904
905    /**
906     * Tests “Krassowsky 1940” ellipsoid creation from the factory.
907     *
908     * <ul>
909     *   <li>EPSG ellipsoid code: <b>7024</b></li>
910     *   <li>EPSG ellipsoid name: <b>Krassowsky 1940</b></li>
911     *   <li>Semi-major axis (<var>a</var>): <b>6378245</b></li>
912     *   <li>Inverse flattening (1/<var>f</var>): <b>298.3</b></li>
913     *   <li>Particularly important to E&amp;P industry.</li>
914     * </ul>
915     *
916     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
917     *
918     * @see GIGS3002#testKrassowsky()
919     */
920    @Test
921    public void testKrassowsky() throws FactoryException {
922        important         = true;
923        code              = 7024;
924        name              = "Krassowsky 1940";
925        aliases           = NONE;
926        toMetres          = 1.0;
927        semiMajorInMetres = 6378245.0;
928        semiMajorAxis     = 6378245.0;
929        semiMinorAxis     = Double.NaN;
930        inverseFlattening = 298.3;
931        verifyEllipsoid();
932    }
933
934    /**
935     * Tests “War Office” ellipsoid creation from the factory.
936     *
937     * <ul>
938     *   <li>EPSG ellipsoid code: <b>7029</b></li>
939     *   <li>EPSG ellipsoid name: <b>War Office</b></li>
940     *   <li>Alias(es) given by EPSG: <b>McCaw 1924</b></li>
941     *   <li>Semi-major axis (<var>a</var>): <b>6378300</b></li>
942     *   <li>Inverse flattening (1/<var>f</var>): <b>296</b></li>
943     *   <li>Particularly important to E&amp;P industry.</li>
944     * </ul>
945     *
946     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
947     */
948    @Test
949    public void testWarOffice() throws FactoryException {
950        important         = true;
951        code              = 7029;
952        name              = "War Office";
953        aliases           = new String[] {"McCaw 1924"};
954        toMetres          = 1.0;
955        semiMajorInMetres = 6378300.0;
956        semiMajorAxis     = 6378300.0;
957        semiMinorAxis     = Double.NaN;
958        inverseFlattening = 296.0;
959        verifyEllipsoid();
960    }
961
962    /**
963     * Tests “WGS 72” ellipsoid creation from the factory.
964     *
965     * <ul>
966     *   <li>EPSG ellipsoid code: <b>7043</b></li>
967     *   <li>EPSG ellipsoid name: <b>WGS 72</b></li>
968     *   <li>Alias(es) given by EPSG: <b>NWL 10D</b></li>
969     *   <li>Semi-major axis (<var>a</var>): <b>6378135</b></li>
970     *   <li>Inverse flattening (1/<var>f</var>): <b>298.26</b></li>
971     *   <li>Particularly important to E&amp;P industry.</li>
972     * </ul>
973     *
974     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
975     */
976    @Test
977    public void testWGS72() throws FactoryException {
978        important         = true;
979        code              = 7043;
980        name              = "WGS 72";
981        aliases           = new String[] {"NWL 10D"};
982        toMetres          = 1.0;
983        semiMajorInMetres = 6378135.0;
984        semiMajorAxis     = 6378135.0;
985        semiMinorAxis     = Double.NaN;
986        inverseFlattening = 298.26;
987        verifyEllipsoid();
988    }
989
990    /**
991     * Tests “WGS 84” ellipsoid creation from the factory.
992     *
993     * <ul>
994     *   <li>EPSG ellipsoid code: <b>7030</b></li>
995     *   <li>EPSG ellipsoid name: <b>WGS 84</b></li>
996     *   <li>Alias(es) given by EPSG: <b>WGS84</b></li>
997     *   <li>Semi-major axis (<var>a</var>): <b>6378137</b></li>
998     *   <li>Inverse flattening (1/<var>f</var>): <b>298.257223563</b></li>
999     *   <li>Particularly important to E&amp;P industry.</li>
1000     * </ul>
1001     *
1002     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1003     *
1004     * @see GIGS3002#testWGS84()
1005     */
1006    @Test
1007    public void testWGS84() throws FactoryException {
1008        important         = true;
1009        code              = 7030;
1010        name              = "WGS 84";
1011        aliases           = new String[] {"WGS84"};
1012        toMetres          = 1.0;
1013        semiMajorInMetres = 6378137.0;
1014        semiMajorAxis     = 6378137.0;
1015        semiMinorAxis     = Double.NaN;
1016        inverseFlattening = 298.257223563;
1017        verifyEllipsoid();
1018    }
1019
1020    /**
1021     * Tests “IAG 1975” ellipsoid creation from the factory.
1022     *
1023     * <ul>
1024     *   <li>EPSG ellipsoid code: <b>7049</b></li>
1025     *   <li>EPSG ellipsoid name: <b>IAG 1975</b></li>
1026     *   <li>Alias(es) given by EPSG: <b>Xian 1980</b></li>
1027     *   <li>Semi-major axis (<var>a</var>): <b>6378140</b></li>
1028     *   <li>Inverse flattening (1/<var>f</var>): <b>298.257</b></li>
1029     *   <li>Particularly important to E&amp;P industry.</li>
1030     * </ul>
1031     *
1032     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1033     */
1034    @Test
1035    public void testIAG1975() throws FactoryException {
1036        important         = true;
1037        code              = 7049;
1038        name              = "IAG 1975";
1039        aliases           = new String[] {"Xian 1980"};
1040        toMetres          = 1.0;
1041        semiMajorInMetres = 6378140.0;
1042        semiMajorAxis     = 6378140.0;
1043        semiMinorAxis     = Double.NaN;
1044        inverseFlattening = 298.257;
1045        verifyEllipsoid();
1046    }
1047
1048    /**
1049     * Tests “Average Terrestrial System 1977” ellipsoid creation from the factory.
1050     *
1051     * <ul>
1052     *   <li>EPSG ellipsoid code: <b>7041</b></li>
1053     *   <li>EPSG ellipsoid name: <b>Average Terrestrial System 1977</b></li>
1054     *   <li>Semi-major axis (<var>a</var>): <b>6378135</b></li>
1055     *   <li>Inverse flattening (1/<var>f</var>): <b>298.257</b></li>
1056     * </ul>
1057     *
1058     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1059     */
1060    @Test
1061    public void testAverageTerrestrialSystem() throws FactoryException {
1062        code              = 7041;
1063        name              = "Average Terrestrial System 1977";
1064        aliases           = NONE;
1065        toMetres          = 1.0;
1066        semiMajorInMetres = 6378135.0;
1067        semiMajorAxis     = 6378135.0;
1068        semiMinorAxis     = Double.NaN;
1069        inverseFlattening = 298.257;
1070        verifyEllipsoid();
1071    }
1072
1073    /**
1074     * Tests “Bessel Modified” ellipsoid creation from the factory.
1075     *
1076     * <ul>
1077     *   <li>EPSG ellipsoid code: <b>7005</b></li>
1078     *   <li>EPSG ellipsoid name: <b>Bessel Modified</b></li>
1079     *   <li>Semi-major axis (<var>a</var>): <b>6377492.018</b></li>
1080     *   <li>Inverse flattening (1/<var>f</var>): <b>299.1528128</b></li>
1081     * </ul>
1082     *
1083     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1084     */
1085    @Test
1086    public void testBesselModified() throws FactoryException {
1087        code              = 7005;
1088        name              = "Bessel Modified";
1089        aliases           = NONE;
1090        toMetres          = 1.0;
1091        semiMajorInMetres = 6377492.018;
1092        semiMajorAxis     = 6377492.018;
1093        semiMinorAxis     = Double.NaN;
1094        inverseFlattening = 299.1528128;
1095        verifyEllipsoid();
1096    }
1097
1098    /**
1099     * Tests “Clarke 1866 Authalic Sphere” spheroid creation from the factory.
1100     *
1101     * <ul>
1102     *   <li>EPSG ellipsoid code: <b>7052</b></li>
1103     *   <li>EPSG ellipsoid name: <b>Clarke 1866 Authalic Sphere</b></li>
1104     *   <li>Semi-major axis (<var>a</var>): <b>6370997</b></li>
1105     *   <li>Semi-minor axis (<var>b</var>): <b>6370997</b></li>
1106     * </ul>
1107     *
1108     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1109     *
1110     * @see GIGS3002#testClarkeAuthalicSphere()
1111     */
1112    @Test
1113    public void testClarkeAuthalicSphere() throws FactoryException {
1114        code              = 7052;
1115        name              = "Clarke 1866 Authalic Sphere";
1116        aliases           = NONE;
1117        toMetres          = 1.0;
1118        semiMajorInMetres = 6370997.0;
1119        semiMajorAxis     = 6370997.0;
1120        semiMinorAxis     = 6370997.0;
1121        inverseFlattening = Double.NaN;
1122        isSphere          = true;
1123        verifyEllipsoid();
1124    }
1125
1126    /**
1127     * Tests “Clarke 1880” ellipsoid creation from the factory.
1128     *
1129     * <ul>
1130     *   <li>EPSG ellipsoid code: <b>7034</b></li>
1131     *   <li>EPSG ellipsoid name: <b>Clarke 1880</b></li>
1132     *   <li>Semi-major axis (<var>a</var>): <b>20926202</b></li>
1133     *   <li>Semi-minor axis (<var>b</var>): <b>20854895</b></li>
1134     * </ul>
1135     *
1136     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1137     */
1138    @Test
1139    public void testClarke1880() throws FactoryException {
1140        code              = 7034;
1141        name              = "Clarke 1880";
1142        aliases           = NONE;
1143        toMetres          = 0.304797265;
1144        semiMajorInMetres = 6378249.145;
1145        semiMajorAxis     = 20926202.0;
1146        semiMinorAxis     = 20854895.0;
1147        inverseFlattening = Double.NaN;
1148        verifyEllipsoid();
1149    }
1150
1151    /**
1152     * Tests “Clarke 1880 (Arc)” ellipsoid creation from the factory.
1153     *
1154     * <ul>
1155     *   <li>EPSG ellipsoid code: <b>7013</b></li>
1156     *   <li>EPSG ellipsoid name: <b>Clarke 1880 (Arc)</b></li>
1157     *   <li>Alias(es) given by EPSG: <b>Modified Clarke 1880 (South Africa)</b>, <b>Clarke 1880 (Cape)</b></li>
1158     *   <li>Semi-major axis (<var>a</var>): <b>6378249.145</b></li>
1159     *   <li>Inverse flattening (1/<var>f</var>): <b>293.4663077</b></li>
1160     * </ul>
1161     *
1162     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1163     */
1164    @Test
1165    public void testClarkeArc() throws FactoryException {
1166        code              = 7013;
1167        name              = "Clarke 1880 (Arc)";
1168        aliases           = new String[] {"Modified Clarke 1880 (South Africa)", "Clarke 1880 (Cape)"};
1169        toMetres          = 1.0;
1170        semiMajorInMetres = 6378249.145;
1171        semiMajorAxis     = 6378249.145;
1172        semiMinorAxis     = Double.NaN;
1173        inverseFlattening = 293.4663077;
1174        verifyEllipsoid();
1175    }
1176
1177    /**
1178     * Tests “Clarke 1880 (Benoit)” ellipsoid creation from the factory.
1179     *
1180     * <ul>
1181     *   <li>EPSG ellipsoid code: <b>7010</b></li>
1182     *   <li>EPSG ellipsoid name: <b>Clarke 1880 (Benoit)</b></li>
1183     *   <li>Semi-major axis (<var>a</var>): <b>6378300.789</b></li>
1184     *   <li>Semi-minor axis (<var>b</var>): <b>6356566.435</b></li>
1185     * </ul>
1186     *
1187     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1188     */
1189    @Test
1190    public void testClarkeBenoit() throws FactoryException {
1191        code              = 7010;
1192        name              = "Clarke 1880 (Benoit)";
1193        aliases           = NONE;
1194        toMetres          = 1.0;
1195        semiMajorInMetres = 6378300.789;
1196        semiMajorAxis     = 6378300.789;
1197        semiMinorAxis     = 6356566.435;
1198        inverseFlattening = Double.NaN;
1199        verifyEllipsoid();
1200    }
1201
1202    /**
1203     * Tests “Clarke 1880 (international foot)” ellipsoid creation from the factory.
1204     *
1205     * <ul>
1206     *   <li>EPSG ellipsoid code: <b>7055</b></li>
1207     *   <li>EPSG ellipsoid name: <b>Clarke 1880 (international foot)</b></li>
1208     *   <li>Semi-major axis (<var>a</var>): <b>20926202</b></li>
1209     *   <li>Semi-minor axis (<var>b</var>): <b>20854895</b></li>
1210     * </ul>
1211     *
1212     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1213     */
1214    @Test
1215    public void testClarkeInternationalFoot() throws FactoryException {
1216        code              = 7055;
1217        name              = "Clarke 1880 (international foot)";
1218        aliases           = NONE;
1219        toMetres          = 0.3048;
1220        semiMajorInMetres = 6378306.37;
1221        semiMajorAxis     = 20926202.0;
1222        semiMinorAxis     = 20854895.0;
1223        inverseFlattening = Double.NaN;
1224        verifyEllipsoid();
1225    }
1226
1227    /**
1228     * Tests “Clarke 1880 (SGA 1922)” ellipsoid creation from the factory.
1229     *
1230     * <ul>
1231     *   <li>EPSG ellipsoid code: <b>7014</b></li>
1232     *   <li>EPSG ellipsoid name: <b>Clarke 1880 (SGA 1922)</b></li>
1233     *   <li>Semi-major axis (<var>a</var>): <b>6378249.2</b></li>
1234     *   <li>Inverse flattening (1/<var>f</var>): <b>293.46598</b></li>
1235     * </ul>
1236     *
1237     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1238     */
1239    @Test
1240    public void testClarkeSGA() throws FactoryException {
1241        code              = 7014;
1242        name              = "Clarke 1880 (SGA 1922)";
1243        aliases           = NONE;
1244        toMetres          = 1.0;
1245        semiMajorInMetres = 6378249.2;
1246        semiMajorAxis     = 6378249.2;
1247        semiMinorAxis     = Double.NaN;
1248        inverseFlattening = 293.46598;
1249        verifyEllipsoid();
1250    }
1251
1252    /**
1253     * Tests “Danish 1876” ellipsoid creation from the factory.
1254     *
1255     * <ul>
1256     *   <li>EPSG ellipsoid code: <b>7051</b></li>
1257     *   <li>EPSG ellipsoid name: <b>Danish 1876</b></li>
1258     *   <li>Semi-major axis (<var>a</var>): <b>6377019.27</b></li>
1259     *   <li>Inverse flattening (1/<var>f</var>): <b>300</b></li>
1260     * </ul>
1261     *
1262     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1263     */
1264    @Test
1265    public void testDanish() throws FactoryException {
1266        code              = 7051;
1267        name              = "Danish 1876";
1268        aliases           = NONE;
1269        toMetres          = 1.0;
1270        semiMajorInMetres = 6377019.27;
1271        semiMajorAxis     = 6377019.27;
1272        semiMinorAxis     = Double.NaN;
1273        inverseFlattening = 300.0;
1274        verifyEllipsoid();
1275    }
1276
1277    /**
1278     * Tests “Everest (1830 Definition)” ellipsoid creation from the factory.
1279     *
1280     * <ul>
1281     *   <li>EPSG ellipsoid code: <b>7042</b></li>
1282     *   <li>EPSG ellipsoid name: <b>Everest (1830 Definition)</b></li>
1283     *   <li>Semi-major axis (<var>a</var>): <b>20922931.80</b></li>
1284     *   <li>Semi-minor axis (<var>b</var>): <b>20853374.58</b></li>
1285     * </ul>
1286     *
1287     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1288     */
1289    @Test
1290    public void testEverest1830() throws FactoryException {
1291        code              = 7042;
1292        name              = "Everest (1830 Definition)";
1293        aliases           = NONE;
1294        toMetres          = 0.30479951;
1295        semiMajorInMetres = 6377299.366;
1296        semiMajorAxis     = 20922931.80;
1297        semiMinorAxis     = 20853374.58;
1298        inverseFlattening = Double.NaN;
1299        verifyEllipsoid();
1300    }
1301
1302    /**
1303     * Tests “Everest 1830 (RSO 1969)” ellipsoid creation from the factory.
1304     *
1305     * <ul>
1306     *   <li>EPSG ellipsoid code: <b>7056</b></li>
1307     *   <li>EPSG ellipsoid name: <b>Everest 1830 (RSO 1969)</b></li>
1308     *   <li>Semi-major axis (<var>a</var>): <b>6377295.664</b></li>
1309     *   <li>Inverse flattening (1/<var>f</var>): <b>300.8017</b></li>
1310     * </ul>
1311     *
1312     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1313     */
1314    @Test
1315    public void testEverestRSO() throws FactoryException {
1316        code              = 7056;
1317        name              = "Everest 1830 (RSO 1969)";
1318        aliases           = NONE;
1319        toMetres          = 1.0;
1320        semiMajorInMetres = 6377295.664;
1321        semiMajorAxis     = 6377295.664;
1322        semiMinorAxis     = Double.NaN;
1323        inverseFlattening = 300.8017;
1324        verifyEllipsoid();
1325    }
1326
1327    /**
1328     * Tests “GEM 10C” ellipsoid creation from the factory.
1329     *
1330     * <ul>
1331     *   <li>EPSG ellipsoid code: <b>7031</b></li>
1332     *   <li>EPSG ellipsoid name: <b>GEM 10C</b></li>
1333     *   <li>Semi-major axis (<var>a</var>): <b>6378137</b></li>
1334     *   <li>Inverse flattening (1/<var>f</var>): <b>298.257223563</b></li>
1335     * </ul>
1336     *
1337     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1338     */
1339    @Test
1340    public void testGEM10C() throws FactoryException {
1341        code              = 7031;
1342        name              = "GEM 10C";
1343        aliases           = NONE;
1344        toMetres          = 1.0;
1345        semiMajorInMetres = 6378137.0;
1346        semiMajorAxis     = 6378137.0;
1347        semiMinorAxis     = Double.NaN;
1348        inverseFlattening = 298.257223563;
1349        verifyEllipsoid();
1350    }
1351
1352    /**
1353     * Tests “GRS 1980 Authalic Sphere” spheroid creation from the factory.
1354     *
1355     * <ul>
1356     *   <li>EPSG ellipsoid code: <b>7048</b></li>
1357     *   <li>EPSG ellipsoid name: <b>GRS 1980 Authalic Sphere</b></li>
1358     *   <li>Semi-major axis (<var>a</var>): <b>6371007</b></li>
1359     *   <li>Semi-minor axis (<var>b</var>): <b>6371007</b></li>
1360     * </ul>
1361     *
1362     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1363     */
1364    @Test
1365    public void testGRS1980AuthalicSphere() throws FactoryException {
1366        code              = 7048;
1367        name              = "GRS 1980 Authalic Sphere";
1368        aliases           = NONE;
1369        toMetres          = 1.0;
1370        semiMajorInMetres = 6371007.0;
1371        semiMajorAxis     = 6371007.0;
1372        semiMinorAxis     = 6371007.0;
1373        inverseFlattening = Double.NaN;
1374        isSphere          = true;
1375        verifyEllipsoid();
1376    }
1377
1378    /**
1379     * Tests “Hough 1960” ellipsoid creation from the factory.
1380     *
1381     * <ul>
1382     *   <li>EPSG ellipsoid code: <b>7053</b></li>
1383     *   <li>EPSG ellipsoid name: <b>Hough 1960</b></li>
1384     *   <li>Semi-major axis (<var>a</var>): <b>6378270</b></li>
1385     *   <li>Inverse flattening (1/<var>f</var>): <b>297</b></li>
1386     * </ul>
1387     *
1388     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1389     */
1390    @Test
1391    public void testHough1960() throws FactoryException {
1392        code              = 7053;
1393        name              = "Hough 1960";
1394        aliases           = NONE;
1395        toMetres          = 1.0;
1396        semiMajorInMetres = 6378270.0;
1397        semiMajorAxis     = 6378270.0;
1398        semiMinorAxis     = Double.NaN;
1399        inverseFlattening = 297.0;
1400        verifyEllipsoid();
1401    }
1402
1403    /**
1404     * Tests “Hughes 1980” ellipsoid creation from the factory.
1405     *
1406     * <ul>
1407     *   <li>EPSG ellipsoid code: <b>7058</b></li>
1408     *   <li>EPSG ellipsoid name: <b>Hughes 1980</b></li>
1409     *   <li>Semi-major axis (<var>a</var>): <b>6378273</b></li>
1410     *   <li>Semi-minor axis (<var>b</var>): <b>6356889.449</b></li>
1411     * </ul>
1412     *
1413     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1414     */
1415    @Test
1416    public void testHughes1980() throws FactoryException {
1417        code              = 7058;
1418        name              = "Hughes 1980";
1419        aliases           = NONE;
1420        toMetres          = 1.0;
1421        semiMajorInMetres = 6378273.0;
1422        semiMajorAxis     = 6378273.0;
1423        semiMinorAxis     = 6356889.449;
1424        inverseFlattening = Double.NaN;
1425        verifyEllipsoid();
1426    }
1427
1428    /**
1429     * Tests “International 1924 Authalic Sphere” spheroid creation from the factory.
1430     *
1431     * <ul>
1432     *   <li>EPSG ellipsoid code: <b>7057</b></li>
1433     *   <li>EPSG ellipsoid name: <b>International 1924 Authalic Sphere</b></li>
1434     *   <li>Semi-major axis (<var>a</var>): <b>6371228</b></li>
1435     *   <li>Semi-minor axis (<var>b</var>): <b>6371228</b></li>
1436     * </ul>
1437     *
1438     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1439     */
1440    @Test
1441    public void testInternational1924AuthalicSphere() throws FactoryException {
1442        code              = 7057;
1443        name              = "International 1924 Authalic Sphere";
1444        aliases           = NONE;
1445        toMetres          = 1.0;
1446        semiMajorInMetres = 6371228.0;
1447        semiMajorAxis     = 6371228.0;
1448        semiMinorAxis     = 6371228.0;
1449        inverseFlattening = Double.NaN;
1450        isSphere          = true;
1451        verifyEllipsoid();
1452    }
1453
1454    /**
1455     * Tests “NWL 9D” ellipsoid creation from the factory.
1456     *
1457     * <ul>
1458     *   <li>EPSG ellipsoid code: <b>7025</b></li>
1459     *   <li>EPSG ellipsoid name: <b>NWL 9D</b></li>
1460     *   <li>Alias(es) given by EPSG: <b>WGS 66</b></li>
1461     *   <li>Semi-major axis (<var>a</var>): <b>6378145</b></li>
1462     *   <li>Inverse flattening (1/<var>f</var>): <b>298.25</b></li>
1463     * </ul>
1464     *
1465     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1466     */
1467    @Test
1468    public void testNWL9D() throws FactoryException {
1469        code              = 7025;
1470        name              = "NWL 9D";
1471        aliases           = new String[] {"WGS 66"};
1472        toMetres          = 1.0;
1473        semiMajorInMetres = 6378145.0;
1474        semiMajorAxis     = 6378145.0;
1475        semiMinorAxis     = Double.NaN;
1476        inverseFlattening = 298.25;
1477        verifyEllipsoid();
1478    }
1479
1480    /**
1481     * Tests “OSU86F” ellipsoid creation from the factory.
1482     *
1483     * <ul>
1484     *   <li>EPSG ellipsoid code: <b>7032</b></li>
1485     *   <li>EPSG ellipsoid name: <b>OSU86F</b></li>
1486     *   <li>Semi-major axis (<var>a</var>): <b>6378136.2</b></li>
1487     *   <li>Inverse flattening (1/<var>f</var>): <b>298.257223563</b></li>
1488     * </ul>
1489     *
1490     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1491     */
1492    @Test
1493    public void testOSU86F() throws FactoryException {
1494        code              = 7032;
1495        name              = "OSU86F";
1496        aliases           = NONE;
1497        toMetres          = 1.0;
1498        semiMajorInMetres = 6378136.2;
1499        semiMajorAxis     = 6378136.2;
1500        semiMinorAxis     = Double.NaN;
1501        inverseFlattening = 298.257223563;
1502        verifyEllipsoid();
1503    }
1504
1505    /**
1506     * Tests “OSU91A” ellipsoid creation from the factory.
1507     *
1508     * <ul>
1509     *   <li>EPSG ellipsoid code: <b>7033</b></li>
1510     *   <li>EPSG ellipsoid name: <b>OSU91A</b></li>
1511     *   <li>Semi-major axis (<var>a</var>): <b>6378136.3</b></li>
1512     *   <li>Inverse flattening (1/<var>f</var>): <b>298.257223563</b></li>
1513     * </ul>
1514     *
1515     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1516     */
1517    @Test
1518    public void testOSU91A() throws FactoryException {
1519        code              = 7033;
1520        name              = "OSU91A";
1521        aliases           = NONE;
1522        toMetres          = 1.0;
1523        semiMajorInMetres = 6378136.3;
1524        semiMajorAxis     = 6378136.3;
1525        semiMinorAxis     = Double.NaN;
1526        inverseFlattening = 298.257223563;
1527        verifyEllipsoid();
1528    }
1529
1530    /**
1531     * Tests “Plessis 1817” ellipsoid creation from the factory.
1532     *
1533     * <ul>
1534     *   <li>EPSG ellipsoid code: <b>7027</b></li>
1535     *   <li>EPSG ellipsoid name: <b>Plessis 1817</b></li>
1536     *   <li>Semi-major axis (<var>a</var>): <b>6376523</b></li>
1537     *   <li>Inverse flattening (1/<var>f</var>): <b>308.64</b></li>
1538     * </ul>
1539     *
1540     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1541     */
1542    @Test
1543    public void testPlessis() throws FactoryException {
1544        code              = 7027;
1545        name              = "Plessis 1817";
1546        aliases           = NONE;
1547        toMetres          = 1.0;
1548        semiMajorInMetres = 6376523.0;
1549        semiMajorAxis     = 6376523.0;
1550        semiMinorAxis     = Double.NaN;
1551        inverseFlattening = 308.64;
1552        verifyEllipsoid();
1553    }
1554
1555    /**
1556     * Tests “Popular Visualisation Sphere” spheroid creation from the factory <em>(deprecated)</em>.
1557     * This is test is executed only if {@link #isDeprecatedObjectCreationSupported} is {@code true}.
1558     *
1559     * <ul>
1560     *   <li>EPSG ellipsoid code: <b>7059</b></li>
1561     *   <li>EPSG ellipsoid name: <b>Popular Visualisation Sphere</b></li>
1562     *   <li>Semi-major axis (<var>a</var>): <b>6378137</b></li>
1563     *   <li>Semi-minor axis (<var>b</var>): <b>6378137</b></li>
1564     *   <li><b>Deprecated:</b> IOGP revised its approach to description of Popular Visualisation CRS.</li>
1565     * </ul>
1566     *
1567     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1568     */
1569    @Test
1570    public void testPopularVisualisationSphere() throws FactoryException {
1571        code              = 7059;
1572        name              = "Popular Visualisation Sphere";
1573        aliases           = NONE;
1574        toMetres          = 1.0;
1575        semiMajorInMetres = 6378137.0;
1576        semiMajorAxis     = 6378137.0;
1577        semiMinorAxis     = 6378137.0;
1578        inverseFlattening = Double.NaN;
1579        isSphere          = true;
1580        assumeTrue("Creation of deprecated objects not supported.", isDeprecatedObjectCreationSupported);
1581        verifyEllipsoid();
1582    }
1583
1584    /**
1585     * Tests “PZ-90” ellipsoid creation from the factory.
1586     *
1587     * <ul>
1588     *   <li>EPSG ellipsoid code: <b>7054</b></li>
1589     *   <li>EPSG ellipsoid name: <b>PZ-90</b></li>
1590     *   <li>Semi-major axis (<var>a</var>): <b>6378136</b></li>
1591     *   <li>Inverse flattening (1/<var>f</var>): <b>298.2578393</b></li>
1592     * </ul>
1593     *
1594     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1595     */
1596    @Test
1597    public void testPZ90() throws FactoryException {
1598        code              = 7054;
1599        name              = "PZ-90";
1600        aliases           = NONE;
1601        toMetres          = 1.0;
1602        semiMajorInMetres = 6378136.0;
1603        semiMajorAxis     = 6378136.0;
1604        semiMinorAxis     = Double.NaN;
1605        inverseFlattening = 298.2578393;
1606        verifyEllipsoid();
1607    }
1608
1609    /**
1610     * Tests “Struve 1860” ellipsoid creation from the factory.
1611     *
1612     * <ul>
1613     *   <li>EPSG ellipsoid code: <b>7028</b></li>
1614     *   <li>EPSG ellipsoid name: <b>Struve 1860</b></li>
1615     *   <li>Semi-major axis (<var>a</var>): <b>6378298.3</b></li>
1616     *   <li>Inverse flattening (1/<var>f</var>): <b>294.73</b></li>
1617     * </ul>
1618     *
1619     * @throws FactoryException if an error occurred while creating the ellipsoid from the EPSG code.
1620     */
1621    @Test
1622    public void testStruve() throws FactoryException {
1623        code              = 7028;
1624        name              = "Struve 1860";
1625        aliases           = NONE;
1626        toMetres          = 1.0;
1627        semiMajorInMetres = 6378298.3;
1628        semiMajorAxis     = 6378298.3;
1629        semiMinorAxis     = Double.NaN;
1630        inverseFlattening = 294.73;
1631        verifyEllipsoid();
1632    }
1633}