Package org.iogp.gigs

Class Test2201

Object
IntegrityTest
Series2000<Unit<?>>
Test2201

@DisplayName("Unit") public class Test2201 extends Series2000<Unit<?>>
Verifies reference units of measure bundled with the geoscience software.
Test description
Test method: Compare unit definitions included in the software against the EPSG Dataset.
Test data: GIGS_lib_2201_Unit.txt and EPSG Dataset. Contains EPSG code and name for the unit of measure, together with the ratio of the unit to the ISO base unit for that unit type. The test methods are separated in three blocks for linear units, angular units and scaling units.
Tested API: CSAuthorityFactory.createUnit(String).
Expected result: Unit of measure definitions bundled with software should have the ratio to the appropriate base unit as in the EPSG Dataset. The values of the base unit per unit should be correct to at least 10 significant figures. Units missing from the software or at variance with those in the EPSG Dataset should be reported.

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:
public class MyTest extends Test2201 {
    public MyTest() {
        super(new MyCSAuthorityFactory());
    }
}
Since:
1.0
  • Field Details

    • unitToBase

      public double unitToBase
      Amount of base units in one tested unit. If this amount is not a constant (as in sexagesimal unit), then this factor is set to Double.NaN. This field is set by all test methods before to create and verify the Unit instance.
    • baseUnit

      public Unit<?> baseUnit
      The base unit of the unit to create. This field will have one of the following values:
      • Units.metre() if the unit to create is linear,
      • Units.radian() if the unit to create is angular (except sexagesimal unit),
      • Units.one() if the unit to create is a scale or a coefficient, or
      • (exceptionally) Units.degree() in the special case of EPSG_9110(). Note that sexagesimal units also have the ratio of the unit to base unit set to Double.NaN.
      This field is set by all test methods before to create and verify the Unit instance.
    • csAuthorityFactory

      protected final CSAuthorityFactory csAuthorityFactory
      Factory to use for building Unit instances, or null if none. This is the factory used by the getIdentifiedObject() method.
  • Constructor Details

    • Test2201

      public Test2201(CSAuthorityFactory csFactory)
      Creates a new test using the given factory. If a given factory is null, then the tests which depend on it will be skipped.
      Parameters:
      csFactory - factory for creating Unit instances.
  • Method Details

    • getIdentifiedObject

      public Unit<?> getIdentifiedObject() throws FactoryException
      Returns the unit instance to be tested. When this method is invoked for the first time, it creates the unit to test by invoking the CSAuthorityFactory.createUnit(String) method with the current Series2000.code value in argument. The created object is then cached and returned in all subsequent invocations of this method.
      Specified by:
      getIdentifiedObject in class Series2000<Unit<?>>
      Returns:
      the unit instance to test.
      Throws:
      FactoryException - if an error occurred while creating the unit instance.
    • EPSG_9104

      @Test @DisplayName("arc-second") public void EPSG_9104() throws FactoryException
      Tests “arc-second” unit creation from the factory.
      • EPSG UoM code: 9104
      • Type: Angle
      • Name of Units used in EPSG dataset: arc-second
      • Alias(es) given by EPSG: sec, angular second
      • Base units per unit: 3.14159265358979 / 648000 ≈ 4.8481368111E-6
      • Base units per unit description: radians per unit
      • EPSG Usage Extent: Numerous
      Remarks: 1/60th arc-minute equal to ((pi/180) / 3600) radians.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9042

      @Test @DisplayName("British chain (Sears 1922)") public void EPSG_9042() throws FactoryException
      Tests “British chain (Sears 1922)” unit creation from the factory.
      • EPSG UoM code: 9042
      • Type: Linear
      • Name of Units used in EPSG dataset: British chain (Sears 1922)
      • Alias(es) given by EPSG: chain, chSe
      • Base units per unit: 792 / 39.370147 ≈ 20.1167651215526
      • Base units per unit description: metres per unit
      • EPSG Usage Extent: East Malaysia; New Zealand
      Remarks: Uses Sear's 1922 British yard-metre ratio as given by Bomford as 39.370147 inches per metre.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9301

      @Test @DisplayName("British chain (Sears 1922 truncated)") public void EPSG_9301() throws FactoryException
      Tests “British chain (Sears 1922 truncated)” unit creation from the factory.
      • EPSG UoM code: 9301
      • Type: Linear
      • Name of Units used in EPSG dataset: British chain (Sears 1922 truncated)
      • Alias(es) given by EPSG: chain, chSe(T)
      • Base units per unit: 20.116756
      • Base units per unit description: metres per unit
      • EPSG Usage Extent: Malaysia
      Remarks: Uses Sear's 1922 British yard-metre ratio (UoM code 9040) truncated to 6 significant figures. This truncated ratio (0.914398 UoM code 9099) then converted to other imperial units. 1 chSe(T) equal to 22 ydSe(T). Used in metrication of Malaya RSO grid.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9041

      @Test @DisplayName("British foot (Sears 1922)") public void EPSG_9041() throws FactoryException
      Tests “British foot (Sears 1922)” unit creation from the factory.
      • EPSG UoM code: 9041
      • Type: Linear
      • Name of Units used in EPSG dataset: British foot (Sears 1922)
      • Alias(es) given by EPSG: foot, ftSe
      • Base units per unit: 12 / 39.370147 ≈ 0.304799471538676
      • Base units per unit description: metres per unit
      • EPSG Usage Extent: East Malaysia; New Zealand
      Remarks: Uses Sear's 1922 British yard-metre ratio as given by Bomford as 39.370147 inches per metre.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9040

      @Test @DisplayName("British yard (Sears 1922)") public void EPSG_9040() throws FactoryException
      Tests “British yard (Sears 1922)” unit creation from the factory.
      • EPSG UoM code: 9040
      • Type: Linear
      • Name of Units used in EPSG dataset: British yard (Sears 1922)
      • Alias(es) given by EPSG: yard, ydSe
      • Base units per unit: 36 / 39.370147 ≈ 0.914398414616029
      • Base units per unit description: metres per unit
      • EPSG Usage Extent: East Malaysia; New Zealand
      Remarks: Uses Sear's 1922 British yard-metre ratio as given by Bomford as 39.370147 inches per metre.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9113

      @Test @DisplayName("centesimal second") public void EPSG_9113() throws FactoryException
      Tests “centesimal second” unit creation from the factory.
      • EPSG UoM code: 9113
      • Type: Angle
      • Name of Units used in EPSG dataset: centesimal second
      • Alias(es) given by EPSG: cc, centesimal-second
      • Base units per unit: 3.14159265358979 / 2000000 ≈ 1.5707963268E-6
      • Base units per unit description: radians per unit
      • EPSG Usage Extent: Switzerland
      Remarks: 1/100 of a centesimal minute or 1/10000th of a grad and gon equal to ((pi/200) / 10000) radians. Used in one geocentric 7-parameter transformation.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9005

      @Test @DisplayName("Clarke\'s foot") public void EPSG_9005() throws FactoryException
      Tests “Clarke's foot” unit creation from the factory.
      • EPSG UoM code: 9005
      • Type: Linear
      • Name of Units used in EPSG dataset: Clarke's foot
      • Alias(es) given by EPSG: South African geodetic foot, ftCla, Clarke foot
      • Base units per unit: 0.3047972654
      • Base units per unit description: metres per unit
      • EPSG Usage Extent: Australia; South Africa; British West Indies
      Remarks: Assumes Clarke's 1865 ratio of 1 British foot equal to 0.3047972654 French legal metres applies to the international metre.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9039

      @Test @DisplayName("Clarke\'s link") public void EPSG_9039() throws FactoryException
      Tests “Clarke's link” unit creation from the factory.
      • EPSG UoM code: 9039
      • Type: Linear
      • Name of Units used in EPSG dataset: Clarke's link
      • Alias(es) given by EPSG: link (Clarke's ratio), lkCla, Clarke link
      • Base units per unit: 0.201166195164
      • Base units per unit description: metres per unit
      • EPSG Usage Extent: Australia; South Africa; British West Indies
      Remarks: Equal to 1/100 Clarke's chain. Assumes Clarke's 1865 ratio of 1 British foot equal to 0.3047972654 French legal metres applies to the international metre.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9203

      @Test @DisplayName("coefficient") public void EPSG_9203() throws FactoryException
      Tests “coefficient” unit creation from the factory.
      • EPSG UoM code: 9203
      • Type: Scale
      • Name of Units used in EPSG dataset: coefficient
      • EPSG Usage Extent: Numerous
      Remarks: Used when parameters are coefficients. They inherently take the units which depend upon the term to which the coefficient applies.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9102

      @Test @DisplayName("degree") public void EPSG_9102() throws FactoryException
      Tests “degree” unit creation from the factory.
      • EPSG UoM code: 9102
      • Type: Angle
      • Name of Units used in EPSG dataset: degree
      • Alias(es) given by EPSG: deg, angular degree
      • Base units per unit: 3.14159265358979 / 180 ≈ 0.017453293
      • Base units per unit description: radians per unit
      • EPSG Usage Extent: Numerous
      Remarks: Equal to pi/180 radians. Finite or fractional representation e.g. DDD.dddddddd referred to as decimal degree.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9002

      @Test @DisplayName("foot") public void EPSG_9002() throws FactoryException
      Tests “foot” unit creation from the factory.
      • EPSG UoM code: 9002
      • Type: Linear
      • Name of Units used in EPSG dataset: foot
      • Alias(es) given by EPSG: international foot, ft
      • Base units per unit: 0.3048
      • Base units per unit description: metres per unit
      • EPSG Usage Extent: Numerous
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9031

      @Test @DisplayName("German legal metre") public void EPSG_9031() throws FactoryException
      Tests “German legal metre” unit creation from the factory.
      • EPSG UoM code: 9031
      • Type: Linear
      • Name of Units used in EPSG dataset: German legal metre
      • Alias(es) given by EPSG: GLM
      • Base units per unit: 1.0000135965
      • Base units per unit description: metres per unit
      • EPSG Usage Extent: Namibia
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9094

      @Test @DisplayName("Gold Coast foot") public void EPSG_9094() throws FactoryException
      Tests “Gold Coast foot” unit creation from the factory.
      • EPSG UoM code: 9094
      • Type: Linear
      • Name of Units used in EPSG dataset: Gold Coast foot
      • Alias(es) given by EPSG: foot, ftGC
      • Base units per unit: 6378300 / 20926201 ≈ 0.304799710181509
      • Base units per unit description: metres per unit
      • EPSG Usage Extent: Ghana
      Remarks: Used in Ghana and some adjacent parts of British west Africa prior to metrication. Except for the metrication of projection defining parameters when British foot (Sears 1922) used.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9105

      @Test @DisplayName("grad") public void EPSG_9105() throws FactoryException
      Tests “grad” unit creation from the factory.
      • EPSG UoM code: 9105
      • Type: Angle
      • Name of Units used in EPSG dataset: grad
      • Alias(es) given by EPSG: gr, gon
      • Base units per unit: 3.14159265358979 / 200 ≈ 0.0157079632679489
      • Base units per unit description: radians per unit
      • EPSG Usage Extent: France
      Remarks: Equal to pi/200 radians.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9084

      @Test @DisplayName("Indian yard") public void EPSG_9084() throws FactoryException
      Tests “Indian yard” unit creation from the factory.
      • EPSG UoM code: 9084
      • Type: Linear
      • Name of Units used in EPSG dataset: Indian yard
      • Alias(es) given by EPSG: yard, ydInd
      • Base units per unit: 36 / 39.370142 ≈ 0.914398530744441
      • Base units per unit description: metres per unit
      • EPSG Usage Extent: South Asia
      Remarks: Indian Foot equal to 0.99999566 British feet (A.R.Clarke 1865). British yard (equal to 3 British feet) taken to be J.S.Clark's 1865 value of 0.9144025 metres.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9036

      @Test @DisplayName("kilometre") public void EPSG_9036() throws FactoryException
      Tests “kilometre” unit creation from the factory.
      • EPSG UoM code: 9036
      • Type: Linear
      • Name of Units used in EPSG dataset: kilometre
      • Alias(es) given by EPSG: kilometer, km
      • Base units per unit: 1000
      • Base units per unit description: metres per unit
      • EPSG Usage Extent: Numerous
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9098

      @Test @DisplayName("link") public void EPSG_9098() throws FactoryException
      Tests “link” unit creation from the factory.
      • EPSG UoM code: 9098
      • Type: Linear
      • Name of Units used in EPSG dataset: link
      • Alias(es) given by EPSG: international link, lk
      • Base units per unit: 20.1168 / 100 ≈ 0.201168
      • Base units per unit description: metres per unit
      • EPSG Usage Extent: Fiji
      Remarks: Equal to 1/100 international chain.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9001

      @Test @DisplayName("metre") public void EPSG_9001() throws FactoryException
      Tests “metre” unit creation from the factory.
      • EPSG UoM code: 9001
      • Type: Linear
      • Name of Units used in EPSG dataset: metre
      • Alias(es) given by EPSG: meter, International metre, m
      • Base units per unit: 1
      • Base units per unit description: metres per unit
      • EPSG Usage Extent: Numerous
      Remarks: SI base unit for length.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9109

      @Test @DisplayName("microradian") public void EPSG_9109() throws FactoryException
      Tests “microradian” unit creation from the factory.
      • EPSG UoM code: 9109
      • Type: Angle
      • Name of Units used in EPSG dataset: microradian
      • Alias(es) given by EPSG: µrad
      • Base units per unit: 1 / 1000000 ≈ 1.0E-6
      • Base units per unit description: radians per unit
      • EPSG Usage Extent: Netherlands; Norway
      Remarks: Some 7- and 10-parameter transformations.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9202

      @Test @DisplayName("parts per million") public void EPSG_9202() throws FactoryException
      Tests “parts per million” unit creation from the factory.
      • EPSG UoM code: 9202
      • Type: Scale
      • Name of Units used in EPSG dataset: parts per million
      • Alias(es) given by EPSG: ppm, µm/m
      • Base units per unit: 1 / 1000000 ≈ 1.0E-6
      • Base units per unit description: parts per unit
      • EPSG Usage Extent: Numerous
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9101

      @Test @DisplayName("radian") public void EPSG_9101() throws FactoryException
      Tests “radian” unit creation from the factory.
      • EPSG UoM code: 9101
      • Type: Angle
      • Name of Units used in EPSG dataset: radian
      • Alias(es) given by EPSG: rad
      • Base units per unit: 1
      • Base units per unit description: radians per unit
      • EPSG Usage Extent: Colombia; USA; Canada
      Remarks: SI coherent derived unit (standard unit) for plane angle. Used in some geocentric 7- and 10-parameter transformations.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9110

      @Test @DisplayName("sexagesimal DMS") public void EPSG_9110() throws FactoryException
      Tests “sexagesimal DMS” unit creation from the factory.
      • EPSG UoM code: 9110
      • Type: Angle
      • Name of Units used in EPSG dataset: sexagesimal DMS
      • Alias(es) given by EPSG: DDD.MMSSsss, sexagesimal degree DDD.MMSSsss
      • EPSG Usage Extent: Numerous
      Remarks: Pseudo unit. Special EPSG construct for storing sexagesimal degree values as a single real number. Applications do not necessarily have to adopt this approach but should somehow exactly honour sexagesimal value. Sexagesimal degree (123 45 67.8 [H]) should be used for display at human interface. Format: signed degrees - period - minutes (2 digits) - integer seconds (2 digits) - fraction of seconds (any precision). Must include leading zero in minutes and seconds and exclude decimal point for seconds. Convert to deg using algorithm.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9201

      @Test @DisplayName("unity") public void EPSG_9201() throws FactoryException
      Tests “unity” unit creation from the factory.
      • EPSG UoM code: 9201
      • Type: Scale
      • Name of Units used in EPSG dataset: unity
      • Alias(es) given by EPSG: euclid
      • Base units per unit: 1
      • Base units per unit description: parts per unit
      • EPSG Usage Extent: Numerous
      Remarks: EPSG standard unit for scale. SI coherent derived unit (standard unit) for dimensionless quantity. Expressed by the number one but this is not explicitly shown.
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.
    • EPSG_9003

      @Test @DisplayName("US survey foot") public void EPSG_9003() throws FactoryException
      Tests “US survey foot” unit creation from the factory.
      • EPSG UoM code: 9003
      • Type: Linear
      • Name of Units used in EPSG dataset: US survey foot
      • Alias(es) given by EPSG: American foot, ftUS, ft(US)
      • Base units per unit: 12 / 39.37 ≈ 0.304800609601219
      • Base units per unit description: metres per unit
      • EPSG Usage Extent: USA
      Throws:
      FactoryException - if an error occurred while creating the unit from the EPSG code.