Package org.opengis.test.referencing
Class AuthorityFactoryTest
Object
TestCase
ReferencingTestCase
AuthorityFactoryTest
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 as the
MathTransform
instances tested in ParameterizedTransformTest
. However, the latter
test class expects (λ,φ) input coordinates in degrees and (x,y)
output coordinates in metres, while this AuthorityFactoryTest
class expects
input and output coordinates in CRS-dependent units and axis order.
Usage example:
in order to specify their factories and run the tests in a JUnit framework, implementers can define a subclass in their own test suite as in the example below:import org.opengis.test.referencing.AuthorityFactoryTest;
public class MyTest extends AuthorityFactoryTest {
public MyTest() {
super(new MyCRSAuthorityFactory(), new MyCSAuthorityFactory(), new MyDatumAuthorityFactory());
}
}
- Since:
- 2.3
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CRSAuthorityFactory
Factory to use for buildingCoordinateReferenceSystem
instances, ornull
if none.protected final CSAuthorityFactory
Factory to use for buildingCoordinateSystem
instances, ornull
if none.protected final DatumAuthorityFactory
Factory to use for buildingDatum
instances, ornull
if none.protected boolean
true
ifcrsAuthorityFactory
andcsAuthorityFactory
supports the creation of coordinate system with (y,x) axis order.protected IdentifiedObject
The identified object (typically aCoordinateReferenceSystem
) being tested.protected double
The expected prime meridian of the CRS being tested, in decimal degrees from Greenwich.protected boolean
true
if the easting and northing axes shall be swapped.protected boolean
true
if the longitude and latitude axes shall be swapped.protected double
Conversion factor from degrees to the CRS-specific angular units.protected double
Conversion factor from metres to the CRS-specific linear units.Fields inherited from class org.opengis.test.TestCase
configurationTip, units, validators
-
Constructor Summary
ConstructorsConstructorDescriptionAuthorityFactoryTest
(CRSAuthorityFactory crsFactory, CSAuthorityFactory csFactory, DatumAuthorityFactory datumFactory) Creates a new test using the given factories. -
Method Summary
Modifier and TypeMethodDescriptionReturns information about the configuration of the test which has been run.void
Tests the EPSG:2065 (CRS S-JTSK (Ferro) / Krovak) projected CRS.void
Tests the EPSG:2314 (Trinidad 1903 / Trinidad Grid) projected CRS.void
Tests the EPSG:24200 (JAD69 / Jamaica National Grid) projected CRS.void
Tests the EPSG:27700 (OSGB 1936 / British National Grid) projected CRS.void
Tests the EPSG:28992 (Amersfoort / RD New) projected CRS.void
Tests the EPSG:29873 (Timbalai 1948 / RSO Borneo (m)) projected CRS.void
Tests the EPSG:3002 (Makassar / NEIEZ) projected CRS.void
Tests the EPSG:3032 (WGS 84 / Australian Antarctic Polar Stereographic) projected CRS.void
Tests the EPSG:3035 (ETRS89 / LAEA Europe) projected CRS.void
Tests the EPSG:31300 (Belge 1972 / Belge Lambert 72) projected CRS.void
Tests the EPSG:3139 (Vanua Levu 1915 / Vanua Levu Grid) projected CRS.void
Tests the EPSG:32040 (NAD27 / Texas South Central) projected CRS.void
Tests the EPSG:32661 (WGS 84 / UPS North (N,E)) projected CRS.void
Tests the EPSG:3388 (Pulkovo 1942 / Caspian Sea Mercator) projected CRS.void
Tests the EPSG:3857 (WGS 84 / Pseudo-Mercator) projected CRS.void
Tests the EPSG:5041 (WGS 84 / UPS North (E,N)) projected CRS.void
Tests the creation of the EPSG:4326GeographicCRS
.Methods inherited from class org.opengis.test.referencing.ReferencingTestCase
verifyCoordinateSystem, verifyFlattenedSphere, verifyGeographicExtent, verifyIdentification, verifyParameter, verifyPrimeMeridian, verifyTimeExtent, verifyVerticalExtent
Methods inherited from class org.opengis.test.TestCase
getEnabledFlags
-
Field Details
-
crsAuthorityFactory
Factory to use for buildingCoordinateReferenceSystem
instances, ornull
if none. -
csAuthorityFactory
Factory to use for buildingCoordinateSystem
instances, ornull
if none. -
datumAuthorityFactory
Factory to use for buildingDatum
instances, ornull
if none. -
object
The identified object (typically aCoordinateReferenceSystem
) being tested. Every test methods in this class will set this field to a non-null value. Implementers can use this value for their own assertions after any test has been run.- Since:
- 3.1
-
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
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
The expected prime meridian of the CRS being tested, in decimal degrees from Greenwich.Default value:
0.0
.- Since:
- 3.1
-
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
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
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 Details
-
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 Details
-
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
- All the entries defined in the
-
testWGS84
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 another reason.
-
testEPSG_3002
Tests the EPSG:3002 (Makassar / NEIEZ) projected CRS.CRS characteristics Projection method: Mercator (variant A) Prime meridian: Greenwich Source coordinates: (φ,λ) in degrees Output coordinates: (x,y) in metres - Throws:
FactoryException
- if the math transform cannot be created.TransformException
- if the example point cannot be transformed.- See Also:
-
testEPSG_3388
Tests the EPSG:3388 (Pulkovo 1942 / Caspian Sea Mercator) projected CRS.CRS characteristics Projection method: Mercator (variant B) Prime meridian: Greenwich Source coordinates: (φ,λ) in degrees Output coordinates: (y,x) in metres - note the axis order! - Throws:
FactoryException
- if the math transform cannot be created.TransformException
- if the example point cannot be transformed.- See Also:
-
testEPSG_3857
Tests the EPSG:3857 (WGS 84 / Pseudo-Mercator) projected CRS.CRS characteristics Projection method: Mercator Popular Visualisation Pseudo Mercator Prime meridian: Greenwich Source coordinates: (φ,λ) in degrees Output coordinates: (x,y) in metres - Throws:
FactoryException
- if the math transform cannot be created.TransformException
- if the example point cannot be transformed.- See Also:
-
testEPSG_29873
Tests the EPSG:29873 (Timbalai 1948 / RSO Borneo (m)) projected CRS.CRS characteristics Projection method: Hotine Oblique Mercator (variant B) Prime meridian: Greenwich Source coordinates: (φ,λ) in degrees Output coordinates: (x,y) in metres - Throws:
FactoryException
- if the math transform cannot be created.TransformException
- if the example point cannot be transformed.- See Also:
-
testEPSG_27700
Tests the EPSG:27700 (OSGB 1936 / British National Grid) projected CRS.CRS characteristics Projection method: Transverse Mercator Prime meridian: Greenwich Source coordinates: (φ,λ) in degrees Output coordinates: (x,y) in metres - Throws:
FactoryException
- if the math transform cannot be created.TransformException
- if the example point cannot be transformed.- See Also:
-
testEPSG_2314
Tests the EPSG:2314 (Trinidad 1903 / Trinidad Grid) projected CRS.CRS characteristics Projection method: Cassini-Soldner Prime meridian: Greenwich Source coordinates: (φ,λ) in degrees Output coordinates: (x,y) in Clarke's foot - note the units! - Throws:
FactoryException
- if the math transform cannot be created.TransformException
- if the example point cannot be transformed.- See Also:
-
testEPSG_3139
Tests the EPSG:3139 (Vanua Levu 1915 / Vanua Levu Grid) projected CRS.CRS characteristics Projection method: Hyperbolic Cassini-Soldner Prime meridian: Greenwich Source coordinates: (φ,λ) in degrees Output coordinates: (x,y) in links - note the units! - Throws:
FactoryException
- if the math transform cannot be created.TransformException
- if the example point cannot be transformed.- See Also:
-
testEPSG_24200
Tests the EPSG:24200 (JAD69 / Jamaica National Grid) projected CRS.CRS characteristics Projection method: Lambert Conic Conformal (1SP) Prime meridian: Greenwich Source coordinates: (φ,λ) in degrees Output coordinates: (x,y) in metres - Throws:
FactoryException
- if the math transform cannot be created.TransformException
- if the example point cannot be transformed.- See Also:
-
testEPSG_32040
Tests the EPSG:32040 (NAD27 / Texas South Central) projected CRS.CRS characteristics Projection method: Lambert Conic Conformal (2SP) Prime meridian: Greenwich Source coordinates: (φ,λ) in degrees Output coordinates: (x,y) in US feet - note the units! - Throws:
FactoryException
- if the math transform cannot be created.TransformException
- if the example point cannot be transformed.- See Also:
-
testEPSG_31300
Tests the EPSG:31300 (Belge 1972 / Belge Lambert 72) projected CRS.CRS characteristics Projection method: Lambert Conic Conformal (2SP Belgium) Prime meridian: Greenwich Source coordinates: (φ,λ) in degrees Output coordinates: (x,y) in metres - Throws:
FactoryException
- if the math transform cannot be created.TransformException
- if the example point cannot be transformed.- See Also:
-
testEPSG_3035
Tests the EPSG:3035 (ETRS89 / LAEA Europe) projected CRS.CRS characteristics Projection method: Lambert Azimuthal Equal Area Prime meridian: Greenwich Source coordinates: (φ,λ) in degrees Output coordinates: (y,x) in metres - note the axis order! - Throws:
FactoryException
- if the math transform cannot be created.TransformException
- if the example point cannot be transformed.- See Also:
-
testEPSG_5041
Tests the EPSG:5041 (WGS 84 / UPS North (E,N)) projected CRS.CRS characteristics Projection method: Polar Stereographic (variant A) Prime meridian: Greenwich Source coordinates: (φ,λ) in degrees Output coordinates: (x,y) in metres - Throws:
FactoryException
- if the math transform cannot be created.TransformException
- if the example point cannot be transformed.- See Also:
-
testEPSG_32661
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 coordinates: (φ,λ) in degrees Output coordinates: (y,x) in metres - note the axis order! - Throws:
FactoryException
- if the math transform cannot be created.TransformException
- if the example point cannot be transformed.- See Also:
-
testEPSG_3032
Tests the EPSG:3032 (WGS 84 / Australian Antarctic Polar Stereographic) projected CRS.CRS characteristics Projection method: Polar Stereographic (variant B) Prime meridian: Greenwich Source coordinates: (φ,λ) in degrees Output coordinates: (x,y) in metres - Throws:
FactoryException
- if the math transform cannot be created.TransformException
- if the example point cannot be transformed.- See Also:
-
testEPSG_28992
Tests the EPSG:28992 (Amersfoort / RD New) projected CRS.CRS characteristics Projection method: Oblique Stereographic Prime meridian: Greenwich Source coordinates: (φ,λ) in degrees Output coordinates: (x,y) in metres - Throws:
FactoryException
- if the math transform cannot be created.TransformException
- if the example point cannot be transformed.- See Also:
-
testEPSG_2065
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 coordinates: (φ,λ) in degrees Output coordinates: (y,x) in metres, south oriented (S,W) - Throws:
FactoryException
- if the math transform cannot be created.TransformException
- if the example point cannot be transformed.- See Also:
-