Class SecondDefiningParameter

java.lang.Object
org.apache.sis.internal.jaxb.referencing.SecondDefiningParameter

public final class SecondDefiningParameter extends Object
Stores the second defining parameter of an Ellipsoid. The purpose of this class is to allow JAXB to handle a second defining parameter, according to the kind of ellipsoid we are facing to.
Since:
0.4
Version:
0.8
  • Field Details

    • secondDefiningParameter

      public SecondDefiningParameter secondDefiningParameter
      Nested parameter, for JAXB purpose. This is used for marshalling XML like below:
    • isSphere

      public Boolean isSphere
      Whether the ellipsoid is a sphere, or null if unspecified. If this value is true, then the XML shall be marshalled like below:
      Since:
      0.8
    • measure

      public Measure measure
      The measure, which is either the polar radius or the inverse of the flattening value. We distinguish those two cases by the unit: if the measure is the inverse flattening, then the unit must be Units.UNITY.

      This value should be null if isSphere is true.

      See Also:
      • Ellipsoid.getSemiMinorAxis()
      • Ellipsoid.getInverseFlattening()
  • Constructor Details

    • SecondDefiningParameter

      public SecondDefiningParameter()
      JAXB mandatory empty constructor.
    • SecondDefiningParameter

      public SecondDefiningParameter(org.opengis.referencing.datum.Ellipsoid ellipsoid, boolean nested)
      Stores the semi-minor axis or the inverse of the flattening value.
      Parameters:
      ellipsoid - the ellipsoid from which to get the semi-minor or inverse flattening value.
      nested - true if the element should be nested in another XML type.
  • Method Details

    • isIvfDefinitive

      public boolean isIvfDefinitive()
      Returns true if the measure is the inverse of the flattening value.
      Returns:
      true if the measure is the inverse of the flattening value.
    • getSemiMinorAxis

      public Measure getSemiMinorAxis()
      Returns the semi-minor axis value as a measurement.
      Returns:
      the measure of the semi-minor axis.
    • setSemiMinorAxis

      public void setSemiMinorAxis(Measure measure)
      Sets the semi-minor axis value. This is invoked by JAXB for unmarshalling. The unit of measurement (if any) shall be linear, but we do not verify that now. This will be verified by DefaultEllipsoid.setSecondDefiningParameter(…).
      Parameters:
      measure - the semi-minor axis value.
    • getInverseFlattening

      public Measure getInverseFlattening()
      Returns the inverse of the flattening value as a measurement. Note: The unit of this measurement is dimensionless.
      Returns:
      the inverse of the flattening value as a measurement.
    • setInverseFlattening

      public void setInverseFlattening(Measure measure)
      Sets the inverse of the flattening value. This is invoked by JAXB for unmarshalling.

      Note that some GML wrongly assign the "m" unit to this measure, which is wrong. This method overwrite the unit with a dimensionless one. This is required anyway in order to distinguish between the two cases.

      Parameters:
      measure - the inverse flattening value.