Module org.apache.jena.geosparql
Class UnitsOfMeasure
java.lang.Object
org.apache.jena.geosparql.implementation.UnitsOfMeasure
- All Implemented Interfaces:
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 Summary
Modifier and TypeFieldDescriptionstatic final UnitsOfMeasure
static final double
static final double
static final UnitsOfMeasure
-
Constructor Summary
ConstructorDescriptionUnitsOfMeasure
(String unitURI) UnitsOfMeasure
(org.opengis.referencing.crs.CoordinateReferenceSystem crs) -
Method Summary
Modifier and TypeMethodDescriptionstatic final Double
conversion
(double sourceDistance, String sourceDistanceUnitsURI, String targetDistanceUnitsURI) Conversion from target distance in units to source Units Of Measure.static final Double
conversion
(double sourceDistance, UnitsOfMeasure sourceUnits, UnitsOfMeasure targetUnits) Conversion from target distance in units to source Units Of Measure.static final double
convertToDegrees
(double distance, String unitsURI, double latitude) Provides conversion of linear units to degrees.static final double
convertToMetres
(double distance, String unitsURI, double latitude) boolean
javax.measure.Unit<javax.measure.quantity.Length>
getUnit()
int
hashCode()
boolean
toString()
-
Field Details
-
METRE_UNITS
-
DEGREE_UNITS
-
EQUATORIAL_DEGREE_TO_METRES
public static final double EQUATORIAL_DEGREE_TO_METRES- See Also:
-
EARTH_MEAN_RADIUS
public static final double EARTH_MEAN_RADIUS- See Also:
-
-
Constructor Details
-
UnitsOfMeasure
public UnitsOfMeasure(org.opengis.referencing.crs.CoordinateReferenceSystem crs) -
UnitsOfMeasure
-
-
Method Details
-
getUnit
public javax.measure.Unit<javax.measure.quantity.Length> getUnit() -
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
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
-
toString
-
hashCode
public int hashCode() -
equals
-