org.opengis.test.referencing
Class AuthorityFactoryTest

Show UML class diagram
Object
  extended by TestCase
      extended by AuthorityFactoryTest

public class AuthorityFactoryTest
extends TestCase

Tests the creation of referencing objects from the authority factories given at construction time.

In order to specify their factories and run the tests in a JUnit framework, implementors can define a subclass as below:

import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.opengis.test.referencing.AuthorityFactoryTest;

@RunWith(JUnit4.class)
public class MyTest extends AuthorityFactoryTest {
    public MyTest() {
        super(new MyCRSAuthorityFactory(), new MyCSAuthorityFactory(), new MyDatumAuthorityFactory());
    }
}
Alternatively this test class can also be used directly in the TestSuite, which combine every tests defined in the GeoAPI conformance module.

Many ProjectedCRS instances tested in this class use the same projections than the MathTransform instances tested in ParameterizedTransformTest. However the later test class expects (λ,φ) input ordinates in degrees and (x,y) output ordinates in metres, while this AuthorityFactoryTest class expects input and output ordinates in CRS-dependent units and axis order.

Since:
2.3
See Also:
ObjectFactoryTest, ParameterizedTransformTest, TestSuite

Field Summary
protected  CRSAuthorityFactory crsAuthorityFactory
          Factory to use for building CoordinateReferenceSystem instances, or null if none.
protected  CSAuthorityFactory csAuthorityFactory
          Factory to use for building CoordinateSystem instances, or null if none.
protected  DatumAuthorityFactory datumAuthorityFactory
          Factory to use for building Datum instances, or null if none.
protected  boolean isAxisSwappingSupported
          true if crsAuthorityFactory and csAuthorityFactory supports the creation of coordinate system with (y,x) axis order.
protected  IdentifiedObject object
          The identified object (typically a CoordinateReferenceSystem) being tested.
protected  double primeMeridian
          The expected prime meridian of the CRS being tested, in decimal degrees from Greenwich.
protected  boolean swapxy
          true If the easting and northing axes shall be swapped.
protected  boolean swapλφ
          true if the longitude and latitude axes shall be swapped.
protected  double toAngularUnit
          Conversion factor from degrees to the CRS-specific angular units.
protected  double toLinearUnit
          Conversion factor from metres to the CRS-specific linear units.
 
Fields inherited from class TestCase
configurationTip, listener, NO_FACTORY, validators
 
Constructor Summary
AuthorityFactoryTest(CRSAuthorityFactory crsFactory, CSAuthorityFactory csFactory, DatumAuthorityFactory datumFactory)
          Creates a new test using the given factories.
 
Method Summary
 Configuration configuration()
          Returns information about the configuration of the test which has been run.
static List<Factory[]> factories()
          Returns a default set of factories to use for running the tests.
 void testEPSG_2065()
          Tests the EPSG:2065 (CRS S-JTSK (Ferro) / Krovak) projected CRS.
 void testEPSG_2314()
          Tests the EPSG:2314 (Trinidad 1903 / Trinidad Grid) projected CRS.
 void testEPSG_24200()
          Tests the EPSG:24200 (JAD69 / Jamaica National Grid) projected CRS.
 void testEPSG_27700()
          Tests the EPSG:27700 (OSGB 1936 / British National Grid) projected CRS.
 void testEPSG_28992()
          Tests the EPSG:28992 (Amersfoort / RD New) projected CRS.
 void testEPSG_29873()
          Tests the EPSG:29873 (Timbalai 1948 / RSO Borneo (m)) projected CRS.
 void testEPSG_3002()
          Tests the EPSG:3002 (Makassar / NEIEZ) projected CRS.
 void testEPSG_3032()
          Tests the EPSG:3032 (WGS 84 / Australian Antarctic Polar Stereographic) projected CRS.
 void testEPSG_3035()
          Tests the EPSG:3035 (ETRS89 / LAEA Europe) projected CRS.
 void testEPSG_31300()
          Tests the EPSG:31300 (Belge 1972 / Belge Lambert 72) projected CRS.
 void testEPSG_32040()
          Tests the EPSG:32040 (NAD27 / Texas South Central) projected CRS.
 void testEPSG_32661()
          Tests the EPSG:32661 (WGS 84 / UPS North (N,E)) projected CRS.
 void testEPSG_3388()
          Tests the EPSG:3388 (Pulkovo 1942 / Caspian Sea Mercator) projected CRS.
 void testEPSG_3857()
          Tests the EPSG:3857 (WGS 84 / Pseudo-Mercator) projected CRS.
 void testEPSG_5041()
          Tests the EPSG:5041 (WGS 84 / UPS North (E,N)) projected CRS.
 void testIGNF_MILLER()
          Tests the IGNF:MILLER (unofficial EPSG:310642901 code) projected CRS.
 void testWGS84()
          Tests the creation of the EPSG:4326 GeographicCRS.
 
