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;
035
036import org.opengis.util.Factory;
037import org.opengis.util.FactoryException;
038import org.opengis.referencing.NoSuchAuthorityCodeException;
039import org.opengis.referencing.crs.VerticalCRS;
040import org.opengis.referencing.crs.CRSAuthorityFactory;
041import org.opengis.referencing.datum.DatumAuthorityFactory;
042import org.opengis.referencing.datum.VerticalDatum;
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 vertical datums and CRSs bundled with the geoscience software.
056 *
057 * <table class="gigs" summary="Test description"><tr>
058 *   <th>Test method:</th>
059 *   <td>Compare vertical datum and CRS 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_2008_libVerticalDatumCRS.csv">{@code GIGS_2008_libVerticalDatumCRS.csv}</a>
063 *       and EPSG Dataset.</td>
064 * </tr><tr>
065 *   <th>Tested API:</th>
066 *   <td>{@link DatumAuthorityFactory#createVerticalDatum(String)} and<br>
067 *       {@link CRSAuthorityFactory#createVerticalCRS(String)}.</td>
068 * </tr><tr>
069 *   <th>Expected result:</th>
070 *   <td>Definitions bundled with the software should have the same name and coordinate system
071 *       (including axes direction and units) as in EPSG Dataset. CRSs missing from the software
072 *       or at variance with those in the EPSG Dataset should be reported.</td>
073 * </tr></table>
074 *
075 *
076 * <div class="note"><b>Usage example:</b>
077 * in order to specify their factories and run the tests in a JUnit framework, implementors can
078 * define a subclass in their own test suite as in the example below:
079 *
080 * <blockquote><pre>import org.junit.runner.RunWith;
081 *import org.junit.runners.JUnit4;
082 *import org.opengis.test.referencing.gigs.GIGS2008;
083 *
084 *&#64;RunWith(JUnit4.class)
085 *public class MyTest extends GIGS2008 {
086 *    public MyTest() {
087 *        super(new MyDatumAuthorityFactory(),
088 *              new MyCRSAuthorityFactory());
089 *    }
090 *}</pre></blockquote>
091 * </div>
092 *
093 * @author  GIGS (IOGP)
094 * @author  Martin Desruisseaux (Geomatys)
095 * @author  Alexis Manin (Geomatys)
096 * @version 3.1
097 * @since   3.1
098 */
099@RunWith(Parameterized.class)
100public strictfp class GIGS2008 extends AuthorityFactoryTestCase<VerticalCRS> {
101    /**
102     * The EPSG code of the expected {@link VerticalDatum}.
103     */
104    public int datumCode;
105
106    /**
107     * The expected EPSG name of the {@link VerticalDatum}.
108     */
109    public String datumName;
110
111    /**
112     * The vertical CRS created by the factory, or {@code null} if not yet created or if CRS creation failed.
113     *
114     * @see #crsAuthorityFactory
115     */
116    private VerticalCRS crs;
117
118    /**
119     * Factory to use for building {@link VerticalDatum} instances, or {@code null} if none.
120     */
121    protected final DatumAuthorityFactory datumAuthorityFactory;
122
123    /**
124     * Factory to use for building {@link VerticalCRS} instances, or {@code null} if none.
125     * This is the factory used by the {@link #getIdentifiedObject()} method.
126     */
127    protected final CRSAuthorityFactory crsAuthorityFactory;
128
129    /**
130     * Returns a default set of factories to use for running the tests. Those factories are given
131     * in arguments to the constructor when this test class is instantiated directly by JUnit (for
132     * example as a {@linkplain org.junit.runners.Suite.SuiteClasses suite} element), instead than
133     * subclassed by the implementor. The factories are fetched as documented in the
134     * {@link #factories(Class[])} javadoc.
135     *
136     * @return the default set of arguments to be given to the {@code GIGS2008} constructor.
137     */
138    @Parameterized.Parameters
139    @SuppressWarnings("unchecked")
140    public static List<Factory[]> factories() {
141        return factories(FactoryFilter.ByAuthority.EPSG, DatumAuthorityFactory.class, CRSAuthorityFactory.class);
142    }
143
144    /**
145     * Creates a new test using the given factory. If a given factory is {@code null},
146     * then the tests which depend on it will be skipped.
147     *
148     * @param datumFactory  factory for creating {@link VerticalDatum} instances.
149     * @param crsFactory    factory for creating {@link VerticalCRS} instances.
150     */
151    public GIGS2008(final DatumAuthorityFactory datumFactory, final CRSAuthorityFactory crsFactory) {
152        super(datumFactory, crsFactory);
153        datumAuthorityFactory = datumFactory;
154        crsAuthorityFactory = crsFactory;
155    }
156
157    /**
158     * Returns information about the configuration of the test which has been run.
159     * This method returns a map containing:
160     *
161     * <ul>
162     *   <li>All the following values associated to the {@link org.opengis.test.Configuration.Key} of the same name:
163     *     <ul>
164     *       <li>{@link #isStandardNameSupported}</li>
165     *       <li>{@link #isStandardAliasSupported}</li>
166     *       <li>{@link #isDependencyIdentificationSupported}</li>
167     *       <li>{@link #datumAuthorityFactory}</li>
168     *       <li>{@link #crsAuthorityFactory}</li>
169     *     </ul>
170     *   </li>
171     * </ul>
172     *
173     * @return the configuration of the test being run.
174     */
175    @Override
176    public Configuration configuration() {
177        final Configuration op = super.configuration();
178        assertNull(op.put(Configuration.Key.datumAuthorityFactory, datumAuthorityFactory));
179        assertNull(op.put(Configuration.Key.crsAuthorityFactory, crsAuthorityFactory));
180        return op;
181    }
182
183    /**
184     * Returns the vertical CRS instance to be tested. When this method is invoked for the first time, it creates the
185     * vertical CRS to test by invoking the {@link CRSAuthorityFactory#createVerticalCRS(String)} method with the
186     * current {@link #code} value in argument. The created object is then cached and returned in all subsequent
187     * invocations of this method.
188     *
189     * @return the vertical CRS instance to test.
190     * @throws FactoryException if an error occurred while creating the vertical CRS instance.
191     */
192    @Override
193    public VerticalCRS getIdentifiedObject() throws FactoryException {
194        if (crs == null) {
195            assumeNotNull(crsAuthorityFactory);
196            try {
197                crs = crsAuthorityFactory.createVerticalCRS(String.valueOf(code));
198            } catch (NoSuchAuthorityCodeException e) {
199                unsupportedCode(VerticalCRS.class, code);
200                throw e;
201            }
202        }
203        return crs;
204    }
205
206    /**
207     * Creates a vertical datum for the current {@link #datumCode}, then verifies its name and properties.
208     */
209    private void createAndVerifyVerticalDatum() throws FactoryException {
210        assumeTrue(datumAuthorityFactory != null || crsAuthorityFactory != null);
211        if (datumAuthorityFactory != null) {
212            final VerticalDatum datum;
213            try {
214                datum = datumAuthorityFactory.createVerticalDatum(String.valueOf(datumCode));
215            } catch (NoSuchAuthorityCodeException e) {
216                unsupportedCode(VerticalDatum.class, datumCode);
217                throw e;
218            }
219
220            // Datum validation.
221            assertNotNull("VerticalDatum", datum);
222            validators.validate(datum);
223
224            // Datum identifier. Important in order to distinguish datum.
225            assertContainsCode("VerticalDatum.getIdentifiers()", "EPSG", datumCode, datum.getIdentifiers());
226
227            // Datum name.
228            if (isStandardNameSupported) {
229                configurationTip = Configuration.Key.isStandardNameSupported;
230                assertEquals("VerticalDatum.getName()", datumName, getVerifiableName(datum));
231                configurationTip = null;
232            }
233        }
234    }
235
236    /**
237     * Verifies the properties of the vertical CRS given by {@link #getIdentifiedObject()}.
238     */
239    private void verifyVerticalCRS() throws FactoryException {
240        if (crsAuthorityFactory != null) {
241            final VerticalCRS crs = getIdentifiedObject();
242
243            // CRS validation.
244            assertNotNull("VerticalCRS", crs);
245            validators.validate(crs);
246
247            // CRS identifier.
248            assertContainsCode("VerticalCRS.getIdentifiers()", "EPSG", code, crs.getIdentifiers());
249
250            // CRS name.
251            if (isStandardNameSupported) {
252                configurationTip = Configuration.Key.isStandardNameSupported;
253                assertEquals("VerticalCRS.getName()", name, getVerifiableName(crs));
254                configurationTip = null;
255            }
256
257            // Datum associated to the CRS.
258            final VerticalDatum datum = crs.getDatum();
259            assertNotNull("VerticalCRS.getDatum()", datum);
260
261            // Datum identification.
262            if (isDependencyIdentificationSupported) {
263                configurationTip = Configuration.Key.isDependencyIdentificationSupported;
264                assertContainsCode("VerticalCRS.getDatum().getIdentifiers()", "EPSG",
265                        datumCode, datum.getIdentifiers());
266
267                configurationTip = Configuration.Key.isStandardNameSupported;
268                assertEquals("VerticalCRS.getDatum().getName()", datumName, getVerifiableName(datum));
269                configurationTip = null;
270            }
271        }
272    }
273
274    /**
275     * Tests “AHD (Tasmania) height” vertical CRS creation from the factory.
276     *
277     * <ul>
278     *   <li>EPSG vertical datum code: <b>5112</b></li>
279     *   <li>EPSG vertical datum name: <b>Australian Height Datum (Tasmania)</b></li>
280     *   <li>EPSG vertical CRS code: <b>5712</b></li>
281     *   <li>EPSG vertical CRS name: <b>AHD (Tasmania) height</b></li>
282     *   <li>Particularly important to E&amp;P industry.</li>
283     * </ul>
284     *
285     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
286     */
287    @Test
288    public void testAHD_Tasmania() throws FactoryException {
289        important = true;
290        datumName = "Australian Height Datum (Tasmania)";
291        datumCode = 5112;
292        name      = "AHD (Tasmania) height";
293        code      = 5712;
294        createAndVerifyVerticalDatum();
295        verifyVerticalCRS();
296    }
297
298    /**
299     * Tests “AHD height” vertical CRS creation from the factory.
300     *
301     * <ul>
302     *   <li>EPSG vertical datum code: <b>5111</b></li>
303     *   <li>EPSG vertical datum name: <b>Australian Height Datum</b></li>
304     *   <li>EPSG vertical CRS code: <b>5711</b></li>
305     *   <li>EPSG vertical CRS name: <b>AHD height</b></li>
306     *   <li>Particularly important to E&amp;P industry.</li>
307     * </ul>
308     *
309     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
310     */
311    @Test
312    public void testAHD() throws FactoryException {
313        important = true;
314        datumName = "Australian Height Datum";
315        datumCode = 5111;
316        name      = "AHD height";
317        code      = 5711;
318        createAndVerifyVerticalDatum();
319        verifyVerticalCRS();
320    }
321
322    /**
323     * Tests “AIOC95 depth” vertical CRS creation from the factory.
324     *
325     * <ul>
326     *   <li>EPSG vertical datum code: <b>5133</b></li>
327     *   <li>EPSG vertical datum name: <b>AIOC 1995</b></li>
328     *   <li>EPSG vertical CRS code: <b>5734</b></li>
329     *   <li>EPSG vertical CRS name: <b>AIOC95 depth</b></li>
330     *   <li>Particularly important to E&amp;P industry.</li>
331     * </ul>
332     *
333     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
334     */
335    @Test
336    public void testAIOC95Depth() throws FactoryException {
337        important = true;
338        datumName = "AIOC 1995";
339        datumCode = 5133;
340        name      = "AIOC95 depth";
341        code      = 5734;
342        createAndVerifyVerticalDatum();
343        verifyVerticalCRS();
344    }
345
346    /**
347     * Tests “AIOC95 height” vertical CRS creation from the factory.
348     *
349     * <ul>
350     *   <li>EPSG vertical datum code: <b>5133</b></li>
351     *   <li>EPSG vertical datum name: <b>AIOC 1995</b></li>
352     *   <li>EPSG vertical CRS code: <b>5797</b></li>
353     *   <li>EPSG vertical CRS name: <b>AIOC95 height</b></li>
354     *   <li>Particularly important to E&amp;P industry.</li>
355     * </ul>
356     *
357     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
358     */
359    @Test
360    public void testAIOC95Height() throws FactoryException {
361        important = true;
362        datumName = "AIOC 1995";
363        datumCode = 5133;
364        name      = "AIOC95 height";
365        code      = 5797;
366        createAndVerifyVerticalDatum();
367        verifyVerticalCRS();
368    }
369
370    /**
371     * Tests “Baltic 1982 height” vertical CRS creation from the factory.
372     *
373     * <ul>
374     *   <li>EPSG vertical datum code: <b>5184</b></li>
375     *   <li>EPSG vertical datum name: <b>Baltic 1982</b></li>
376     *   <li>EPSG vertical CRS code: <b>5786</b></li>
377     *   <li>EPSG vertical CRS name: <b>Baltic 1982 height</b></li>
378     *   <li>Particularly important to E&amp;P industry.</li>
379     * </ul>
380     *
381     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
382     */
383    @Test
384    public void testBaltic1982() throws FactoryException {
385        important = true;
386        datumName = "Baltic 1982";
387        datumCode = 5184;
388        name      = "Baltic 1982 height";
389        code      = 5786;
390        createAndVerifyVerticalDatum();
391        verifyVerticalCRS();
392    }
393
394    /**
395     * Tests “Baltic 1977 depth” vertical CRS creation from the factory.
396     *
397     * <ul>
398     *   <li>EPSG vertical datum code: <b>5105</b></li>
399     *   <li>EPSG vertical datum name: <b>Baltic 1977</b></li>
400     *   <li>EPSG vertical CRS code: <b>5612</b></li>
401     *   <li>EPSG vertical CRS name: <b>Baltic 1977 depth</b></li>
402     *   <li>Particularly important to E&amp;P industry.</li>
403     * </ul>
404     *
405     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
406     */
407    @Test
408    public void testBalticDepth() throws FactoryException {
409        important = true;
410        datumName = "Baltic 1977";
411        datumCode = 5105;
412        name      = "Baltic 1977 depth";
413        code      = 5612;
414        createAndVerifyVerticalDatum();
415        verifyVerticalCRS();
416    }
417
418    /**
419     * Tests “Baltic 1977 height” vertical CRS creation from the factory.
420     *
421     * <ul>
422     *   <li>EPSG vertical datum code: <b>5105</b></li>
423     *   <li>EPSG vertical datum name: <b>Baltic 1977</b></li>
424     *   <li>EPSG vertical CRS code: <b>5705</b></li>
425     *   <li>EPSG vertical CRS name: <b>Baltic 1977 height</b></li>
426     *   <li>Particularly important to E&amp;P industry.</li>
427     * </ul>
428     *
429     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
430     */
431    @Test
432    public void testBalticHeight() throws FactoryException {
433        important = true;
434        datumName = "Baltic 1977";
435        datumCode = 5105;
436        name      = "Baltic 1977 height";
437        code      = 5705;
438        createAndVerifyVerticalDatum();
439        verifyVerticalCRS();
440    }
441
442    /**
443     * Tests “Bandar Abbas height” vertical CRS creation from the factory.
444     *
445     * <ul>
446     *   <li>EPSG vertical datum code: <b>5150</b></li>
447     *   <li>EPSG vertical datum name: <b>Bandar Abbas</b></li>
448     *   <li>EPSG vertical CRS code: <b>5752</b></li>
449     *   <li>EPSG vertical CRS name: <b>Bandar Abbas height</b></li>
450     *   <li>Particularly important to E&amp;P industry.</li>
451     * </ul>
452     *
453     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
454     */
455    @Test
456    public void testBandarAbbas() throws FactoryException {
457        important = true;
458        datumName = "Bandar Abbas";
459        datumCode = 5150;
460        name      = "Bandar Abbas height";
461        code      = 5752;
462        createAndVerifyVerticalDatum();
463        verifyVerticalCRS();
464    }
465
466    /**
467     * Tests “Caspian depth” vertical CRS creation from the factory.
468     *
469     * <ul>
470     *   <li>EPSG vertical datum code: <b>5106</b></li>
471     *   <li>EPSG vertical datum name: <b>Caspian Sea</b></li>
472     *   <li>EPSG vertical CRS code: <b>5706</b></li>
473     *   <li>EPSG vertical CRS name: <b>Caspian depth</b></li>
474     *   <li>Particularly important to E&amp;P industry.</li>
475     * </ul>
476     *
477     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
478     */
479    @Test
480    public void testCaspianSea() throws FactoryException {
481        important = true;
482        datumName = "Caspian Sea";
483        datumCode = 5106;
484        name      = "Caspian depth";
485        code      = 5706;
486        createAndVerifyVerticalDatum();
487        verifyVerticalCRS();
488    }
489
490    /**
491     * Tests “CGVD28 height” vertical CRS creation from the factory.
492     *
493     * <ul>
494     *   <li>EPSG vertical datum code: <b>5114</b></li>
495     *   <li>EPSG vertical datum name: <b>Canadian Geodetic Vertical Datum of 1928</b></li>
496     *   <li>EPSG vertical CRS code: <b>5713</b></li>
497     *   <li>EPSG vertical CRS name: <b>CGVD28 height</b></li>
498     *   <li>Particularly important to E&amp;P industry.</li>
499     * </ul>
500     *
501     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
502     */
503    @Test
504    public void testCGVD28() throws FactoryException {
505        important = true;
506        datumName = "Canadian Geodetic Vertical Datum of 1928";
507        datumCode = 5114;
508        name      = "CGVD28 height";
509        code      = 5713;
510        createAndVerifyVerticalDatum();
511        verifyVerticalCRS();
512    }
513
514    /**
515     * Tests “DHHN85 height” vertical CRS creation from the factory.
516     *
517     * <ul>
518     *   <li>EPSG vertical datum code: <b>5182</b></li>
519     *   <li>EPSG vertical datum name: <b>Deutsches Haupthoehennetz 1985</b></li>
520     *   <li>EPSG vertical CRS code: <b>5784</b></li>
521     *   <li>EPSG vertical CRS name: <b>DHHN85 height</b></li>
522     *   <li>Particularly important to E&amp;P industry.</li>
523     * </ul>
524     *
525     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
526     */
527    @Test
528    public void testDHHN85() throws FactoryException {
529        important = true;
530        datumName = "Deutsches Haupthoehennetz 1985";
531        datumCode = 5182;
532        name      = "DHHN85 height";
533        code      = 5784;
534        createAndVerifyVerticalDatum();
535        verifyVerticalCRS();
536    }
537
538    /**
539     * Tests “DHHN92 height” vertical CRS creation from the factory.
540     *
541     * <ul>
542     *   <li>EPSG vertical datum code: <b>5181</b></li>
543     *   <li>EPSG vertical datum name: <b>Deutsches Haupthoehennetz 1992</b></li>
544     *   <li>EPSG vertical CRS code: <b>5783</b></li>
545     *   <li>EPSG vertical CRS name: <b>DHHN92 height</b></li>
546     *   <li>Particularly important to E&amp;P industry.</li>
547     * </ul>
548     *
549     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
550     */
551    @Test
552    public void testDHHN92() throws FactoryException {
553        important = true;
554        datumName = "Deutsches Haupthoehennetz 1992";
555        datumCode = 5181;
556        name      = "DHHN92 height";
557        code      = 5783;
558        createAndVerifyVerticalDatum();
559        verifyVerticalCRS();
560    }
561
562    /**
563     * Tests “EGM96 geoid height” vertical CRS creation from the factory.
564     *
565     * <ul>
566     *   <li>EPSG vertical datum code: <b>5171</b></li>
567     *   <li>EPSG vertical datum name: <b>EGM96 geoid</b></li>
568     *   <li>EPSG vertical CRS code: <b>5773</b></li>
569     *   <li>EPSG vertical CRS name: <b>EGM96 height</b></li>
570     *   <li>Particularly important to E&amp;P industry.</li>
571     * </ul>
572     *
573     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
574     */
575    @Test
576    public void testEGM96() throws FactoryException {
577        important = true;
578        datumName = "EGM96 geoid";
579        datumCode = 5171;
580        name      = "EGM96 height";
581        code      = 5773;
582        createAndVerifyVerticalDatum();
583        verifyVerticalCRS();
584    }
585
586    /**
587     * Tests “EVRF2000 height” vertical CRS creation from the factory.
588     *
589     * <ul>
590     *   <li>EPSG vertical datum code: <b>5129</b></li>
591     *   <li>EPSG vertical datum name: <b>European Vertical Reference Frame 2000</b></li>
592     *   <li>EPSG vertical CRS code: <b>5730</b></li>
593     *   <li>EPSG vertical CRS name: <b>EVRF2000 height</b></li>
594     *   <li>Particularly important to E&amp;P industry.</li>
595     * </ul>
596     *
597     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
598     */
599    @Test
600    public void testEVRF2000() throws FactoryException {
601        important = true;
602        datumName = "European Vertical Reference Frame 2000";
603        datumCode = 5129;
604        name      = "EVRF2000 height";
605        code      = 5730;
606        createAndVerifyVerticalDatum();
607        verifyVerticalCRS();
608    }
609
610    /**
611     * Tests “EVRF2007 height” vertical CRS creation from the factory.
612     *
613     * <ul>
614     *   <li>EPSG vertical datum code: <b>5215</b></li>
615     *   <li>EPSG vertical datum name: <b>European Vertical Reference Frame 2007</b></li>
616     *   <li>EPSG vertical CRS code: <b>5621</b></li>
617     *   <li>EPSG vertical CRS name: <b>EVRF2007 height</b></li>
618     *   <li>Particularly important to E&amp;P industry.</li>
619     * </ul>
620     *
621     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
622     */
623    @Test
624    public void testEVRF2007() throws FactoryException {
625        important = true;
626        datumName = "European Vertical Reference Frame 2007";
627        datumCode = 5215;
628        name      = "EVRF2007 height";
629        code      = 5621;
630        createAndVerifyVerticalDatum();
631        verifyVerticalCRS();
632    }
633
634    /**
635     * Tests “Fahud HD height” vertical CRS creation from the factory.
636     *
637     * <ul>
638     *   <li>EPSG vertical datum code: <b>5124</b></li>
639     *   <li>EPSG vertical datum name: <b>Fahud Height Datum</b></li>
640     *   <li>EPSG vertical CRS code: <b>5725</b></li>
641     *   <li>EPSG vertical CRS name: <b>Fahud HD height</b></li>
642     *   <li>Particularly important to E&amp;P industry.</li>
643     * </ul>
644     *
645     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
646     */
647    @Test
648    public void testFahudHD() throws FactoryException {
649        important = true;
650        datumName = "Fahud Height Datum";
651        datumCode = 5124;
652        name      = "Fahud HD height";
653        code      = 5725;
654        createAndVerifyVerticalDatum();
655        verifyVerticalCRS();
656    }
657
658    /**
659     * Tests “Fao height” vertical CRS creation from the factory.
660     *
661     * <ul>
662     *   <li>EPSG vertical datum code: <b>5149</b></li>
663     *   <li>EPSG vertical datum name: <b>Fao</b></li>
664     *   <li>EPSG vertical CRS code: <b>5751</b></li>
665     *   <li>EPSG vertical CRS name: <b>Fao height</b></li>
666     *   <li>Particularly important to E&amp;P industry.</li>
667     * </ul>
668     *
669     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
670     */
671    @Test
672    public void testFao() throws FactoryException {
673        important = true;
674        datumName = "Fao";
675        datumCode = 5149;
676        name      = "Fao height";
677        code      = 5751;
678        createAndVerifyVerticalDatum();
679        verifyVerticalCRS();
680    }
681
682    /**
683     * Tests “KOC CD height” vertical CRS creation from the factory.
684     *
685     * <ul>
686     *   <li>EPSG vertical datum code: <b>5188</b></li>
687     *   <li>EPSG vertical datum name: <b>KOC Construction Datum</b></li>
688     *   <li>EPSG vertical CRS code: <b>5790</b></li>
689     *   <li>EPSG vertical CRS name: <b>KOC CD height</b></li>
690     *   <li>Particularly important to E&amp;P industry.</li>
691     * </ul>
692     *
693     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
694     */
695    @Test
696    public void testKOC_CD() throws FactoryException {
697        important = true;
698        datumName = "KOC Construction Datum";
699        datumCode = 5188;
700        name      = "KOC CD height";
701        code      = 5790;
702        createAndVerifyVerticalDatum();
703        verifyVerticalCRS();
704    }
705
706    /**
707     * Tests “KOC WD depth” vertical CRS creation from the factory.
708     *
709     * <ul>
710     *   <li>EPSG vertical datum code: <b>5187</b></li>
711     *   <li>EPSG vertical datum name: <b>KOC Well Datum</b></li>
712     *   <li>EPSG vertical CRS code: <b>5789</b></li>
713     *   <li>EPSG vertical CRS name: <b>KOC WD depth</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 vertical datum or CRS from the EPSG code.
718     */
719    @Test
720    public void testKOC_WD() throws FactoryException {
721        important = true;
722        datumName = "KOC Well Datum";
723        datumCode = 5187;
724        name      = "KOC WD depth";
725        code      = 5789;
726        createAndVerifyVerticalDatum();
727        verifyVerticalCRS();
728    }
729
730    /**
731     * Tests “KOC WD depth (ft)” vertical CRS creation from the factory.
732     *
733     * <ul>
734     *   <li>EPSG vertical datum code: <b>5187</b></li>
735     *   <li>EPSG vertical datum name: <b>KOC Well Datum</b></li>
736     *   <li>EPSG vertical CRS code: <b>5614</b></li>
737     *   <li>EPSG vertical CRS name: <b>KOC WD depth (ft)</b></li>
738     *   <li>Particularly important to E&amp;P industry.</li>
739     * </ul>
740     *
741     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
742     */
743    @Test
744    public void testKOC_WD_ft() throws FactoryException {
745        important = true;
746        datumName = "KOC Well Datum";
747        datumCode = 5187;
748        name      = "KOC WD depth (ft)";
749        code      = 5614;
750        createAndVerifyVerticalDatum();
751        verifyVerticalCRS();
752    }
753
754    /**
755     * Tests “Kuwait PWD height” vertical CRS creation from the factory.
756     *
757     * <ul>
758     *   <li>EPSG vertical datum code: <b>5186</b></li>
759     *   <li>EPSG vertical datum name: <b>Kuwait PWD</b></li>
760     *   <li>EPSG vertical CRS code: <b>5788</b></li>
761     *   <li>EPSG vertical CRS name: <b>Kuwait PWD height</b></li>
762     *   <li>Particularly important to E&amp;P industry.</li>
763     * </ul>
764     *
765     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
766     */
767    @Test
768    public void testKuwaitPWD() throws FactoryException {
769        important = true;
770        datumName = "Kuwait PWD";
771        datumCode = 5186;
772        name      = "Kuwait PWD height";
773        code      = 5788;
774        createAndVerifyVerticalDatum();
775        verifyVerticalCRS();
776    }
777
778    /**
779     * Tests “Lagos 1955 height” vertical CRS creation from the factory.
780     *
781     * <ul>
782     *   <li>EPSG vertical datum code: <b>5194</b></li>
783     *   <li>EPSG vertical datum name: <b>Lagos 1955</b></li>
784     *   <li>EPSG vertical CRS code: <b>5796</b></li>
785     *   <li>EPSG vertical CRS name: <b>Lagos 1955 height</b></li>
786     *   <li>Particularly important to E&amp;P industry.</li>
787     * </ul>
788     *
789     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
790     */
791    @Test
792    public void testLagos() throws FactoryException {
793        important = true;
794        datumName = "Lagos 1955";
795        datumCode = 5194;
796        name      = "Lagos 1955 height";
797        code      = 5796;
798        createAndVerifyVerticalDatum();
799        verifyVerticalCRS();
800    }
801
802    /**
803     * Tests “msl depth” vertical CRS creation from the factory.
804     *
805     * <ul>
806     *   <li>EPSG vertical datum code: <b>5100</b></li>
807     *   <li>EPSG vertical datum name: <b>Mean Sea Level</b></li>
808     *   <li>EPSG vertical CRS code: <b>5715</b></li>
809     *   <li>EPSG vertical CRS name: <b>MSL depth</b></li>
810     *   <li>Particularly important to E&amp;P industry.</li>
811     * </ul>
812     *
813     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
814     */
815    @Test
816    public void testMslDepth() throws FactoryException {
817        important = true;
818        datumName = "Mean Sea Level";
819        datumCode = 5100;
820        name      = "MSL depth";
821        code      = 5715;
822        createAndVerifyVerticalDatum();
823        verifyVerticalCRS();
824    }
825
826    /**
827     * Tests “msl height” vertical CRS creation from the factory.
828     *
829     * <ul>
830     *   <li>EPSG vertical datum code: <b>5100</b></li>
831     *   <li>EPSG vertical datum name: <b>Mean Sea Level</b></li>
832     *   <li>EPSG vertical CRS code: <b>5714</b></li>
833     *   <li>EPSG vertical CRS name: <b>MSL height</b></li>
834     *   <li>Particularly important to E&amp;P industry.</li>
835     * </ul>
836     *
837     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
838     */
839    @Test
840    public void testMslHeight() throws FactoryException {
841        important = true;
842        datumName = "Mean Sea Level";
843        datumCode = 5100;
844        name      = "MSL height";
845        code      = 5714;
846        createAndVerifyVerticalDatum();
847        verifyVerticalCRS();
848    }
849
850    /**
851     * Tests “NAP height” vertical CRS creation from the factory.
852     *
853     * <ul>
854     *   <li>EPSG vertical datum code: <b>5109</b></li>
855     *   <li>EPSG vertical datum name: <b>Normaal Amsterdams Peil</b></li>
856     *   <li>EPSG vertical CRS code: <b>5709</b></li>
857     *   <li>EPSG vertical CRS name: <b>NAP height</b></li>
858     *   <li>Particularly important to E&amp;P industry.</li>
859     * </ul>
860     *
861     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
862     */
863    @Test
864    public void testNAP() throws FactoryException {
865        important = true;
866        datumName = "Normaal Amsterdams Peil";
867        datumCode = 5109;
868        name      = "NAP height";
869        code      = 5709;
870        createAndVerifyVerticalDatum();
871        verifyVerticalCRS();
872    }
873
874    /**
875     * Tests “NAVD88 height” vertical CRS creation from the factory.
876     *
877     * <ul>
878     *   <li>EPSG vertical datum code: <b>5103</b></li>
879     *   <li>EPSG vertical datum name: <b>North American Vertical Datum 1988</b></li>
880     *   <li>EPSG vertical CRS code: <b>5703</b></li>
881     *   <li>EPSG vertical CRS name: <b>NAVD88 height</b></li>
882     *   <li>Particularly important to E&amp;P industry.</li>
883     * </ul>
884     *
885     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
886     */
887    @Test
888    public void testNAVD88() throws FactoryException {
889        important = true;
890        datumName = "North American Vertical Datum 1988";
891        datumCode = 5103;
892        name      = "NAVD88 height";
893        code      = 5703;
894        createAndVerifyVerticalDatum();
895        verifyVerticalCRS();
896    }
897
898    /**
899     * Tests “NGF IGN69 height” vertical CRS creation from the factory.
900     *
901     * <ul>
902     *   <li>EPSG vertical datum code: <b>5119</b></li>
903     *   <li>EPSG vertical datum name: <b>Nivellement General de la France - IGN69</b></li>
904     *   <li>EPSG vertical CRS code: <b>5720</b></li>
905     *   <li>EPSG vertical CRS name: <b>NGF-IGN69 height</b></li>
906     *   <li>Particularly important to E&amp;P industry.</li>
907     * </ul>
908     *
909     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
910     */
911    @Test
912    public void testIGN69() throws FactoryException {
913        important = true;
914        datumName = "Nivellement General de la France - IGN69";
915        datumCode = 5119;
916        name      = "NGF-IGN69 height";
917        code      = 5720;
918        createAndVerifyVerticalDatum();
919        verifyVerticalCRS();
920    }
921
922    /**
923     * Tests “NGF Lallemand height” vertical CRS creation from the factory.
924     *
925     * <ul>
926     *   <li>EPSG vertical datum code: <b>5118</b></li>
927     *   <li>EPSG vertical datum name: <b>Nivellement General de la France - Lallemand</b></li>
928     *   <li>EPSG vertical CRS code: <b>5719</b></li>
929     *   <li>EPSG vertical CRS name: <b>NGF Lallemand height</b></li>
930     *   <li>Particularly important to E&amp;P industry.</li>
931     * </ul>
932     *
933     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
934     */
935    @Test
936    public void testLallemand() throws FactoryException {
937        important = true;
938        datumName = "Nivellement General de la France - Lallemand";
939        datumCode = 5118;
940        name      = "NGF Lallemand height";
941        code      = 5719;
942        createAndVerifyVerticalDatum();
943        verifyVerticalCRS();
944    }
945
946    /**
947     * Tests “NGVD29 height (ftUS)” vertical CRS creation from the factory.
948     *
949     * <ul>
950     *   <li>EPSG vertical datum code: <b>5102</b></li>
951     *   <li>EPSG vertical datum name: <b>National Geodetic Vertical Datum 1929</b></li>
952     *   <li>EPSG vertical CRS code: <b>5702</b></li>
953     *   <li>EPSG vertical CRS name: <b>NGVD29 height (ftUS)</b></li>
954     *   <li>Particularly important to E&amp;P industry.</li>
955     * </ul>
956     *
957     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
958     */
959    @Test
960    public void testNGVD29() throws FactoryException {
961        important = true;
962        datumName = "National Geodetic Vertical Datum 1929";
963        datumCode = 5102;
964        name      = "NGVD29 height (ftUS)";
965        code      = 5702;
966        createAndVerifyVerticalDatum();
967        verifyVerticalCRS();
968    }
969
970    /**
971     * Tests “ODN height” vertical CRS creation from the factory.
972     *
973     * <ul>
974     *   <li>EPSG vertical datum code: <b>5101</b></li>
975     *   <li>EPSG vertical datum name: <b>Ordnance Datum Newlyn</b></li>
976     *   <li>EPSG vertical CRS code: <b>5701</b></li>
977     *   <li>EPSG vertical CRS name: <b>ODN height</b></li>
978     *   <li>Particularly important to E&amp;P industry.</li>
979     * </ul>
980     *
981     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
982     */
983    @Test
984    public void testODN() throws FactoryException {
985        important = true;
986        datumName = "Ordnance Datum Newlyn";
987        datumCode = 5101;
988        name      = "ODN height";
989        code      = 5701;
990        createAndVerifyVerticalDatum();
991        verifyVerticalCRS();
992    }
993
994    /**
995     * Tests “PHD93 height” vertical CRS creation from the factory.
996     *
997     * <ul>
998     *   <li>EPSG vertical datum code: <b>5123</b></li>
999     *   <li>EPSG vertical datum name: <b>PDO Height Datum 1993</b></li>
1000     *   <li>EPSG vertical CRS code: <b>5724</b></li>
1001     *   <li>EPSG vertical CRS name: <b>PHD93 height</b></li>
1002     *   <li>Particularly important to E&amp;P industry.</li>
1003     * </ul>
1004     *
1005     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
1006     */
1007    @Test
1008    public void testPHD93() throws FactoryException {
1009        important = true;
1010        datumName = "PDO Height Datum 1993";
1011        datumCode = 5123;
1012        name      = "PHD93 height";
1013        code      = 5724;
1014        createAndVerifyVerticalDatum();
1015        verifyVerticalCRS();
1016    }
1017
1018    /**
1019     * Tests “Yellow Sea 1956 height” vertical CRS creation from the factory.
1020     *
1021     * <ul>
1022     *   <li>EPSG vertical datum code: <b>5104</b></li>
1023     *   <li>EPSG vertical datum name: <b>Yellow Sea 1956</b></li>
1024     *   <li>EPSG vertical CRS code: <b>5736</b></li>
1025     *   <li>EPSG vertical CRS name: <b>Yellow Sea 1956 height</b></li>
1026     *   <li>Particularly important to E&amp;P industry.</li>
1027     * </ul>
1028     *
1029     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
1030     */
1031    @Test
1032    public void testYellowSea1956() throws FactoryException {
1033        important = true;
1034        datumName = "Yellow Sea 1956";
1035        datumCode = 5104;
1036        name      = "Yellow Sea 1956 height";
1037        code      = 5736;
1038        createAndVerifyVerticalDatum();
1039        verifyVerticalCRS();
1040    }
1041
1042    /**
1043     * Tests “Yellow Sea 1985 height” vertical CRS creation from the factory.
1044     *
1045     * <ul>
1046     *   <li>EPSG vertical datum code: <b>5137</b></li>
1047     *   <li>EPSG vertical datum name: <b>Yellow Sea 1985</b></li>
1048     *   <li>EPSG vertical CRS code: <b>5737</b></li>
1049     *   <li>EPSG vertical CRS name: <b>Yellow Sea 1985 height</b></li>
1050     *   <li>Particularly important to E&amp;P industry.</li>
1051     * </ul>
1052     *
1053     * @throws FactoryException if an error occurred while creating the vertical datum or CRS from the EPSG code.
1054     */
1055    @Test
1056    public void testYellowSea1985() throws FactoryException {
1057        important = true;
1058        datumName = "Yellow Sea 1985";
1059        datumCode = 5137;
1060        name      = "Yellow Sea 1985 height";
1061        code      = 5737;
1062        createAndVerifyVerticalDatum();
1063        verifyVerticalCRS();
1064    }
1065}