Class BursaWolfInfo

java.lang.Object
org.apache.sis.referencing.factory.sql.BursaWolfInfo

final class BursaWolfInfo extends Object
Private structure for EPSGDataAccess.createBursaWolfParameters(PrimeMeridian, Integer) usage. Those information are for compatibility with Well Known Text (WKT) version 1 formatting. That legacy format had a TOWGS84 element which needs the information provided by this class. Note that TOWGS84 is a deprecated element as of WKT 2 (ISO 19162).

Note: this class contains many hard-coded EPSG codes relative to Bursa-Wolf parameters.

Since:
0.7
Version:
0.8
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    The value of AREA_OF_USE_CODE.
    private org.opengis.metadata.extent.Extent
    The domain of validity as an Extent object.
    (package private) static final int
    Last Bursa-Wolf method.
    (package private) final int
    The value of COORD_OP_METHOD_CODE.
    (package private) static final int
    First Bursa-Wolf method.
    (package private) final int
    The value of COORD_OP_CODE.
    private static final int
    Rotation frame method.
    (package private) final int
    The target datum inferred from value of TARGET_CRS_CODE.
    (package private) static final int
    The target CRS for which to collect Bursa-Wolf parameters.
    (package private) static final int
    The datum of TARGET_CRS.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BursaWolfInfo(int operation, int method, int targetCRS, int domainOfValidity)
    Fills a structure with the specified values.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static void
    Given an array of BursaWolfInfo instances, retains only the instances having the largest domain of validity for each target datum.
    (package private) org.opengis.metadata.extent.Extent
    Gets the domain of validity.
    (package private) boolean
    Returns true if this operation is a frame rotation.
    (package private) static void
    setBursaWolfParameter(BursaWolfParameters parameters, int code, double value, javax.measure.Unit<?> unit, Locale locale)
    Sets a Bursa-Wolf parameter from an EPSG parameter.
    MUST returns the operation code.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • TARGET_CRS

      static final int TARGET_CRS
      The target CRS for which to collect Bursa-Wolf parameters. Apache SIS accepts an arbitrary number of targets, but the TOWGS84 element only needs the parameters toward the EPSG:4326 coordinate reference system. For now we fix the number of target CRS to only 1, but we can increase that amount in a future SIS version if needed. However, it is better to restrict the target CRS to those that use a world-wide datum only.
      See Also:
    • TARGET_DATUM

      static final int TARGET_DATUM
      The datum of TARGET_CRS.
      See Also:
    • MIN_METHOD_CODE

      static final int MIN_METHOD_CODE
      First Bursa-Wolf method.
      See Also:
    • MAX_METHOD_CODE

      static final int MAX_METHOD_CODE
      Last Bursa-Wolf method.
      See Also:
    • ROTATION_FRAME_CODE

      private static final int ROTATION_FRAME_CODE
      Rotation frame method.
      See Also:
    • operation

      final int operation
      The value of COORD_OP_CODE.
    • method

      final int method
      The value of COORD_OP_METHOD_CODE.
    • target

      final int target
      The target datum inferred from value of TARGET_CRS_CODE.
    • domainOfValidity

      private final int domainOfValidity
      The value of AREA_OF_USE_CODE.
    • extent

      private org.opengis.metadata.extent.Extent extent
      The domain of validity as an Extent object.
  • Constructor Details

    • BursaWolfInfo

      BursaWolfInfo(int operation, int method, int targetCRS, int domainOfValidity)
      Fills a structure with the specified values.
  • Method Details

    • setBursaWolfParameter

      static void setBursaWolfParameter(BursaWolfParameters parameters, int code, double value, javax.measure.Unit<?> unit, Locale locale) throws FactoryDataException
      Sets a Bursa-Wolf parameter from an EPSG parameter. This method recognizes only the parameters that do not depend on time (EPSG:8605 to 8611). This method does not recognize the time-dependent parameters (EPSG:1040 to 1046) because they are not used in WKT 1 TOWGS84 elements.
      Parameters:
      parameters - the Bursa-Wolf parameters to modify.
      code - the EPSG code for a parameter from the [PARAMETER_CODE] column.
      value - the value of the parameter from the [PARAMETER_VALUE] column.
      unit - the unit of the parameter value from the [UOM_CODE] column.
      locale - the locale, used only if an error message need to be formatted.
      Throws:
      FactoryDataException - if the code is unrecognized.
    • isFrameRotation

      boolean isFrameRotation()
      Returns true if this operation is a frame rotation. Frame rotations methods are:
      • EPSG:9607 for the operation that does not depend on time.
      • EPSG:1056 for the time-dependent operation (not handled by this class).
    • toString

      public String toString()
      MUST returns the operation code. This is required by EPSGDataAccess.sort(String, Object[]).
      Overrides:
      toString in class Object
    • getDomainOfValidity

      org.opengis.metadata.extent.Extent getDomainOfValidity(GeodeticAuthorityFactory factory) throws org.opengis.util.FactoryException
      Gets the domain of validity. The result is cached.
      Parameters:
      factory - the factory to use for creating Extent instances.
      Throws:
      org.opengis.util.FactoryException
    • filter

      static void filter(GeodeticAuthorityFactory factory, BursaWolfInfo[] candidates, List<BursaWolfInfo> addTo) throws org.opengis.util.FactoryException
      Given an array of BursaWolfInfo instances, retains only the instances having the largest domain of validity for each target datum. If two instances have the same domain of validity, the first one is retained. This presume that the instances have already been sorted for preference order before to invoke this method.
      Parameters:
      factory - the factory to use for creating Extent instances.
      candidates - the Bursa-Wolf parameters candidates.
      addTo - where to add the instances retained by this method.
      Throws:
      org.opengis.util.FactoryException