Class Units
Unit
instances.
Unit names and definitions in this class follow the definitions provided in the EPSG geodetic dataset
(when the unit exists in that dataset),
except “year” which has been renamed “tropical year”.
This class focuses on the most commonly used units in the geospatial domain:
angular units (degree, arc-second, …),
linear units (kilometre, nautical mile, …) and
temporal units (day, year, …),
but some other kind of units are also provided for completeness.
The main quantities are listed below, together with some related units:
Quantity type | System unit | Some conventional units | |
---|---|---|---|
Fundamental: | |||
Length | (L) | METRE | CENTIMETRE , KILOMETRE , NAUTICAL_MILE , STATUTE_MILE , FOOT |
Mass | (M) | KILOGRAM | |
Time | (T) | SECOND | MILLISECOND , MINUTE , HOUR , DAY , WEEK , TROPICAL_YEAR |
ElectricCurrent | (I) | AMPERE | |
Temperature | (Θ) | KELVIN | CELSIUS , FAHRENHEIT |
AmountOfSubstance | (N) | MOLE | |
LuminousIntensity | (J) | CANDELA | |
Dimensionless: | |||
Angle | RADIAN | DEGREE , ARC_MINUTE , ARC_SECOND , GRAD | |
SolidAngle | STERADIAN | ||
Derived: | |||
Area | (A) | SQUARE_METRE | HECTARE |
Volume | (V) | CUBIC_METRE | |
Speed | (ν) | METRES_PER_SECOND | KILOMETRES_PER_HOUR |
Pressure | PASCAL | HECTOPASCAL , DECIBAR , BAR , ATMOSPHERE |
- Since:
- 0.3
- Version:
- 1.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final javax.measure.Unit
<javax.measure.quantity.ElectricCurrent> The SI base unit for electric current (A).static final javax.measure.Unit
<javax.measure.quantity.Angle> Unit of measurement defined as 1/60 degree (1′).static final javax.measure.Unit
<javax.measure.quantity.Angle> Unit of measurement defined as 1/(60×60) degree (1″).static final javax.measure.Unit
<javax.measure.quantity.Pressure> Unit of measurement defined as 101325 pascals (1 atm).static final javax.measure.Unit
<javax.measure.quantity.Pressure> Unit of measurement defined as 100000 pascals (1 bar).static final javax.measure.Unit
<javax.measure.quantity.LuminousIntensity> The SI base unit for luminous intensity (cd).static final javax.measure.Unit
<javax.measure.quantity.Temperature> Unit of measurement defined as the temperature in Kelvin minus 273.15.static final javax.measure.Unit
<javax.measure.quantity.Length> Unit of measurement defined as 0.01 metres (1 cm).static final javax.measure.Unit
<javax.measure.quantity.Length> Unit of measurement defined as 0.3047972654 metres.static final javax.measure.Unit
<javax.measure.quantity.ElectricCharge> The SI derived unit for electric charge (C).static final javax.measure.Unit
<javax.measure.quantity.Volume> The SI derived unit for volume (m³).static final javax.measure.Unit
<javax.measure.quantity.Time> Unit of measurement defined as 24×60×60 seconds (1 d).static final javax.measure.Unit
<javax.measure.quantity.Pressure> Unit of measurement defined as 10000 pascals (1 dbar).static final javax.measure.Unit
<javax.measure.quantity.Dimensionless> Sub-division of logarithm of ratio of the measured quantity to a reference quantity (dB).static final javax.measure.Unit
<javax.measure.quantity.Angle> Unit of measurement defined as π/180 radians (1°).static final javax.measure.Unit
<javax.measure.quantity.Temperature> Unit of measurement defined as 1.8 degree Celsius plus 32.static final javax.measure.Unit
<javax.measure.quantity.ElectricCapacitance> The SI derived unit for electric capacitance (F).static final javax.measure.Unit
<javax.measure.quantity.Length> Unit of measurement defined as exactly 0.3048 metres (1 ft).static final javax.measure.Unit
<javax.measure.quantity.Acceleration> Unit of measurement defined as 1/100 metres per second squared (1 cm/s²).static final javax.measure.Unit
<javax.measure.quantity.Angle> Unit of measurement defined as π/200 radians (1 grad).static final javax.measure.Unit
<javax.measure.quantity.Mass> A SI conventional unit for mass (g).static final javax.measure.Unit
<javax.measure.quantity.Area> Unit of measurement defined as 10,000 square metres (1 ha).static final javax.measure.Unit
<javax.measure.quantity.Pressure> Unit of measurement defined as 100 pascals (1 hPa).static final javax.measure.Unit
<javax.measure.quantity.ElectricInductance> The SI derived unit for inductance (H).static final javax.measure.Unit
<javax.measure.quantity.Frequency> The SI derived unit for frequency (Hz).static final javax.measure.Unit
<javax.measure.quantity.Time> Unit of measurement defined as 60×60 seconds (1 h).static final javax.measure.Unit
<javax.measure.quantity.Length> Unit of measurement defined as 2.54 centimetres (1 in).(package private) static final boolean
Sets totrue
by the static initializer after the initialization has been completed.static final javax.measure.Unit
<javax.measure.quantity.Energy> The SI derived unit for energy (J).static final javax.measure.Unit
<javax.measure.quantity.Temperature> The SI base unit for thermodynamic temperature (K).static final javax.measure.Unit
<javax.measure.quantity.Mass> The SI base unit for mass (kg).static final javax.measure.Unit
<javax.measure.quantity.Length> Unit of measurement defined as 1000 metres (1 km).static final javax.measure.Unit
<javax.measure.quantity.Speed> Unit of measurement defined as 1/3.6 metres per second (1 km/h).static final javax.measure.Unit
<javax.measure.quantity.Volume> The unit for litre volume (L, l or ℓ).static final javax.measure.Unit
<javax.measure.quantity.LuminousFlux> The SI derived unit for luminous flux (lm).static final javax.measure.Unit
<javax.measure.quantity.Illuminance> The SI derived unit for illuminance (lx).static final javax.measure.Unit
<javax.measure.quantity.Length> The SI base unit for distances (m).static final javax.measure.Unit
<javax.measure.quantity.Speed> The SI derived unit for speed (m/s).static final javax.measure.Unit
<javax.measure.quantity.Acceleration> The SI derived unit for acceleration (m/s²).static final javax.measure.Unit
<javax.measure.quantity.Angle> Unit of measurement defined as 10-6 radians (1 µrad).static final javax.measure.Unit
<javax.measure.quantity.Length> Unit of measurement defined as 0.001 metres (1 mm).static final javax.measure.Unit
<javax.measure.quantity.Time> Unit of measurement defined as 10-3 seconds (1 ms).static final javax.measure.Unit
<javax.measure.quantity.Time> Unit of measurement defined as 60 seconds (1 min).static final javax.measure.Unit
<javax.measure.quantity.AmountOfSubstance> The SI base unit for amount of substance (mol).static final javax.measure.Unit
<javax.measure.quantity.Length> Unit of measurement defined as 10-9 metres (1 nm).static final javax.measure.Unit
<javax.measure.quantity.Length> Unit of measurement defined as exactly 1852 metres (1 M).static final javax.measure.Unit
<javax.measure.quantity.Force> The SI derived unit for force (N).static final javax.measure.Unit
<javax.measure.quantity.ElectricResistance> The SI derived unit for electric resistance (Ω).static final javax.measure.Unit
<javax.measure.quantity.Pressure> The SI derived unit for pressure (Pa).static final javax.measure.Unit
<javax.measure.quantity.Dimensionless> Dimensionless unit for percentages (%).static final javax.measure.Unit
<javax.measure.quantity.Dimensionless> Dimensionless unit for pixels (px).static final javax.measure.Unit
<javax.measure.quantity.Length> Unit of measurement defined as 0.013837 inch (1 pt).static final javax.measure.Unit
<javax.measure.quantity.Dimensionless> Dimensionless unit for parts per million (ppm).static final javax.measure.Unit
<Salinity> Salinity measured using PSS-78.static final javax.measure.Unit
<javax.measure.quantity.Angle> The SI unit for plane angles (rad).static final javax.measure.Unit
<AngularVelocity> The unit for angular velocity (rad/s).static final javax.measure.Unit
<javax.measure.quantity.Time> The SI base unit for durations (s).static final javax.measure.Unit
<javax.measure.quantity.ElectricConductance> The SI derived unit for electric conductance (S).(package private) static final javax.measure.Unit
<javax.measure.quantity.Dimensionless> Sigma-level, used in oceanography.static final javax.measure.Unit
<javax.measure.quantity.Area> The SI derived unit for area (m²).static final javax.measure.Unit
<javax.measure.quantity.Length> Unit of measurement defined as exactly 1609.344 metres (1 mi).static final javax.measure.Unit
<javax.measure.quantity.SolidAngle> The SI unit for solid angles (sr).static final javax.measure.Unit
<javax.measure.quantity.MagneticFluxDensity> The SI derived unit for magnetic flux density (T).static final javax.measure.Unit
<javax.measure.quantity.Time> Unit of measurement approximately equals to 365.24219 days (1 a).static final javax.measure.Unit
<javax.measure.quantity.Dimensionless> The base dimensionless unit for scale measurements.static final javax.measure.Unit
<javax.measure.quantity.Length> Unit of measurement approximately equals to 0.3048006096… metres.static final javax.measure.Unit
<javax.measure.quantity.ElectricPotential> The SI derived unit for electric potential difference (V).static final javax.measure.Unit
<javax.measure.quantity.Power> The SI derived unit for power (W).static final javax.measure.Unit
<javax.measure.quantity.MagneticFlux> The SI derived unit for magnetic flux (Wb).static final javax.measure.Unit
<javax.measure.quantity.Time> Unit of measurement defined as 7 days (1 wk). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static <Q extends javax.measure.Quantity<Q>>
SystemUnit<Q> add
(Class<Q> quantity, ScalarFactory<Q> factory, UnitDimension dimension, String symbol, byte scope, short epsg) Invoked byUnits
static class initializer for registering SI base and derived units.private static <Q extends javax.measure.Quantity<Q>>
ConventionalUnit<Q> add
(AbstractUnit<Q> target, javax.measure.UnitConverter toTarget, String symbol, byte scope, short epsg) Invoked byUnits
static class initializer for registering SI conventional units.static Number[]
coefficients
(javax.measure.UnitConverter converter) Returns the coefficients of the given converter expressed as a polynomial equation.static javax.measure.UnitConverter
Creates a linear converter from the given scale and offset.static double
derivative
(javax.measure.UnitConverter converter, double value) Returns the derivative of the given converter at the given value, orNaN
if this method cannot compute it.static javax.measure.Unit
<javax.measure.quantity.Angle> ensureAngular
(javax.measure.Unit<?> unit) Makes sure that the specified unit is either null or an angular unit.static javax.measure.Unit
<javax.measure.quantity.Length> ensureLinear
(javax.measure.Unit<?> unit) Makes sure that the specified unit is either null or a linear unit.static javax.measure.Unit
<javax.measure.quantity.Dimensionless> ensureScale
(javax.measure.Unit<?> unit) Makes sure that the specified unit is either null or a scale unit.static javax.measure.Unit
<javax.measure.quantity.Time> ensureTemporal
(javax.measure.Unit<?> unit) Makes sure that the specified unit is either null or a temporal unit.(package private) static <Q extends javax.measure.Quantity<Q>>
SystemUnit<Q> Returns the system unit for the given quantity, ornull
if none.(package private) static javax.measure.Unit
<?> Returns the system unit for the given symbol, ornull
if none.(package private) static SystemUnit
<?> get
(javax.measure.Dimension dim) Returns the system unit for the given dimension, ornull
if none.static Integer
getEpsgCode
(javax.measure.Unit<?> unit, boolean inAxis) Returns the EPSG code of the given units, ornull
if unknown.static boolean
isAngular
(javax.measure.Unit<?> unit) Returnstrue
if the given unit is a linear unit.static boolean
isLinear
(javax.measure.Unit<?> unit) Returnstrue
if the given unit is a linear unit.static boolean
isPressure
(javax.measure.Unit<?> unit) Returnstrue
if the given unit is a pressure unit.static boolean
isScale
(javax.measure.Unit<?> unit) Returnstrue
if the given unit is a dimensionless scale unit.static boolean
isTemporal
(javax.measure.Unit<?> unit) Returnstrue
if the given unit is a temporal unit.static <Q extends javax.measure.Quantity<Q>>
javax.measure.Unit<Q> multiply
(javax.measure.Unit<Q> unit, double numerator, double denominator) Multiplies the given unit by the given ratio.static <Q extends javax.measure.Quantity<Q>>
doubletoStandardUnit
(javax.measure.Unit<Q> unit) Returns the factor by which to multiply the standard unit in order to get the given unit.static javax.measure.Unit
<?> Parses the given symbol.static javax.measure.Unit
<?> valueOfEPSG
(int code) Returns a hard-coded unit from an EPSG code.
-
Field Details
-
NANOMETRE
public static final javax.measure.Unit<javax.measure.quantity.Length> NANOMETREUnit of measurement defined as 10-9 metres (1 nm). This unit is often used in wavelength measurements. The system unit isMETRE
and the unlocalized name is "nanometre".Related units SI units: NANOMETRE
,MILLIMETRE
,CENTIMETRE
,METRE
,KILOMETRE
.In other systems: POINT
,INCH
,FOOT
,CLARKE_FOOT
,US_SURVEY_FOOT
,STATUTE_MILE
,NAUTICAL_MILE
.Derived units: SQUARE_METRE
,CUBIC_METRE
,METRES_PER_SECOND
.- Since:
- 0.8
- See Also:
-
MILLIMETRE
public static final javax.measure.Unit<javax.measure.quantity.Length> MILLIMETREUnit of measurement defined as 0.001 metres (1 mm). The system unit isMETRE
, the unlocalized name is “millimetre” and the identifier is EPSG:1025.Related units SI length units: NANOMETRE
,MILLIMETRE
,CENTIMETRE
,METRE
,KILOMETRE
.In other systems: POINT
,INCH
,FOOT
,CLARKE_FOOT
,US_SURVEY_FOOT
,STATUTE_MILE
,NAUTICAL_MILE
.Derived units: SQUARE_METRE
,CUBIC_METRE
,METRES_PER_SECOND
.- Since:
- 0.8
-
CENTIMETRE
public static final javax.measure.Unit<javax.measure.quantity.Length> CENTIMETREUnit of measurement defined as 0.01 metres (1 cm). The system unit isMETRE
, the unlocalized name is “centimetre” and the identifier is EPSG:1033.Related units SI length units: NANOMETRE
,MILLIMETRE
,CENTIMETRE
,METRE
,KILOMETRE
.In other systems: POINT
,INCH
,FOOT
,CLARKE_FOOT
,US_SURVEY_FOOT
,STATUTE_MILE
,NAUTICAL_MILE
.Derived units: SQUARE_METRE
,CUBIC_METRE
,METRES_PER_SECOND
.- Since:
- 0.8
-
METRE
public static final javax.measure.Unit<javax.measure.quantity.Length> METREThe SI base unit for distances (m). The unlocalized name is “metre” and the identifier is EPSG:9001. This is the base of all other linear units.Related units SI length units: NANOMETRE
,MILLIMETRE
,CENTIMETRE
,METRE
,KILOMETRE
.In other systems: POINT
,INCH
,FOOT
,CLARKE_FOOT
,US_SURVEY_FOOT
,STATUTE_MILE
,NAUTICAL_MILE
.Derived units: SQUARE_METRE
,CUBIC_METRE
,METRES_PER_SECOND
.- Since:
- 0.8
-
KILOMETRE
public static final javax.measure.Unit<javax.measure.quantity.Length> KILOMETREUnit of measurement defined as 1000 metres (1 km). The system unit isMETRE
, the unlocalized name is “kilometre” and the identifier is EPSG:9036.Related units SI length units: NANOMETRE
,MILLIMETRE
,CENTIMETRE
,METRE
,KILOMETRE
.In other systems: POINT
,INCH
,FOOT
,CLARKE_FOOT
,US_SURVEY_FOOT
,STATUTE_MILE
,NAUTICAL_MILE
.Derived units: SQUARE_METRE
,CUBIC_METRE
,KILOMETRES_PER_HOUR
.- Since:
- 0.8
-
NAUTICAL_MILE
public static final javax.measure.Unit<javax.measure.quantity.Length> NAUTICAL_MILEUnit of measurement defined as exactly 1852 metres (1 M). This is approximately the distance between two parallels of latitude separated by one arc-minute. The system unit isMETRE
, the unlocalized name is “nautical mile” and the identifier is EPSG:9030.There is no internationally agreed symbol for nautical mile. Apache SIS uses “M” in agreement with the International Hydrographic Organization (IHO) and the International Bureau of Weights and Measures (BIPM). But “NM” and “nmi” are also in use.
Related units SI length units: NANOMETRE
,MILLIMETRE
,CENTIMETRE
,METRE
,KILOMETRE
.In other systems: POINT
,INCH
,FOOT
,CLARKE_FOOT
,US_SURVEY_FOOT
,STATUTE_MILE
,NAUTICAL_MILE
.Derived units: SQUARE_METRE
,CUBIC_METRE
,KILOMETRES_PER_HOUR
.- Since:
- 0.8
-
STATUTE_MILE
public static final javax.measure.Unit<javax.measure.quantity.Length> STATUTE_MILEUnit of measurement defined as exactly 1609.344 metres (1 mi). This unit is often named “mile” without qualifier, but Apache SIS uses “statute mile” for emphasing the difference with nautical mile. The system unit isMETRE
. The unlocalized name is “statute mile” but is localized as "international mile" in the US for avoiding confusion with the US survey mile. The identifier is EPSG:9093.Related units SI length units: NANOMETRE
,MILLIMETRE
,CENTIMETRE
,METRE
,KILOMETRE
.In other systems: POINT
,INCH
,FOOT
,CLARKE_FOOT
,US_SURVEY_FOOT
,STATUTE_MILE
,NAUTICAL_MILE
.Derived units: SQUARE_METRE
,CUBIC_METRE
,KILOMETRES_PER_HOUR
.- Since:
- 0.8
-
US_SURVEY_FOOT
public static final javax.measure.Unit<javax.measure.quantity.Length> US_SURVEY_FOOTUnit of measurement approximately equals to 0.3048006096… metres. The legal definition is exactly 12/39.37 metres. The system unit isMETRE
, the unlocalized name is “US survey foot” and the identifier is EPSG:9003.Related units SI length units: NANOMETRE
,MILLIMETRE
,CENTIMETRE
,METRE
,KILOMETRE
.In other systems: POINT
,INCH
,FOOT
,CLARKE_FOOT
,US_SURVEY_FOOT
,STATUTE_MILE
,NAUTICAL_MILE
.Derived units: SQUARE_METRE
,CUBIC_METRE
,METRES_PER_SECOND
.- Since:
- 0.8
-
CLARKE_FOOT
public static final javax.measure.Unit<javax.measure.quantity.Length> CLARKE_FOOTUnit of measurement defined as 0.3047972654 metres. The system unit isMETRE
, the unlocalized name is “Clarke’s foot” and the identifier is EPSG:9005.Related units SI length units: NANOMETRE
,MILLIMETRE
,CENTIMETRE
,METRE
,KILOMETRE
.In other systems: POINT
,INCH
,FOOT
,CLARKE_FOOT
,US_SURVEY_FOOT
,STATUTE_MILE
,NAUTICAL_MILE
.Derived units: SQUARE_METRE
,CUBIC_METRE
,METRES_PER_SECOND
.- Since:
- 0.8
-
FOOT
public static final javax.measure.Unit<javax.measure.quantity.Length> FOOTUnit of measurement defined as exactly 0.3048 metres (1 ft). The system unit isMETRE
, the unlocalized name is “foot” and the identifier is EPSG:9002.Related units SI length units: NANOMETRE
,MILLIMETRE
,CENTIMETRE
,METRE
,KILOMETRE
.In other systems: POINT
,INCH
,FOOT
,CLARKE_FOOT
,US_SURVEY_FOOT
,STATUTE_MILE
,NAUTICAL_MILE
.Derived units: SQUARE_METRE
,CUBIC_METRE
,METRES_PER_SECOND
.- Since:
- 0.8
-
INCH
public static final javax.measure.Unit<javax.measure.quantity.Length> INCHUnit of measurement defined as 2.54 centimetres (1 in). The system unit isMETRE
and the unlocalized name is “inch”.Related units SI length units: NANOMETRE
,MILLIMETRE
,CENTIMETRE
,METRE
,KILOMETRE
.In other systems: POINT
,INCH
,FOOT
,CLARKE_FOOT
,US_SURVEY_FOOT
,STATUTE_MILE
,NAUTICAL_MILE
.Derived units: SQUARE_METRE
,CUBIC_METRE
,METRES_PER_SECOND
.- Since:
- 0.8
-
POINT
public static final javax.measure.Unit<javax.measure.quantity.Length> POINTUnit of measurement defined as 0.013837 inch (1 pt). This is commonly used to measure the height of a font. The system unit isMETRE
and the unlocalized name is “point”.Related units SI length units: NANOMETRE
,MILLIMETRE
,CENTIMETRE
,METRE
,KILOMETRE
.In other systems: POINT
,INCH
,FOOT
,CLARKE_FOOT
,US_SURVEY_FOOT
,STATUTE_MILE
,NAUTICAL_MILE
.Derived units: SQUARE_METRE
,CUBIC_METRE
,METRES_PER_SECOND
.- Since:
- 0.8
-
SQUARE_METRE
public static final javax.measure.Unit<javax.measure.quantity.Area> SQUARE_METREThe SI derived unit for area (m²). The unlocalized name is “square metre”.Related units SI area units: SQUARE_METRE
,HECTARE
.Derived units: CUBIC_METRE
.- Since:
- 0.8
-
HECTARE
public static final javax.measure.Unit<javax.measure.quantity.Area> HECTAREUnit of measurement defined as 10,000 square metres (1 ha). One hectare is exactly equals to one hectometre (1 hm²). While not an SI unit, the hectare is often used in the measurement of land. The unlocalized name is “hectare”.Related units SI area units: SQUARE_METRE
,HECTARE
.Derived units: CUBIC_METRE
.- Since:
- 0.8
-
CUBIC_METRE
public static final javax.measure.Unit<javax.measure.quantity.Volume> CUBIC_METREThe SI derived unit for volume (m³). The unlocalized name is “cubic metre”.- Since:
- 0.8
-
LITRE
public static final javax.measure.Unit<javax.measure.quantity.Volume> LITREThe unit for litre volume (L, l or ℓ). The unlocalized name is “litre”.- Since:
- 0.8
-
STERADIAN
public static final javax.measure.Unit<javax.measure.quantity.SolidAngle> STERADIANThe SI unit for solid angles (sr). The unlocalized name is “steradian”.- Since:
- 0.8
-
MICRORADIAN
public static final javax.measure.Unit<javax.measure.quantity.Angle> MICRORADIANUnit of measurement defined as 10-6 radians (1 µrad). The distance of one microradian of latitude on Earth is approximately 2 millimetres. The system unit isRADIAN
, the unlocalized name is “microradian” and the identifier is EPSG:9109.Related units SI angle units: MICRORADIAN
,RADIAN
.In other systems: DEGREE
,ARC_MINUTE
,ARC_SECOND
,GRAD
.Derived units: STERADIAN
.- Since:
- 0.8
-
RADIAN
public static final javax.measure.Unit<javax.measure.quantity.Angle> RADIANThe SI unit for plane angles (rad). There is 2π radians in a circle. The unlocalized name is “radian” and the identifier is EPSG:9101. This is the base of all other angular units.Related units SI angle units: MICRORADIAN
,RADIAN
.In other systems: DEGREE
,ARC_MINUTE
,ARC_SECOND
,GRAD
.Derived units: STERADIAN
,RADIANS_PER_SECOND
.- Since:
- 0.8
-
DEGREE
public static final javax.measure.Unit<javax.measure.quantity.Angle> DEGREEUnit of measurement defined as π/180 radians (1°). There is 360° in a circle. The system unit isRADIAN
, the unlocalized name is “degree” and the identifier is EPSG:9102.Related units SI angle units: MICRORADIAN
,RADIAN
.In other systems: DEGREE
,ARC_MINUTE
,ARC_SECOND
,GRAD
.Derived units: STERADIAN
.- Since:
- 0.8
-
ARC_MINUTE
public static final javax.measure.Unit<javax.measure.quantity.Angle> ARC_MINUTEUnit of measurement defined as 1/60 degree (1′). The distance of one arc-minute of latitude on Earth is approximately 1852 metres (one nautical mile). The system unit isRADIAN
, the unlocalized name is “arc-minute” and the identifier is EPSG:9103.Related units SI angle units: MICRORADIAN
,RADIAN
.In other systems: DEGREE
,ARC_MINUTE
,ARC_SECOND
,GRAD
.Derived units: STERADIAN
.- Since:
- 0.8
-
ARC_SECOND
public static final javax.measure.Unit<javax.measure.quantity.Angle> ARC_SECONDUnit of measurement defined as 1/(60×60) degree (1″). The distance of one arc-second of latitude on Earth is approximately 31 metres. This unit of measurement is used for rotation terms in Bursa-Wolf parameters. The system unit isRADIAN
, the unlocalized name is “arc-second” and the identifier is EPSG:9104.Related units SI angle units: MICRORADIAN
,RADIAN
.In other systems: DEGREE
,ARC_MINUTE
,ARC_SECOND
,GRAD
.Derived units: STERADIAN
.- Since:
- 0.8
-
GRAD
public static final javax.measure.Unit<javax.measure.quantity.Angle> GRADUnit of measurement defined as π/200 radians (1 grad). There is 400 grads in a circle. The system unit isRADIAN
, the unlocalized name is “grad”, but the “gon” alias is also accepted. The identifier is EPSG:9105.Related units SI angle units: MICRORADIAN
,RADIAN
.In other systems: DEGREE
,ARC_MINUTE
,ARC_SECOND
,GRAD
.Derived units: STERADIAN
.- Since:
- 0.8
-
MILLISECOND
public static final javax.measure.Unit<javax.measure.quantity.Time> MILLISECONDUnit of measurement defined as 10-3 seconds (1 ms). This unit is useful for inter-operability with various methods from the standard Java library. The system unit isSECOND
and the unlocalized name is “millisecond”.Related units SI time units: MILLISECOND
,SECOND
.In other systems: MINUTE
,HOUR
,DAY
,WEEK
,TROPICAL_YEAR
.Derived units: METRES_PER_SECOND
,HERTZ
.- Since:
- 0.3
- See Also:
-
SECOND
public static final javax.measure.Unit<javax.measure.quantity.Time> SECONDThe SI base unit for durations (s). The unlocalized name is “second” and the identifier is EPSG:1040. This is the base of all other temporal units.Related units SI time units: MILLISECOND
,SECOND
.In other systems: MINUTE
,HOUR
,DAY
,WEEK
,TROPICAL_YEAR
.Derived units: METRES_PER_SECOND
,HERTZ
.- Since:
- 0.8
-
MINUTE
public static final javax.measure.Unit<javax.measure.quantity.Time> MINUTEUnit of measurement defined as 60 seconds (1 min). The system unit isSECOND
and the unlocalized name is “minute”.Related units SI time units: MILLISECOND
,SECOND
.In other systems: MINUTE
,HOUR
,DAY
,WEEK
,TROPICAL_YEAR
.Derived units: METRES_PER_SECOND
,HERTZ
.- Since:
- 0.8
-
HOUR
public static final javax.measure.Unit<javax.measure.quantity.Time> HOURUnit of measurement defined as 60×60 seconds (1 h). The system unit isSECOND
and the unlocalized name is “hour”.Related units SI time units: MILLISECOND
,SECOND
.In other systems: MINUTE
,HOUR
,DAY
,WEEK
,TROPICAL_YEAR
.Derived units: KILOMETRES_PER_HOUR
,HERTZ
.- Since:
- 0.8
-
DAY
public static final javax.measure.Unit<javax.measure.quantity.Time> DAYUnit of measurement defined as 24×60×60 seconds (1 d). The system unit isSECOND
and the unlocalized name is “day”.Related units SI time units: MILLISECOND
,SECOND
.In other systems: MINUTE
,HOUR
,DAY
,WEEK
,TROPICAL_YEAR
.Derived units: KILOMETRES_PER_HOUR
,HERTZ
.- Since:
- 0.8
-
WEEK
public static final javax.measure.Unit<javax.measure.quantity.Time> WEEKUnit of measurement defined as 7 days (1 wk). The system unit isSECOND
and the unlocalized name is “week”.Related units SI time units: MILLISECOND
,SECOND
.In other systems: MINUTE
,HOUR
,DAY
,WEEK
,TROPICAL_YEAR
.Derived units: KILOMETRES_PER_HOUR
,HERTZ
.- Since:
- 0.8
-
TROPICAL_YEAR
public static final javax.measure.Unit<javax.measure.quantity.Time> TROPICAL_YEARUnit of measurement approximately equals to 365.24219 days (1 a). This is defined by the International Union of Geological Sciences (IUGS) as exactly 31556925.445 seconds, taken as the length of the tropical year in the the year 2000. The system unit isSECOND
, the unlocalized name is “year” and the identifier is EPSG:1029.Related units SI time units: MILLISECOND
,SECOND
.In other systems: MINUTE
,HOUR
,DAY
,WEEK
,TROPICAL_YEAR
.Derived units: KILOMETRES_PER_HOUR
,HERTZ
.- Since:
- 0.8
-
HERTZ
public static final javax.measure.Unit<javax.measure.quantity.Frequency> HERTZThe SI derived unit for frequency (Hz). One hertz is equal to one cycle per second. The unlocalized name is “hertz”.Related units Components: SECOND
-1- Since:
- 0.8
-
RADIANS_PER_SECOND
The unit for angular velocity (rad/s). The identifier is EPSG:1035.- Since:
- 0.8
-
METRES_PER_SECOND
public static final javax.measure.Unit<javax.measure.quantity.Speed> METRES_PER_SECONDThe SI derived unit for speed (m/s). The unlocalized name is “metres per second” and the identifier is EPSG:1026.Related units SI speed units: METRES_PER_SECOND
.In other systems: KILOMETRES_PER_HOUR
.Components: METRE
∕SECOND
- Since:
- 0.8
-
KILOMETRES_PER_HOUR
public static final javax.measure.Unit<javax.measure.quantity.Speed> KILOMETRES_PER_HOURUnit of measurement defined as 1/3.6 metres per second (1 km/h). The system unit isMETRES_PER_SECOND
and the unlocalized name is “kilometres per hour”.Related units SI speed units: METRES_PER_SECOND
.In other systems: KILOMETRES_PER_HOUR
.Components: KILOMETRE
∕HOUR
- Since:
- 0.8
-
METRES_PER_SECOND_SQUARED
public static final javax.measure.Unit<javax.measure.quantity.Acceleration> METRES_PER_SECOND_SQUAREDThe SI derived unit for acceleration (m/s²). The unlocalized name is “metres per second squared”.Related units SI acceleration units: METRES_PER_SECOND_SQUARED
.In other systems: GAL
.Components: METRES_PER_SECOND
∕SECOND
- Since:
- 1.2
-
GAL
public static final javax.measure.Unit<javax.measure.quantity.Acceleration> GALUnit of measurement defined as 1/100 metres per second squared (1 cm/s²). This is a CGS unit (not a SI unit) used in geodesy and geophysics to express acceleration due to gravity. The system unit isMETRES_PER_SECOND_SQUARED
, the symbol is "Gal" (upper-case first letter) and the unlocalized name is “gal” (lower-case letter).Related units SI acceleration units: METRES_PER_SECOND_SQUARED
.In other systems: GAL
.Components: CENTIMETRE
∕SECOND
²- Since:
- 1.2
-
PASCAL
public static final javax.measure.Unit<javax.measure.quantity.Pressure> PASCALThe SI derived unit for pressure (Pa). One pascal is equal to 1 N/m². Pressures are often used in parametric CRS for height measurements on a vertical axis. The unlocalized name is “pascal”.Related units SI pressure units: PASCAL
,HECTOPASCAL
.In other systems: DECIBAR
,BAR
,ATMOSPHERE
.Components: NEWTON
∕SQUARE_METRE
- Since:
- 0.8
-
HECTOPASCAL
public static final javax.measure.Unit<javax.measure.quantity.Pressure> HECTOPASCALUnit of measurement defined as 100 pascals (1 hPa). The hectopascal is the international unit for measuring atmospheric or barometric pressure and is exactly equal to one millibar. The system unit isPASCAL
and the unlocalized name is “hectopascal”.Related units SI pressure units: PASCAL
,HECTOPASCAL
.In other systems: DECIBAR
,BAR
,ATMOSPHERE
.Components: NEWTON
∕SQUARE_METRE
- Since:
- 0.8
-
DECIBAR
public static final javax.measure.Unit<javax.measure.quantity.Pressure> DECIBARUnit of measurement defined as 10000 pascals (1 dbar). This unit is used in oceanography as there is an approximate numerical equivalence between pressure changes in decibars and depth changes in metres underwater. The system unit isPASCAL
and the unlocalized name is “decibar”.Related units SI pressure units: PASCAL
,HECTOPASCAL
.In other systems: DECIBAR
,BAR
,ATMOSPHERE
.Components: NEWTON
∕SQUARE_METRE
- Since:
- 0.8
-
BAR
public static final javax.measure.Unit<javax.measure.quantity.Pressure> BARUnit of measurement defined as 100000 pascals (1 bar). One bar is slightly less than the average atmospheric pressure on Earth at sea level. One millibar is exactly equal to one hectopascal. The system unit isPASCAL
and the unlocalized name is “bar”.Related units SI pressure units: PASCAL
,HECTOPASCAL
.In other systems: DECIBAR
,BAR
,ATMOSPHERE
.Components: NEWTON
∕SQUARE_METRE
- Since:
- 0.8
-
ATMOSPHERE
public static final javax.measure.Unit<javax.measure.quantity.Pressure> ATMOSPHEREUnit of measurement defined as 101325 pascals (1 atm). One atmosphere reflects the pressure at the mean sea level for countries around 49°N of latitude. The system unit isPASCAL
and the unlocalized name is “atmosphere”.Related units SI pressure units: PASCAL
,HECTOPASCAL
.In other systems: DECIBAR
,BAR
,ATMOSPHERE
.Components: NEWTON
∕SQUARE_METRE
- Since:
- 0.8
-
NEWTON
public static final javax.measure.Unit<javax.measure.quantity.Force> NEWTONThe SI derived unit for force (N). One newton is the force required to give a mass of 1 kg an acceleration of 1 m/s². The unlocalized name is “newton”.- Since:
- 0.8
-
JOULE
public static final javax.measure.Unit<javax.measure.quantity.Energy> JOULEThe SI derived unit for energy (J). The unlocalized name is “joule”.- Since:
- 0.8
-
WATT
public static final javax.measure.Unit<javax.measure.quantity.Power> WATTThe SI derived unit for power (W). One watt is equal to one joule per second. The unlocalized name is “watt”.- Since:
- 0.8
-
VOLT
public static final javax.measure.Unit<javax.measure.quantity.ElectricPotential> VOLTThe SI derived unit for electric potential difference (V). The unlocalized name is “volt”.- Since:
- 0.8
-
AMPERE
public static final javax.measure.Unit<javax.measure.quantity.ElectricCurrent> AMPEREThe SI base unit for electric current (A). The unlocalized name is “ampere”.- Since:
- 0.8
-
COULOMB
public static final javax.measure.Unit<javax.measure.quantity.ElectricCharge> COULOMBThe SI derived unit for electric charge (C). One coulomb is the charge transferred by a current of one ampere during one second. The unlocalized name is “coulomb”.- Since:
- 0.8
-
FARAD
public static final javax.measure.Unit<javax.measure.quantity.ElectricCapacitance> FARADThe SI derived unit for electric capacitance (F). The unlocalized name is “farad”.- Since:
- 0.8
-
OHM
public static final javax.measure.Unit<javax.measure.quantity.ElectricResistance> OHMThe SI derived unit for electric resistance (Ω). This is the inverse of electric conductance. The unlocalized name is “ohm”.- Since:
- 0.8
-
SIEMENS
public static final javax.measure.Unit<javax.measure.quantity.ElectricConductance> SIEMENSThe SI derived unit for electric conductance (S). This is the inverse of electric resistance. The unlocalized name is “siemens”.- Since:
- 0.8
-
WEBER
public static final javax.measure.Unit<javax.measure.quantity.MagneticFlux> WEBERThe SI derived unit for magnetic flux (Wb). The unlocalized name is “weber”.- Since:
- 0.8
-
TESLA
public static final javax.measure.Unit<javax.measure.quantity.MagneticFluxDensity> TESLAThe SI derived unit for magnetic flux density (T). The unlocalized name is “tesla”.Related units Components: WEBER
∕SQUARE_METRE
- Since:
- 0.8
-
HENRY
public static final javax.measure.Unit<javax.measure.quantity.ElectricInductance> HENRYThe SI derived unit for inductance (H). The unlocalized name is “henry”.- Since:
- 0.8
-
KELVIN
public static final javax.measure.Unit<javax.measure.quantity.Temperature> KELVINThe SI base unit for thermodynamic temperature (K). The unlocalized name is “kelvin”.Related units SI temperature units: KELVIN
.In other systems: CELSIUS
,FAHRENHEIT
.- Since:
- 0.8
-
CELSIUS
public static final javax.measure.Unit<javax.measure.quantity.Temperature> CELSIUSUnit of measurement defined as the temperature in Kelvin minus 273.15. The symbol is °C and the unlocalized name is “Celsius”. Note that this is the only SI unit with an upper-case letter in its name.Related units SI temperature units: KELVIN
.In other systems: CELSIUS
,FAHRENHEIT
.- Since:
- 0.8
-
FAHRENHEIT
public static final javax.measure.Unit<javax.measure.quantity.Temperature> FAHRENHEITUnit of measurement defined as 1.8 degree Celsius plus 32. The symbol is °F and the unlocalized name is “Fahrenheit” (note the upper-case "F" letter).- Since:
- 0.8
-
CANDELA
public static final javax.measure.Unit<javax.measure.quantity.LuminousIntensity> CANDELAThe SI base unit for luminous intensity (cd). The unlocalized name is “candela”.- Since:
- 0.8
-
LUMEN
public static final javax.measure.Unit<javax.measure.quantity.LuminousFlux> LUMENThe SI derived unit for luminous flux (lm). The unlocalized name is “lumen”.- Since:
- 0.8
-
LUX
public static final javax.measure.Unit<javax.measure.quantity.Illuminance> LUXThe SI derived unit for illuminance (lx). The unlocalized name is “lux”.Related units Components: LUX
∕SQUARE_METRE
- Since:
- 0.8
-
GRAM
public static final javax.measure.Unit<javax.measure.quantity.Mass> GRAMA SI conventional unit for mass (g). The unlocalized name is “gram”.- Since:
- 0.8
-
KILOGRAM
public static final javax.measure.Unit<javax.measure.quantity.Mass> KILOGRAMThe SI base unit for mass (kg). The unlocalized name is “kilogram”.- Since:
- 0.8
-
MOLE
public static final javax.measure.Unit<javax.measure.quantity.AmountOfSubstance> MOLEThe SI base unit for amount of substance (mol). The unlocalized name is “mole”.- Since:
- 0.8
-
UNITY
public static final javax.measure.Unit<javax.measure.quantity.Dimensionless> UNITYThe base dimensionless unit for scale measurements. The unlocalized name is “unity” and the identifier is EPSG:9201. This is the base of all other scale units:PERCENT
(%),PPM
(ppm) andPIXEL
(px) among others.- Since:
- 0.8
-
PERCENT
public static final javax.measure.Unit<javax.measure.quantity.Dimensionless> PERCENTDimensionless unit for percentages (%). The system unit isUNITY
and the unlocalized name is “percentage”.- Since:
- 0.8
- See Also:
-
PPM
public static final javax.measure.Unit<javax.measure.quantity.Dimensionless> PPMDimensionless unit for parts per million (ppm). The system unit isUNITY
, the unlocalized name is “parts per million” and the identifier is EPSG:9202.- Since:
- 0.3
- See Also:
-
DECIBEL
public static final javax.measure.Unit<javax.measure.quantity.Dimensionless> DECIBELSub-division of logarithm of ratio of the measured quantity to a reference quantity (dB).- Since:
- 1.0
-
PSU
Salinity measured using PSS-78. While this is a dimensionless measurement, the"psu"
symbol is sometimes added to PSS-78 measurement. However, this is officially discouraged.- Since:
- 0.8
-
SIGMA
static final javax.measure.Unit<javax.measure.quantity.Dimensionless> SIGMASigma-level, used in oceanography. This is a way to measure a depth as a fraction of the sea floor depth.If we make this field public in a future SIS version, we should consider introducing a new quantity type. The type to introduce has not yet been determined.
-
PIXEL
public static final javax.measure.Unit<javax.measure.quantity.Dimensionless> PIXELDimensionless unit for pixels (px). The unlocalized name is “pixel”. This unity should not be confused withPOINT
, which is approximately equal to 1/72 of inch.- See Also:
-
initialized
static final boolean initializedSets totrue
by the static initializer after the initialization has been completed. This is a safety against unexpected changes in theUnitRegistry.HARD_CODED
map.We use here a "lazy final initialization" pattern. We rely on the fact that this field is initialized to
true
only at the end of the following static initializer. All methods invoked in the static initializer will see the default value, which isfalse
, until the initializer fully completed. While apparently dangerous, this behavior is actually documented in section 12.4.1 of Java language specification:The fact that initialization code is unrestricted allows examples to be constructed where the value of a class variable can be observed when it still has its initial default value, before its initializing expression is evaluated, but such examples are rare in practice. (…snip…) The full power of the Java programming language is available in these initializers; programmers must exercise some care. This power places an extra burden on code generators, but this burden would arise in any case because the Java programming language is concurrent.
-
-
Constructor Details
-
Units
private Units()Do not allows instantiation of this class.
-
-
Method Details
-
add
private static <Q extends javax.measure.Quantity<Q>> SystemUnit<Q> add(Class<Q> quantity, ScalarFactory<Q> factory, UnitDimension dimension, String symbol, byte scope, short epsg) Invoked byUnits
static class initializer for registering SI base and derived units. This method shall be invoked in a single thread by theUnits
class initializer only.- Parameters:
quantity
- the type of quantity that uses this unit (should not be null).factory
- the factory to use for creating quantities, ornull
if none.dimension
- the unit dimension.symbol
- the unit symbol, ornull
if this unit has no specific symbol.scope
-UnitRegistry.SI
,UnitRegistry.ACCEPTED
, other constants or 0 if unknown.epsg
- the EPSG code, or 0 if this unit has no EPSG code.
-
add
private static <Q extends javax.measure.Quantity<Q>> ConventionalUnit<Q> add(AbstractUnit<Q> target, javax.measure.UnitConverter toTarget, String symbol, byte scope, short epsg) Invoked byUnits
static class initializer for registering SI conventional units. This method shall be invoked in a single thread by theUnits
class initializer only.The
target
argument should be an instance ofSystemUnit
. The only exception is for creating theDECIBEL
unit base on the bel conventional unit.If the
target
unit holds a list of related units (i.e. conventional units that cannot be computed easily by appending a SI prefix), then the new conventional unit is added to that list of related units. For example, "foot" is related to "metre" and "degree Celsius" is related to "Kelvin", but "kilometre" is not recorded as related to "metre" because this relationship can be inferred automatically without the need of arelated
table. The unrecorded units are all SI units related totarget
by a scale factor without offset. -
get
Returns the system unit for the given dimension, ornull
if none. Note that this method cannot distinguish the different kinds of dimensionless units. If the symbol or the quantity type is known, useget(String)
orget(Class)
instead.Implementation note: this method must be defined in this
Units
class in order to force a class initialization before use. -
get
Returns the system unit for the given quantity, ornull
if none.Implementation note: this method must be defined in this
Units
class in order to force a class initialization before use. -
get
Returns the system unit for the given symbol, ornull
if none. This method does not perform any parsing (prefix, exponents, etc). It is only for getting one of the predefined constants, for example after deserialization.Implementation note: this method must be defined in this
Units
class in order to force a class initialization before use.- See Also:
-
isAngular
public static boolean isAngular(javax.measure.Unit<?> unit) Returnstrue
if the given unit is a linear unit. Linear units are convertible toDEGREE
.Angular units are dimensionless, which may be a cause of confusion with other dimensionless units like
UNITY
orPPM
. This method take care of differentiating angular units from other dimensionless units.- Parameters:
unit
- the unit to check (may benull
).- Returns:
true
if the given unit is non-null and angular.- See Also:
-
isLinear
public static boolean isLinear(javax.measure.Unit<?> unit) Returnstrue
if the given unit is a linear unit. Linear units are convertible toMETRE
.- Parameters:
unit
- the unit to check (may benull
).- Returns:
true
if the given unit is non-null and linear.- See Also:
-
isPressure
public static boolean isPressure(javax.measure.Unit<?> unit) Returnstrue
if the given unit is a pressure unit. Pressure units are convertible toPASCAL
. Those units are sometimes used instead of linear units for altitude measurements.- Parameters:
unit
- the unit to check (may benull
).- Returns:
true
if the given unit is non-null and a pressure unit.
-
isTemporal
public static boolean isTemporal(javax.measure.Unit<?> unit) Returnstrue
if the given unit is a temporal unit. Temporal units are convertible toSECOND
.- Parameters:
unit
- the unit to check (may benull
).- Returns:
true
if the given unit is non-null and temporal.- See Also:
-
isScale
public static boolean isScale(javax.measure.Unit<?> unit) - Parameters:
unit
- the unit to check (may benull
).- Returns:
true
if the given unit is non-null and a dimensionless scale.- See Also:
-
ensureAngular
public static javax.measure.Unit<javax.measure.quantity.Angle> ensureAngular(javax.measure.Unit<?> unit) throws IllegalArgumentException Makes sure that the specified unit is either null or an angular unit. This method is used for argument checks in constructors and setter methods.- Parameters:
unit
- the unit to check, ornull
if none.- Returns:
- the given
unit
argument, which may be null. - Throws:
IllegalArgumentException
- ifunit
is non-null and not an angular unit.- See Also:
-
ensureLinear
public static javax.measure.Unit<javax.measure.quantity.Length> ensureLinear(javax.measure.Unit<?> unit) throws IllegalArgumentException Makes sure that the specified unit is either null or a linear unit. This method is used for argument checks in constructors and setter methods.- Parameters:
unit
- the unit to check, ornull
if none.- Returns:
- the given
unit
argument, which may be null. - Throws:
IllegalArgumentException
- ifunit
is non-null and not a linear unit.- See Also:
-
ensureTemporal
public static javax.measure.Unit<javax.measure.quantity.Time> ensureTemporal(javax.measure.Unit<?> unit) throws IllegalArgumentException Makes sure that the specified unit is either null or a temporal unit. This method is used for argument checks in constructors and setter methods.- Parameters:
unit
- the unit to check, ornull
if none.- Returns:
- the given
unit
argument, which may be null. - Throws:
IllegalArgumentException
- ifunit
is non-null and not a temporal unit.- See Also:
-
ensureScale
public static javax.measure.Unit<javax.measure.quantity.Dimensionless> ensureScale(javax.measure.Unit<?> unit) throws IllegalArgumentException Makes sure that the specified unit is either null or a scale unit. This method is used for argument checks in constructors and setter methods.- Parameters:
unit
- the unit to check, ornull
if none.- Returns:
- the given
unit
argument, which may be null. - Throws:
IllegalArgumentException
- ifunit
is non-null and not a scale unit.- See Also:
-
multiply
public static <Q extends javax.measure.Quantity<Q>> javax.measure.Unit<Q> multiply(javax.measure.Unit<Q> unit, double numerator, double denominator) Multiplies the given unit by the given ratio. For example, multiplyingCENTIMETRE
by 254/100 givesINCH
. Invoking this method is equivalent to invokingUnit.multiply(numerator / denominator)
except that the use of a ration of integer values help Apache SIS to improve accuracy when more than one arithmetic operation are chained.- Type Parameters:
Q
- the quantity measured by the unit.- Parameters:
unit
- the unit to multiply.numerator
- the numerator of the multiplication factor.denominator
- the denominator of the multiplication factor.- Returns:
- the unit multiplied by the given factor.
- Since:
- 0.8
-
toStandardUnit
public static <Q extends javax.measure.Quantity<Q>> double toStandardUnit(javax.measure.Unit<Q> unit) Returns the factor by which to multiply the standard unit in order to get the given unit. The "standard" unit is usually the SI unit on which the given unit is based, as given byUnit.getSystemUnit()
.Example: if the given unit isIf the given unit isKILOMETRE
, then this method returns 1000 since a measurement in kilometres must be multiplied by 1000 in order to give the equivalent measurement in the "standard" units (hereMETRE
).null
or if the conversion to the "standard" unit cannot be expressed by a single multiplication factor, then this method returnsDouble.NaN
.- Type Parameters:
Q
- the quantity measured by the unit, ornull
.- Parameters:
unit
- the unit for which we want the multiplication factor to standard unit, ornull
.- Returns:
- the factor by which to multiply a measurement in the given unit in order to get an equivalent measurement in the standard unit, or NaN if the conversion cannot be expressed by a scale factor.
-
converter
Creates a linear converter from the given scale and offset.- Parameters:
scale
- the scale factor, ornull
if none (default value of 1).offset
- the offset, ornull
if none (default value of 0).- Returns:
- a converter for the given scale and offset.
- Since:
- 1.0
- See Also:
-
coefficients
Returns the coefficients of the given converter expressed as a polynomial equation. This method returns the first of the following choices that apply:- If the given converter is identity, returns an empty array.
- If the given converter shifts the values without scaling them (for example the conversion from Kelvin to Celsius degrees), returns an array of length 1 containing only the offset.
- If the given converter scales the values (optionally in addition to shifting them), returns an array of length 2 containing the offset and scale factor, in that order.
null
if it cannot get the polynomial equation coefficients from the given converter.- Parameters:
converter
- the converter from which to get the coefficients of the polynomial equation, ornull
.- Returns:
- the polynomial equation coefficients (may be any length, including zero), or
null
if the given converter isnull
or if this method cannot get the coefficients. - Since:
- 0.8
-
derivative
public static double derivative(javax.measure.UnitConverter converter, double value) Returns the derivative of the given converter at the given value, orNaN
if this method cannot compute it.- Parameters:
converter
- the converter for which we want the derivative at a given point, ornull
.value
- the point at which to compute the derivative. Ignored (can beDouble.NaN
) if the conversion is linear.- Returns:
- the derivative at the given point, or
NaN
if unknown. - See Also:
-
valueOf
Parses the given symbol. Invoking this method is equivalent to invokingUnitFormat.parse(CharSequence)
on a shared locale-independent instance. This method is capable to handle some symbols found during WKT parsing or in XML files. The list of symbols supported by this method is implementation-dependent and may change in future SIS versions.Parsing authority codes
If the givenuom
arguments is of the form"EPSG:####"
,"urn:ogc:def:uom:EPSG:####"
or"http://www.opengis.net/def/uom/EPSG/0/####"
(ignoring case and whitespaces around separators), then"####"
is parsed as an integer and forwarded to thevalueOfEPSG(int)
method.Note on netCDF unit symbols
In netCDF files, values of "unit" attribute are concatenations of an angular unit with an axis direction, as in"degrees_east"
or"degrees_north"
. ThisvalueOf(…)
method ignores those suffixes and unconditionally returnsDEGREE
for all axis directions.- Parameters:
uom
- the symbol to parse, ornull
.- Returns:
- the parsed symbol, or
null
ifuom
was null. - Throws:
javax.measure.format.ParserException
- if the given symbol cannot be parsed.- See Also:
-
valueOfEPSG
Returns a hard-coded unit from an EPSG code. Thecode
argument given to this method shall be a code identifying a record in the"Unit of Measure"
table of the EPSG geodetic dataset. If this method does not recognize the given code, then it returnsnull
.The list of units recognized by this method is not exhaustive. This method recognizes the base units declared in the
TARGET_UOM_CODE
column of the above-cited table, and some frequently-used units. The list of recognized units may be updated in any future version of SIS.The
EPSGDataAccess
class uses this method for fetching the base units, and derives automatically other units from the information found in the EPSG database. This method is also used by other classes not directly related to the EPSG database, likeCommonAuthorityFactory
which uses EPSG codes for identifying units.The currently recognized values are:
EPSG codes for units Angular units Code Unit 9101 radian 9102 decimal degree 9103 minute 9104 second 9105 grad 9107 degree-minute-second 9108 degree-minute-second 9109 microradian 9110 sexagesimal degree-minute-second 9111 sexagesimal degree-minute 9122 decimal degree Linear units Code Unit 1025 millimetre 1033 centimetre 9001 metre 9002 foot 9003 US survey foot 9030 nautical mile 9036 kilometre 9093 statute mile Time units Code Unit 1029 year 1040 second Scale units Code Unit 9201 unity 9202 parts per million 9203 unity Note: EPSG uses code 9102 (degree) for prime meridian and coordinate operation parameters, and code 9122 (degree (supplier to define representation)) for coordinate system axes. But Apache SIS considers those two codes as synonymous.- Parameters:
code
- the EPSG code for a unit of measurement.- Returns:
- the unit, or
null
if the code is unrecognized. - See Also:
-
getEpsgCode
Returns the EPSG code of the given units, ornull
if unknown. This method is the converse ofvalueOfEPSG(int)
.The same unit may be represented by different EPSG codes depending on the context:
- EPSG:9102 – degree – is used for prime meridian and coordinate operation parameters.
- EPSG:9122 – degree (supplier to define representation) – is used for coordinate system axes.
inAxis
argument, which specifies whether the code will be used for axis definition or in other context.- Parameters:
unit
- the unit for which to get the EPSG code.inAxis
-true
for a unit used in Coordinate System Axis definition.- Returns:
- the EPSG code of the given units, or
null
if unknown. - Since:
- 0.4
- See Also:
-