Class GIGS3002
-
public class GIGS3002 extends UserObjectFactoryTestCase<Ellipsoid>
Verifies that the software allows correct definition of a user-defined ellipsoid.Test method: Create user-defined ellipsoid for each of several different ellipsoids. Test data: GIGS_3002_userEllipsoid.csv
.Tested API: DatumFactory.createEllipsoid(Map, double, double, Unit)
and
DatumFactory.createFlattenedSphere(Map, double, double, Unit)
.Expected result: The software should accept the test data. The properties of the created objects will be compared with the properties given to the factory method. Usage example: in order to specify their factories and run the tests in a JUnit framework, implementors can define a subclass in their own test suite as in the example below:import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.opengis.test.referencing.gigs.GIGS3002; @RunWith(JUnit4.class) public class MyTest extends GIGS3002 { public MyTest() { super(new MyDatumFactory()); } }
- Since:
- 3.1
-
-
Field Summary
Fields Modifier and Type Field Description Unit<Length>
axisUnit
ThesemiMajorAxis
andsemiMinorAxis
unit of measurement.protected DatumFactory
datumFactory
Factory to use for buildingEllipsoid
instances, ornull
if none.double
inverseFlattening
The inverse flattening factor (dimensionless), orDouble.POSITIVE_INFINITY
if the ellipsoid is a sphere.boolean
isIvfDefinitive
false
if the second defining parameter is thesemiMinorAxis
length, ortrue
if it is theinverseFlattening
.boolean
isSphere
true
if the ellipsoid is a sphere.double
semiMajorAxis
The ellipsoid semi-major axis length, in unit ofaxisUnit
.double
semiMinorAxis
The ellipsoid semi-minor axis length, in unit ofaxisUnit
.-
Fields inherited from class UserObjectFactoryTestCase
isFactoryPreservingUserValues, properties
-
Fields inherited from class TestCase
configurationTip, listener, units, validators
-
-
Constructor Summary
Constructors Constructor Description GIGS3002(DatumFactory datumFactory)
Creates a new test using the given factory.
-
Method Summary
Modifier and Type Method Description 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.Ellipsoid
getIdentifiedObject()
Returns the ellipsoid instance to be tested.void
testAiry()
Tests “GIGS ellipsoid B” flattened sphere creation from the factory.void
testAustralianNationalSpheroid()
Tests “GIGS ellipsoid X” flattened sphere creation from the factory.void
testBessel()
Tests “GIGS ellipsoid C” flattened sphere creation from the factory.void
testClarke1866()
Tests “GIGS ellipsoid J” flattened sphere creation from the factory.void
testClarkeAuthalicSphere()
Tests “GIGS ellipsoid I” sphere creation from the factory.void
testClarkeIGN()
Tests “GIGS ellipsoid H” ellipsoid creation from the factory.void
testGRS1967()
Tests “GIGS ellipsoid K” flattened sphere creation from the factory.void
testGRS1980()
Tests “GIGS ellipsoid F” flattened sphere creation from the factory.void
testInternational1924()
Tests “GIGS ellipsoid E” flattened sphere creation from the factory.void
testKrassowsky()
Tests “GIGS ellipsoid Y” flattened sphere creation from the factory.void
testWGS84()
Tests “GIGS ellipsoid A” flattened sphere creation from the factory.-
Methods inherited from class ReferencingTestCase
verifyCoordinateSystem, verifyFlattenedSphere, verifyGeographicExtent, verifyIdentification, verifyParameter, verifyPrimeMeridian, verifyTimeExtent, verifyVerticalExtent
-
Methods inherited from class TestCase
factories, factories, getEnabledFlags
-
-
-
-
Field Detail
-
semiMajorAxis
public double semiMajorAxis
The ellipsoid semi-major axis length, in unit ofaxisUnit
.
-
semiMinorAxis
public double semiMinorAxis
The ellipsoid semi-minor axis length, in unit ofaxisUnit
.
-
axisUnit
public Unit<Length> axisUnit
ThesemiMajorAxis
andsemiMinorAxis
unit of measurement.
-
inverseFlattening
public double inverseFlattening
The inverse flattening factor (dimensionless), orDouble.POSITIVE_INFINITY
if the ellipsoid is a sphere.
-
isIvfDefinitive
public boolean isIvfDefinitive
false
if the second defining parameter is thesemiMinorAxis
length, ortrue
if it is theinverseFlattening
.
-
isSphere
public boolean isSphere
true
if the ellipsoid is a sphere. In such case,semiMinorAxis
=semiMajorAxis
andinverseFlattening
is infinite.
-
datumFactory
protected final DatumFactory datumFactory
Factory to use for buildingEllipsoid
instances, ornull
if none. This is the factory used by thegetIdentifiedObject()
method.
-
-
Constructor Detail
-
GIGS3002
public GIGS3002(DatumFactory datumFactory)
Creates a new test using the given factory. If a given factory isnull
, then the tests which depend on it will be skipped.- Parameters:
datumFactory
- factory for creatingEllipsoid
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 theTestCase.factories(Class[])
javadoc.- Returns:
- the default set of arguments to be given to the
GIGS3002
constructor.
-
configuration
public Configuration configuration()
Returns information about the configuration of the test which has been run. This method returns a map containing:- All the following values associated to the
Configuration.Key
of the same name:
- Overrides:
configuration
in classUserObjectFactoryTestCase<Ellipsoid>
- Returns:
- the configuration of the test being run.
- See Also:
ImplementationDetails.configuration(Factory[])
- All the following values associated to the
-
getIdentifiedObject
public Ellipsoid getIdentifiedObject() throws FactoryException
Returns the ellipsoid instance to be tested. When this method is invoked for the first time, it creates the ellipsoid to test by invoking the corresponding method fromDatumFactory
with the currentproperties
map in argument. The created object is then cached and returned in all subsequent invocations of this method.- Specified by:
getIdentifiedObject
in classUserObjectFactoryTestCase<Ellipsoid>
- Returns:
- the ellipsoid instance to test.
- Throws:
FactoryException
- if an error occurred while creating the ellipsoid instance.
-
testWGS84
public void testWGS84() throws FactoryException
Tests “GIGS ellipsoid A” flattened sphere creation from the factory.- GIGS ellipsoid code: 67030
- GIGS ellipsoid name: GIGS ellipsoid A
- EPSG equivalence: 7030 – WGS 84
- Semi-major axis (a): 6378137.0 metres
- Semi-minor axis (b): 6356752.314247833 metres
- Inverse flattening (1/f): 298.2572236
- Specific usage / Remarks: Defined using a and 1/f
- Throws:
FactoryException
- if an error occurred while creating the ellipsoid from the properties.- See Also:
GIGS2002.testWGS84()
-
testAiry
public void testAiry() throws FactoryException
Tests “GIGS ellipsoid B” flattened sphere creation from the factory.- GIGS ellipsoid code: 67001
- GIGS ellipsoid name: GIGS ellipsoid B
- EPSG equivalence: 7001 – Airy 1830
- Semi-major axis (a): 6377563.396 metres
- Semi-minor axis (b): 6356256.909237285 metres
- Inverse flattening (1/f): 299.3249646
- Specific usage / Remarks: Defined using a and 1/f
- Throws:
FactoryException
- if an error occurred while creating the ellipsoid from the properties.- See Also:
GIGS2002.testAiry()
-
testBessel
public void testBessel() throws FactoryException
Tests “GIGS ellipsoid C” flattened sphere creation from the factory.- GIGS ellipsoid code: 67004
- GIGS ellipsoid name: GIGS ellipsoid C
- EPSG equivalence: 7004 – Bessel 1841
- Semi-major axis (a): 6377397.155 metres
- Semi-minor axis (b): 6356078.962818189 metres
- Inverse flattening (1/f): 299.1528128
- Specific usage / Remarks: Defined using a and 1/f
- Throws:
FactoryException
- if an error occurred while creating the ellipsoid from the properties.- See Also:
GIGS2002.testBessel()
-
testInternational1924
public void testInternational1924() throws FactoryException
Tests “GIGS ellipsoid E” flattened sphere creation from the factory.- GIGS ellipsoid code: 67022
- GIGS ellipsoid name: GIGS ellipsoid E
- EPSG equivalence: 7022 – International 1924
- Semi-major axis (a): 6378388.0 metres
- Semi-minor axis (b): 6356911.9461279465 metres
- Inverse flattening (1/f): 297
- Specific usage / Remarks: Defined using a and 1/f
- Throws:
FactoryException
- if an error occurred while creating the ellipsoid from the properties.- See Also:
GIGS2002.testInternational1924()
-
testGRS1980
public void testGRS1980() throws FactoryException
Tests “GIGS ellipsoid F” flattened sphere creation from the factory.- GIGS ellipsoid code: 67019
- GIGS ellipsoid name: GIGS ellipsoid F
- EPSG equivalence: 7019 – GRS 1980
- Semi-major axis (a): 6378.137 kilometres (6378137.0 metres)
- Semi-minor axis (b): 6356.7523141402835 kilometres (6356752.3141402835 metres)
- Inverse flattening (1/f): 298.2572221
- Specific usage / Remarks: not metres
- Throws:
FactoryException
- if an error occurred while creating the ellipsoid from the properties.- See Also:
GIGS2002.testGRS1980()
-
testClarkeIGN
public void testClarkeIGN() throws FactoryException
Tests “GIGS ellipsoid H” ellipsoid creation from the factory.- GIGS ellipsoid code: 67011
- GIGS ellipsoid name: GIGS ellipsoid H
- EPSG equivalence: 7011 – Clarke 1880 (IGN)
- Semi-major axis (a): 6378249.2 metres
- Semi-minor axis (b): 6356515.0 metres
- Inverse flattening (1/f): 293.4660212936269
- Specific usage / Remarks: Defined using a and b. Calculated 1/f = 293.4660213
- Throws:
FactoryException
- if an error occurred while creating the ellipsoid from the properties.- See Also:
GIGS2002.testClarkeIGN()
-
testClarkeAuthalicSphere
public void testClarkeAuthalicSphere() throws FactoryException
Tests “GIGS ellipsoid I” sphere creation from the factory.- GIGS ellipsoid code: 67052
- GIGS ellipsoid name: GIGS ellipsoid I
- EPSG equivalence: 7052 – Clarke 1866 Authalic Sphere
- Semi-major axis (a): 6370997.0 metres
- Semi-minor axis (b): 6370997.0 metres
- Inverse flattening (1/f): Infinity
- Specific usage / Remarks: Sphere
- Throws:
FactoryException
- if an error occurred while creating the ellipsoid from the properties.- See Also:
GIGS2002.testClarkeAuthalicSphere()
-
testClarke1866
public void testClarke1866() throws FactoryException
Tests “GIGS ellipsoid J” flattened sphere creation from the factory.- GIGS ellipsoid code: 67008
- GIGS ellipsoid name: GIGS ellipsoid J
- EPSG equivalence: 7008 – Clarke 1866
- Semi-major axis (a): 20925832.16 US survey foot (6378206.4 metres)
- Semi-minor axis (b): 20854892.013176885 US survey foot (6356583.807100443 metres)
- Inverse flattening (1/f): 294.9786982
- Specific usage / Remarks: not metres
- Throws:
FactoryException
- if an error occurred while creating the ellipsoid from the properties.- See Also:
GIGS2002.testClarke1866()
-
testGRS1967
public void testGRS1967() throws FactoryException
Tests “GIGS ellipsoid K” flattened sphere creation from the factory.- GIGS ellipsoid code: 67036
- GIGS ellipsoid name: GIGS ellipsoid K
- EPSG equivalence: 7036 – GRS 1967
- Semi-major axis (a): 6378160.0 metres
- Semi-minor axis (b): 6356774.516088779 metres
- Inverse flattening (1/f): 298.2471674
- Specific usage / Remarks: Defined using a and 1/f
- Throws:
FactoryException
- if an error occurred while creating the ellipsoid from the properties.- See Also:
GIGS2002.testGRS1967()
-
testAustralianNationalSpheroid
public void testAustralianNationalSpheroid() throws FactoryException
Tests “GIGS ellipsoid X” flattened sphere creation from the factory.- GIGS ellipsoid code: 67003
- GIGS ellipsoid name: GIGS ellipsoid X
- EPSG equivalence: 7003 – Australian National Spheroid
- Semi-major axis (a): 6378160.0 metres
- Semi-minor axis (b): 6356774.719195306 metres
- Inverse flattening (1/f): 298.25
- Specific usage / Remarks: Defined using a and 1/f
- Throws:
FactoryException
- if an error occurred while creating the ellipsoid from the properties.- See Also:
GIGS2002.testAustralianNationalSpheroid()
-
testKrassowsky
public void testKrassowsky() throws FactoryException
Tests “GIGS ellipsoid Y” flattened sphere creation from the factory.- GIGS ellipsoid code: 67024
- GIGS ellipsoid name: GIGS ellipsoid Y
- EPSG equivalence: 7024 – Krassowsky 1940
- Semi-major axis (a): 6378245.0 metres
- Semi-minor axis (b): 6356863.018773047 metres
- Inverse flattening (1/f): 298.3
- Specific usage / Remarks: Defined using a and 1/f
- Throws:
FactoryException
- if an error occurred while creating the ellipsoid from the properties.- See Also:
GIGS2002.testKrassowsky()
-
-