java.lang.Object
org.apache.jena.geosparql.implementation.UnitsOfMeasure
All Implemented Interfaces:
Serializable

public class UnitsOfMeasure extends Object implements Serializable
Based on: http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html Based on: http://docs.opengeospatial.org/is/12-063r5/12-063r5.html Based on: https://sis.apache.org/apidocs/org/apache/sis/measure/Units.html
See Also:
  • Field Details

  • Constructor Details

    • UnitsOfMeasure

      public UnitsOfMeasure(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
    • UnitsOfMeasure

      public UnitsOfMeasure(String unitURI)
  • Method Details

    • getUnit

      public javax.measure.Unit<javax.measure.quantity.Length> getUnit()
    • getUnitURI

      public String getUnitURI()
    • isLinearUnits

      public boolean isLinearUnits()
    • conversion

      public static final Double conversion(double sourceDistance, String sourceDistanceUnitsURI, String targetDistanceUnitsURI) throws UnitsConversionException
      Conversion from target distance in units to source Units Of Measure.
      Parameters:
      sourceDistance -
      sourceDistanceUnitsURI -
      targetDistanceUnitsURI -
      Returns:
      Distance after conversion.
      Throws:
      UnitsConversionException
    • conversion

      public static final Double conversion(double sourceDistance, UnitsOfMeasure sourceUnits, UnitsOfMeasure targetUnits) throws UnitsConversionException
      Conversion from target distance in units to source Units Of Measure.
      Parameters:
      sourceDistance -
      sourceUnits -
      targetUnits -
      Returns:
      Distance after conversion.
      Throws:
      UnitsConversionException
    • convertToDegrees

      public static final double convertToDegrees(double distance, String unitsURI, double latitude)
      Provides conversion of linear units to degrees.
      Conversion from linear (i.e. metres) to degrees based on equatorial radius of 111.32km.
      Therefore, this should only be used for rough bounding area before using more precise distance methods of GeometryWrapper.
      Parameters:
      distance -
      unitsURI -
      latitude -
      Returns:
      Converted distance in the provided units.
    • convertToMetres

      public static final double convertToMetres(double distance, String unitsURI, double latitude)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object