Methods inherited from class TestCase
addTestListener, factories, factories, getEnabledFlags, removeTestListener
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

crsAuthorityFactory

protected final CRSAuthorityFactory crsAuthorityFactory
Factory to use for building CoordinateReferenceSystem instances, or null if none.


csAuthorityFactory

protected final CSAuthorityFactory csAuthorityFactory
Factory to use for building CoordinateSystem instances, or null if none.


datumAuthorityFactory

protected final DatumAuthorityFactory datumAuthorityFactory
Factory to use for building Datum instances, or null if none.


object

protected IdentifiedObject object
The identified object (typically a CoordinateReferenceSystem) being tested. Every test methods in this class will set this field to a non-null value. Implementors can use this value for their own assertions after any test has been run.

Since:
3.1

swapλφ

protected boolean swapλφ
true if the longitude and latitude axes shall be swapped. This flag applies only to geographic coordinates.

Default value: true, since the majority of GeographicCRS defined in the EPSG database uses the (φλ) axis order.

Since:
3.1

swapxy

protected boolean swapxy
true If the easting and northing axes shall be swapped. This flag applies only to projected coordinates.

Default value: false, since the majority of ProjectedCRS defined in the EPSG database uses the (x,y) axis order.

Since:
3.1

primeMeridian

protected double primeMeridian
The expected prime meridian of the CRS being tested, in decimal degrees from Greenwich.

Default value: 0.0.

Since:
3.1

toAngularUnit

protected double toAngularUnit
Conversion factor from degrees to the CRS-specific angular units. This value is different than one when the latitude or longitude angles need to be converted from degrees before to run a test.

Default value: 1.0.

Since:
3.1

toLinearUnit

protected double toLinearUnit
Conversion factor from metres to the CRS-specific linear units. This value is different than one when the easting or northing values need to be converted from metres before to run a test.

Default value: 1.0.

Since:
3.1

isAxisSwappingSupported

protected boolean isAxisSwappingSupported
true if crsAuthorityFactory and csAuthorityFactory supports the creation of coordinate system with (y,x) axis order. If this field is set to false, then the tests that would normally expect (y,x) axis order or South Oriented CRS will rather use the (x,y) axis order and North Oriented CRS in their test.

Since:
3.1
Constructor Detail

AuthorityFactoryTest

public AuthorityFactoryTest(CRSAuthorityFactory crsFactory,
                            CSAuthorityFactory csFactory,
                            DatumAuthorityFactory datumFactory)
Creates a new test using the given factories. If a given factory is null, then the tests which depend on it will be skipped.

Parameters:
crsFactory - Factory for creating CoordinateReferenceSystem instances.
csFactory - Factory for creating CoordinateSystem instances.
datumFactory - Factory for creating Datum instances.
Method Detail

factories

public static List<Factory[]> factories()
Returns a default set of factories to use for running the tests. Those factories are given in arguments to the constructor when this test class is instantiated directly by JUnit (for example as a suite element), instead than subclassed by the implementor. The factories are fetched as documented in the TestCase.factories(Class[]) javadoc.

Returns:
The default set of arguments to be given to the AuthorityFactoryTest constructor.
Since:
3.1

configuration

public Configuration configuration()
Returns information about the configuration of the test which has been run. This method returns a map containing:

Overrides:
configuration in class TestCase
Returns:
The configuration of the test being run, or an empty map if none. This method returns a modifiable map in order to allow subclasses to modify it.
Since:
3.1
See Also:
ImplementationDetails.configuration(Factory[])

testWGS84

public void testWGS84()
               throws NoSuchAuthorityCodeException,
                      FactoryException
Tests the creation of the EPSG:4326 GeographicCRS.

Throws:
NoSuchAuthorityCodeException - If the specified code is not found among the ones present in the database.
FactoryException - If the creation of the CoordinateReferenceSystem failed for an other raison.

