Package org.opengis.test.referencing
Class AuthorityFactoryTest
- Object
-
- TestCase
-
- ReferencingTestCase
-
- AuthorityFactoryTest
-
public class AuthorityFactoryTest extends ReferencingTestCase
Tests the creation of referencing objects from the authority factories given at construction time.Many
ProjectedCRS
instances tested in this class use the same projections than theMathTransform
instances tested inParameterizedTransformTest
. However the later test class expects (λ,φ) input ordinates in degrees and (x,y) output ordinates in metres, while thisAuthorityFactoryTest
class expects input and output ordinates in CRS-dependent units and axis order.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.AuthorityFactoryTest; @RunWith(JUnit4.class) public class MyTest extends AuthorityFactoryTest { public MyTest() { super(new MyCRSAuthorityFactory(), new MyCSAuthorityFactory(), new MyDatumAuthorityFactory()); } }
- Since:
- 2.3
- See Also:
ObjectFactoryTest
,ParameterizedTransformTest
,TestSuite
-
-
Field Summary
Fields Modifier and Type Field Description protected CRSAuthorityFactory
crsAuthorityFactory
Factory to use for buildingCoordinateReferenceSystem
instances, ornull
if none.protected CSAuthorityFactory
csAuthorityFactory
Factory to use for buildingCoordinateSystem
instances, ornull
if none.protected DatumAuthorityFactory
datumAuthorityFactory
Factory to use for buildingDatum
instances, ornull
if none.protected boolean
isAxisSwappingSupported
true
ifcrsAuthorityFactory
andcsAuthorityFactory
supports the creation of coordinate system with (y,x) axis order.protected IdentifiedObject
object
The identified object (typically aCoordinateReferenceSystem
) 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, units, validators
-
-
Constructor Summary
Constructors Constructor Description AuthorityFactoryTest(CRSAuthorityFactory crsFactory, CSAuthorityFactory csFactory, DatumAuthorityFactory datumFactory)
Creates a new test using the given factories.
-
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.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:4326GeographicCRS
.-
Methods inherited from class ReferencingTestCase
verifyCoordinateSystem, verifyFlattenedSphere, verifyGeographicExtent, verifyIdentification, verifyParameter, verifyPrimeMeridian, verifyTimeExtent, verifyVerticalExtent
-
Methods inherited from class TestCase
factories, factories, getEnabledFlags
-
-
-
-
Field Detail
-
crsAuthorityFactory
protected final CRSAuthorityFactory crsAuthorityFactory
Factory to use for buildingCoordinateReferenceSystem
instances, ornull
if none.
-
csAuthorityFactory
protected final CSAuthorityFactory csAuthorityFactory
Factory to use for buildingCoordinateSystem
instances, ornull
if none.
-
datumAuthorityFactory
protected final DatumAuthorityFactory datumAuthorityFactory
Factory to use for buildingDatum
instances, ornull
if none.
-
object
protected IdentifiedObject object
The identified object (typically aCoordinateReferenceSystem
) 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 ofGeographicCRS
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 ofProjectedCRS
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
ifcrsAuthorityFactory
andcsAuthorityFactory
supports the creation of coordinate system with (y,x) axis order. If this field is set tofalse
, 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 isnull
, then the tests which depend on it will be skipped.- Parameters:
crsFactory
- factory for creatingCoordinateReferenceSystem
instances.csFactory
- factory for creatingCoordinateSystem
instances.datumFactory
- factory for creatingDatum
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
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:- All the entries defined in the
ParameterizedTransformTest
class exceptmtFactory
. - All the following values associated to the
Configuration.Key
of the same name:
- Overrides:
configuration
in classTestCase
- Returns:
- the configuration of the test being run, or an empty map if none.
- Since:
- 3.1
- See Also:
ImplementationDetails.configuration(Factory[])
- All the entries defined in the
-
testWGS84
public void testWGS84() throws NoSuchAuthorityCodeException, FactoryException
Tests the creation of the EPSG:4326GeographicCRS
.- Throws:
NoSuchAuthorityCodeException
- if the specified code is not found among the ones present in the database.FactoryException
- if the creation of theCoordinateReferenceSystem
failed for an other raison.
-
testEPSG_3002
public void testEPSG_3002() throws FactoryException, TransformException
Tests the EPSG:3002 (Makassar / NEIEZ) projected CRS.CRS characteristics 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.CRS characteristics 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.CRS characteristics 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.CRS characteristics 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.CRS characteristics 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.CRS characteristics 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.CRS characteristics 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.CRS characteristics 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.CRS characteristics 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.CRS characteristics 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.CRS characteristics 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.CRS characteristics 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.CRS characteristics 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.CRS characteristics 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.CRS characteristics 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.CRS characteristics 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()
-
-