testEPSG_3002

public void testEPSG_3002()
                   throws FactoryException,
                          TransformException
Tests the EPSG:3002 (Makassar / NEIEZ) projected CRS.
Projection method: Mercator (variant A)
Prime meridian: Greenwich
Source ordinates: (φ,λ) in degrees
Output ordinates: (x,y) in metres

Throws:
FactoryException - If the math transform can not be created.
TransformException - If the example point can not be transformed.
See Also:
ParameterizedTransformTest.testMercator1SP()

testEPSG_3388

public void testEPSG_3388()
                   throws FactoryException,
                          TransformException
Tests the EPSG:3388 (Pulkovo 1942 / Caspian Sea Mercator) projected CRS.
Projection method: Mercator (variant B)
Prime meridian: Greenwich
Source ordinates: (φ,λ) in degrees
Output ordinates: (y,x) in metres - note the axis order!

Throws:
FactoryException - If the math transform can not be created.
TransformException - If the example point can not be transformed.
See Also:
ParameterizedTransformTest.testMercator2SP()

testEPSG_3857

public void testEPSG_3857()
                   throws FactoryException,
                          TransformException
Tests the EPSG:3857 (WGS 84 / Pseudo-Mercator) projected CRS.
Projection method: Mercator Popular Visualisation Pseudo Mercator
Prime meridian: Greenwich
Source ordinates: (φ,λ) in degrees
Output ordinates: (x,y) in metres

Throws:
FactoryException - If the math transform can not be created.
TransformException - If the example point can not be transformed.
See Also:
ParameterizedTransformTest.testPseudoMercator()

testIGNF_MILLER

public void testIGNF_MILLER()
                     throws FactoryException,
                            TransformException
Tests the IGNF:MILLER (unofficial EPSG:310642901 code) projected CRS.
Projection method: Miller
Prime meridian: Greenwich
Source ordinates: (φ,λ) in degrees
Output ordinates: (x,y) in metres

Throws:
FactoryException - If the math transform can not be created.
TransformException - If the example point can not be transformed.
See Also:
ParameterizedTransformTest.testMiller()

testEPSG_29873

public void testEPSG_29873()
                    throws FactoryException,
                           TransformException
Tests the EPSG:29873 (Timbalai 1948 / RSO Borneo (m)) projected CRS.
Projection method: Hotine Oblique Mercator (variant B)
Prime meridian: Greenwich
Source ordinates: (φ,λ) in degrees
Output ordinates: (x,y) in metres

Throws:
FactoryException - If the math transform can not be created.
TransformException - If the example point can not be transformed.
See Also:
ParameterizedTransformTest.testHotineObliqueMercator()

testEPSG_27700

public void testEPSG_27700()
                    throws FactoryException,
                           TransformException
Tests the EPSG:27700 (OSGB 1936 / British National Grid) projected CRS.
Projection method: Transverse Mercator
Prime meridian: Greenwich
Source ordinates: (φ,λ) in degrees
Output ordinates: (x,y) in metres

Throws:
FactoryException - If the math transform can not be created.
TransformException - If the example point can not be transformed.
See Also:
ParameterizedTransformTest.testTransverseMercator()

testEPSG_2314

public void testEPSG_2314()
                   throws FactoryException,
                          TransformException
Tests the EPSG:2314 (Trinidad 1903 / Trinidad Grid) projected CRS.
Projection method: Cassini-Soldner
Prime meridian: Greenwich
Source ordinates: (φ,λ) in degrees
Output ordinates: (x,y) in Clarke's foot - note the units!

Throws:
FactoryException - If the math transform can not be created.
TransformException - If the example point can not be transformed.
See Also:
ParameterizedTransformTest.testCassiniSoldner()

testEPSG_24200

public void testEPSG_24200()
                    throws FactoryException,
                           TransformException
Tests the EPSG:24200 (JAD69 / Jamaica National Grid) projected CRS.
Projection method: Lambert Conic Conformal (1SP)
Prime meridian: Greenwich
Source ordinates: (φ,λ) in degrees
Output ordinates: (x,y) in metres

Throws:
FactoryException - If the math transform can not be created.
TransformException - If the example point can not be transformed.
See Also:
ParameterizedTransformTest.testLambertConicConformal1SP()

testEPSG_32040

public void testEPSG_32040()
                    throws FactoryException,
                           TransformException
Tests the EPSG:32040 (NAD27 / Texas South Central) projected CRS.
Projection method: Lambert Conic Conformal (2SP)
Prime meridian: Greenwich
Source ordinates: (φ,λ) in degrees
Output ordinates: (x,y) in US feet - note the units!

Throws:
FactoryException - If the math transform can not be created.
TransformException - If the example point can not be transformed.
See Also:
ParameterizedTransformTest.testLambertConicConformal2SP()

testEPSG_31300

public void testEPSG_31300()
                    throws FactoryException,
                           TransformException
Tests the EPSG:31300 (Belge 1972 / Belge Lambert 72) projected CRS.
Projection method: Lambert Conic Conformal (2SP Belgium)
Prime meridian: Greenwich
Source ordinates: (φ,λ) in degrees
Output ordinates: (x,y) in metres

Throws:
FactoryException - If the math transform can not be created.
TransformException - If the example point can not be transformed.
See Also:
ParameterizedTransformTest.testLambertConicConformalBelgium()

testEPSG_3035

public void testEPSG_3035()
                   throws FactoryException,
                          TransformException
Tests the EPSG:3035 (ETRS89 / LAEA Europe) projected CRS.
Projection method: Lambert Azimuthal Equal Area
Prime meridian: Greenwich
Source ordinates: (φ,λ) in degrees
Output ordinates: (y,x) in metres - note the axis order!

Throws:
FactoryException - If the math transform can not be created.
TransformException - If the example point can not be transformed.
See Also:
ParameterizedTransformTest.testLambertAzimuthalEqualArea()

testEPSG_5041

public void testEPSG_5041()
                   throws FactoryException,
                          TransformException
Tests the EPSG:5041 (WGS 84 / UPS North (E,N)) projected CRS.
Projection method: Polar Stereographic (variant A)
Prime meridian: Greenwich
Source ordinates: (φ,λ) in degrees
Output ordinates: (x,y) in metres

Throws:
FactoryException - If the math transform can not be created.
TransformException - If the example point can not be transformed.
See Also:
ParameterizedTransformTest.testPolarStereographicA()

testEPSG_32661

public void testEPSG_32661()
                    throws FactoryException,
                           TransformException
Tests the EPSG:32661 (WGS 84 / UPS North (N,E)) projected CRS. This CRS is identical to EPSG:5041 except for axis order.
Projection method: Polar Stereographic (variant A)
Prime meridian: Greenwich
Source ordinates: (φ,λ) in degrees
Output ordinates: (y,x) in metres - note the axis order!

Throws:
FactoryException - If the math transform can not be created.
TransformException - If the example point can not be transformed.
See Also:
ParameterizedTransformTest.testPolarStereographicA()

testEPSG_3032

public void testEPSG_3032()
                   throws FactoryException,
                          TransformException
Tests the EPSG:3032 (WGS 84 / Australian Antarctic Polar Stereographic) projected CRS.
Projection method: Polar Stereographic (variant B)
Prime meridian: Greenwich
Source ordinates: (φ,λ) in degrees
Output ordinates: (x,y) in metres

Throws:
FactoryException - If the math transform can not be created.
TransformException - If the example point can not be transformed.
See Also:
ParameterizedTransformTest.testPolarStereographicB()

testEPSG_28992

public void testEPSG_28992()
                    throws FactoryException,
                           TransformException
Tests the EPSG:28992 (Amersfoort / RD New) projected CRS.
Projection method: Oblique Stereographic
Prime meridian: Greenwich
Source ordinates: (φ,λ) in degrees
Output ordinates: (x,y) in metres

Throws:
FactoryException - If the math transform can not be created.
TransformException - If the example point can not be transformed.
See Also:
ParameterizedTransformTest.testObliqueStereographic()

testEPSG_2065

public void testEPSG_2065()
                   throws FactoryException,
                          TransformException
Tests the EPSG:2065 (CRS S-JTSK (Ferro) / Krovak) projected CRS.
Projection method: Krovak
Prime meridian: Ferro (17°40'W from Greenwich)
Source ordinates: (φ,λ) in degrees
Output ordinates: (y,x) in metres, south oriented (S,W)

Throws:
FactoryException - If the math transform can not be created.
TransformException - If the example point can not be transformed.
See Also:
ParameterizedTransformTest.testKrovak()


Copyright © 1994-2013 Open Geospatial Consortium. All Rights Reserved.