public final class Units extends Static
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 |
Defined in the sis-utility
module
Modifier and Type | Field and Description |
---|---|
static Unit<ElectricCurrent> |
AMPERE
The SI base unit for electric current (A).
|
static Unit<Angle> |
ARC_MINUTE
Unit of measurement defined as 1/60 degree (1′).
|
static Unit<Angle> |
ARC_SECOND
Unit of measurement defined as 1/(60×60) degree (1″).
|
static Unit<Pressure> |
ATMOSPHERE
Unit of measurement defined as 101325 pascals (1 atm).
|
static Unit<Pressure> |
BAR
Unit of measurement defined as 100000 pascals (1 bar).
|
static Unit<LuminousIntensity> |
CANDELA
The SI base unit for luminous intensity (cd).
|
static Unit<Temperature> |
CELSIUS
Unit of measurement defined as the temperature in Kelvin minus 273.15.
|
static Unit<Length> |
CENTIMETRE
Unit of measurement defined as 0.01 metres (1 cm).
|
static Unit<Length> |
CLARKE_FOOT
Unit of measurement defined as 0.3047972654 metres.
|
static Unit<ElectricCharge> |
COULOMB
The SI derived unit for electric charge (C).
|
static Unit<Volume> |
CUBIC_METRE
The SI derived unit for volume (m³).
|
static Unit<Time> |
DAY
Unit of measurement defined as 24×60×60 seconds (1 d).
|
static Unit<Pressure> |
DECIBAR
Unit of measurement defined as 10000 pascals (1 dbar).
|
static Unit<Angle> |
DEGREE
Unit of measurement defined as π/180 radians (1°).
|
static Unit<Temperature> |
FAHRENHEIT
Unit of measurement defined as 1.8 degree Celsius plus 32.
|
static Unit<ElectricCapacitance> |
FARAD
The SI derived unit for electric capacitance (F).
|
static Unit<Length> |
FOOT
Unit of measurement defined as exactly 0.3048 metres (1 ft).
|
static Unit<Angle> |
GRAD
Unit of measurement defined as π/200 radians (1 grad).
|
static Unit<Mass> |
GRAM
A SI conventional unit for mass (g).
|
static Unit<Area> |
HECTARE
Unit of measurement defined as 10,000 square metres (1 ha).
|
static Unit<Pressure> |
HECTOPASCAL
Unit of measurement defined as 100 pascals (1 hPa).
|
static Unit<ElectricInductance> |
HENRY
The SI derived unit for inductance (H).
|
static Unit<Frequency> |
HERTZ
The SI derived unit for frequency (Hz).
|
static Unit<Time> |
HOUR
Unit of measurement defined as 60×60 seconds (1 h).
|
static Unit<Length> |
INCH
Unit of measurement defined as 2.54 centimetres (1 in).
|
static Unit<Energy> |
JOULE
The SI derived unit for energy (J).
|
static Unit<Temperature> |
KELVIN
The SI base unit for thermodynamic temperature (K).
|
static Unit<Mass> |
KILOGRAM
The SI base unit for mass (kg).
|
static Unit<Length> |
KILOMETRE
Unit of measurement defined as 1000 metres (1 km).
|
static Unit<Speed> |
KILOMETRES_PER_HOUR
Unit of measurement defined as 1/3.6 metres per second (1 km/h).
|
static Unit<Volume> |
LITRE
The unit for litre volume (L, l or ℓ).
|
static Unit<LuminousFlux> |
LUMEN
The SI derived unit for luminous flux (lm).
|
static Unit<Illuminance> |
LUX
The SI derived unit for illuminance (lx).
|
static Unit<Length> |
METRE
The SI base unit for distances (m).
|
static Unit<Speed> |
METRES_PER_SECOND
The SI derived unit for speed (m/s).
|
static Unit<Angle> |
MICRORADIAN
Unit of measurement defined as 10-6 radians (1 µrad).
|
static Unit<Length> |
MILLIMETRE
Unit of measurement defined as 0.001 metres (1 mm).
|
static Unit<Time> |
MILLISECOND
Unit of measurement defined as 10-3 seconds (1 ms).
|
static Unit<Time> |
MINUTE
Unit of measurement defined as 60 seconds (1 min).
|
static Unit<AmountOfSubstance> |
MOLE
The SI base unit for amount of substance (mol).
|
static Unit<Length> |
NANOMETRE
Unit of measurement defined as 10-9 metres (1 nm).
|
static Unit<Length> |
NAUTICAL_MILE
Unit of measurement defined as exactly 1852 metres (1 M).
|
static Unit<Force> |
NEWTON
The SI derived unit for force (N).
|
static Unit<ElectricResistance> |
OHM
The SI derived unit for electric resistance (Ω).
|
static Unit<Pressure> |
PASCAL
The SI derived unit for pressure (Pa).
|
static Unit<Dimensionless> |
PERCENT
Dimensionless unit for percentages (%).
|
static Unit<Dimensionless> |
PIXEL
Dimensionless unit for pixels (px).
|
static Unit<Length> |
POINT
Unit of measurement defined as 0.013837 inch (1 pt).
|
static Unit<Dimensionless> |
PPM
Dimensionless unit for parts per million (ppm).
|
static Unit<Salinity> |
PSU
Salinity measured using PSS-78.
|
static Unit<Angle> |
RADIAN
The SI unit for plane angles (rad).
|
static Unit<AngularVelocity> |
RADIANS_PER_SECOND
The unit for angular velocity (rad/s).
|
static Unit<Time> |
SECOND
The SI base unit for durations (s).
|
static Unit<ElectricConductance> |
SIEMENS
The SI derived unit for electric conductance (S).
|
static Unit<Area> |
SQUARE_METRE
The SI derived unit for area (m²).
|
static Unit<Length> |
STATUTE_MILE
Unit of measurement defined as exactly 1609.344 metres (1 mi).
|
static Unit<SolidAngle> |
STERADIAN
The SI unit for solid angles (sr).
|
static Unit<MagneticFluxDensity> |
TESLA
The SI derived unit for magnetic flux density (T).
|
static Unit<Time> |
TROPICAL_YEAR
Unit of measurement approximatively equals to 365.24219 days (1 a).
|
static Unit<Dimensionless> |
UNITY
The base dimensionless unit for scale measurements.
|
static Unit<Length> |
US_SURVEY_FOOT
Unit of measurement approximatively equals to 0.3048006096… metres.
|
static Unit<ElectricPotential> |
VOLT
The SI derived unit for electric potential difference (V).
|
static Unit<Power> |
WATT
The SI derived unit for power (W).
|
static Unit<MagneticFlux> |
WEBER
The SI derived unit for magnetic flux (Wb).
|
static Unit<Time> |
WEEK
Unit of measurement defined as 7 days (1 wk).
|
Modifier and Type | Method and Description |
---|---|
static Number[] |
coefficients(UnitConverter converter)
Returns the coefficients of the given converter expressed as a polynomial equation.
|
static double |
derivative(UnitConverter converter,
double value)
Returns the derivative of the given converter at the given value,
or
NaN if this method can not compute it. |
static Unit<Angle> |
ensureAngular(Unit<?> unit)
Makes sure that the specified unit is either null or an angular unit.
|
static Unit<Length> |
ensureLinear(Unit<?> unit)
Makes sure that the specified unit is either null or a linear unit.
|
static Unit<Dimensionless> |
ensureScale(Unit<?> unit)
Makes sure that the specified unit is either null or a scale unit.
|
static Unit<Time> |
ensureTemporal(Unit<?> unit)
Makes sure that the specified unit is either null or a temporal unit.
|
static Integer |
getEpsgCode(Unit<?> unit,
boolean inAxis)
Returns the EPSG code of the given units, or
null if unknown. |
static boolean |
isAngular(Unit<?> unit)
Returns
true if the given unit is a linear unit. |
static boolean |
isLinear(Unit<?> unit)
Returns
true if the given unit is a linear unit. |
static boolean |
isPressure(Unit<?> unit)
Returns
true if the given unit is a pressure unit. |
static boolean |
isScale(Unit<?> unit)
Returns
true if the given unit is a dimensionless scale unit. |
static boolean |
isTemporal(Unit<?> unit)
Returns
true if the given unit is a temporal unit. |
static <Q extends Quantity<Q>> |
multiply(Unit<Q> unit,
double factor)
Deprecated.
Replaced by Apache SIS implementation of
Unit.multiply(double) . |
static <Q extends Quantity<Q>> |
multiply(Unit<Q> unit,
double numerator,
double denominator)
Multiplies the given unit by the given ratio.
|
static <Q extends Quantity<Q>> |
toStandardUnit(Unit<Q> unit)
Returns the factor by which to multiply the standard unit in order to get the given unit.
|
static Unit<?> |
valueOf(String uom)
Parses the given symbol.
|
static Unit<?> |
valueOfEPSG(int code)
Returns a hard-coded unit from an EPSG code.
|
public static final Unit<Length> NANOMETRE
METRE
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 . |
DefaultBand.getBoundUnits()
public static final Unit<Length> MILLIMETRE
METRE
,
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 . |
public static final Unit<Length> CENTIMETRE
METRE
,
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 . |
public static final Unit<Length> METRE
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 . |
public static final Unit<Length> KILOMETRE
METRE
,
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 . |
public static final Unit<Length> NAUTICAL_MILE
METRE
,
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 . |
public static final Unit<Length> STATUTE_MILE
METRE
.
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 . |
public static final Unit<Length> US_SURVEY_FOOT
METRE
,
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 . |
public static final Unit<Length> CLARKE_FOOT
METRE
,
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 . |
public static final Unit<Length> FOOT
METRE
,
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 . |
public static final Unit<Length> INCH
METRE
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 . |
public static final Unit<Length> POINT
METRE
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 . |
public static final Unit<Area> SQUARE_METRE
Related units:
SI area units: | SQUARE_METRE , HECTARE . |
Derived units: | CUBIC_METRE . |
public static final Unit<Area> HECTARE
Related units:
SI area units: | SQUARE_METRE , HECTARE . |
Derived units: | CUBIC_METRE . |
public static final Unit<Volume> CUBIC_METRE
public static final Unit<Volume> LITRE
public static final Unit<SolidAngle> STERADIAN
public static final Unit<Angle> MICRORADIAN
RADIAN
,
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 . |
public static final Unit<Angle> RADIAN
Related units:
SI angle units: | MICRORADIAN , RADIAN . |
In other systems: | DEGREE , ARC_MINUTE , ARC_SECOND , GRAD . |
Derived units: | STERADIAN , RADIANS_PER_SECOND . |
public static final Unit<Angle> DEGREE
RADIAN
,
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 . |
public static final Unit<Angle> ARC_MINUTE
RADIAN
,
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 . |
public static final Unit<Angle> ARC_SECOND
RADIAN
,
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 . |
public static final Unit<Angle> GRAD
RADIAN
,
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 . |
public static final Unit<Time> MILLISECOND
SECOND
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 . |
TimeUnit.MILLISECONDS
public static final Unit<Time> SECOND
Related units:
SI time units: | MILLISECOND , SECOND . |
In other systems: | MINUTE , HOUR , DAY , WEEK , TROPICAL_YEAR . |
Derived units: | METRES_PER_SECOND , HERTZ . |
public static final Unit<Time> MINUTE
SECOND
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 . |
public static final Unit<Time> HOUR
SECOND
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 . |
public static final Unit<Time> DAY
SECOND
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 . |
public static final Unit<Time> WEEK
SECOND
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 . |
public static final Unit<Time> TROPICAL_YEAR
SECOND
,
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 . |
public static final Unit<Frequency> HERTZ
Related units:
Components: | SECOND -1 |
public static final Unit<AngularVelocity> RADIANS_PER_SECOND
public static final Unit<Speed> METRES_PER_SECOND
Related units:
SI speed units: | METRES_PER_SECOND . |
In other systems: | KILOMETRES_PER_HOUR . |
Components: | METRE ∕ SECOND |
public static final Unit<Speed> KILOMETRES_PER_HOUR
METRES_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 |
public static final Unit<Pressure> PASCAL
Related units:
SI pressure units: | PASCAL , HECTOPASCAL . |
In other systems: | DECIBAR , BAR , ATMOSPHERE . |
Components: | NEWTON ∕ SQUARE_METRE |
public static final Unit<Pressure> HECTOPASCAL
PASCAL
and the unlocalized name is “hectopascal”.
Related units:
SI pressure units: | PASCAL , HECTOPASCAL . |
In other systems: | DECIBAR , BAR , ATMOSPHERE . |
Components: | NEWTON ∕ SQUARE_METRE |
public static final Unit<Pressure> DECIBAR
PASCAL
and the unlocalized name is “decibar”.
Related units:
SI pressure units: | PASCAL , HECTOPASCAL . |
In other systems: | DECIBAR , BAR , ATMOSPHERE . |
Components: | NEWTON ∕ SQUARE_METRE |
public static final Unit<Pressure> BAR
PASCAL
and the unlocalized name is “bar”.
Related units:
SI pressure units: | PASCAL , HECTOPASCAL . |
In other systems: | DECIBAR , BAR , ATMOSPHERE . |
Components: | NEWTON ∕ SQUARE_METRE |
public static final Unit<Pressure> ATMOSPHERE
PASCAL
and the unlocalized name is “atmosphere”.
Related units:
SI pressure units: | PASCAL , HECTOPASCAL . |
In other systems: | DECIBAR , BAR , ATMOSPHERE . |
Components: | NEWTON ∕ SQUARE_METRE |
public static final Unit<Force> NEWTON
public static final Unit<Energy> JOULE
public static final Unit<Power> WATT
public static final Unit<ElectricPotential> VOLT
public static final Unit<ElectricCurrent> AMPERE
public static final Unit<ElectricCharge> COULOMB
public static final Unit<ElectricCapacitance> FARAD
public static final Unit<ElectricResistance> OHM
public static final Unit<ElectricConductance> SIEMENS
public static final Unit<MagneticFlux> WEBER
public static final Unit<MagneticFluxDensity> TESLA
Related units:
Components: | WEBER ∕ SQUARE_METRE |
public static final Unit<ElectricInductance> HENRY
public static final Unit<Temperature> KELVIN
Related units:
SI temperature units: | KELVIN . |
In other systems: | CELSIUS , FAHRENHEIT . |
public static final Unit<Temperature> CELSIUS
Related units:
SI temperature units: | KELVIN . |
In other systems: | CELSIUS , FAHRENHEIT . |
public static final Unit<Temperature> FAHRENHEIT
public static final Unit<LuminousIntensity> CANDELA
public static final Unit<LuminousFlux> LUMEN
public static final Unit<Illuminance> LUX
Related units:
Components: | LUX ∕ SQUARE_METRE |
public static final Unit<Mass> GRAM
public static final Unit<Mass> KILOGRAM
public static final Unit<AmountOfSubstance> MOLE
public static final Unit<Dimensionless> UNITY
PERCENT
(%),
PPM
(ppm) and
PIXEL
(px)
among others.public static final Unit<Dimensionless> PERCENT
UNITY
and the unlocalized name is “percentage”.public static final Unit<Dimensionless> PPM
UNITY
,
the unlocalized name is “parts per million” and the identifier is EPSG:9202.public static final Unit<Salinity> PSU
"psu"
symbol
is sometime added to PSS-78 measurement. However this is officially discouraged.public static final Unit<Dimensionless> PIXEL
POINT
, which is approximatively equal to 1/72 of inch.POINT
public static boolean isAngular(Unit<?> unit)
true
if the given unit is a linear unit.
Linear units are convertible to DEGREE
.
Angular units are dimensionless, which may be a cause of confusion with other
dimensionless units like UNITY
or PPM
. This method take care
of differentiating angular units from other dimensionless units.
unit
- the unit to check (may be null
).true
if the given unit is non-null and angular.ensureAngular(Unit)
public static boolean isLinear(Unit<?> unit)
true
if the given unit is a linear unit.
Linear units are convertible to METRE
.unit
- the unit to check (may be null
).true
if the given unit is non-null and linear.METRE
,
ensureLinear(Unit)
public static boolean isPressure(Unit<?> unit)
true
if the given unit is a pressure unit.
Pressure units are convertible to PASCAL
.
Those units are sometime used instead of linear units for altitude measurements.unit
- the unit to check (may be null
).true
if the given unit is non-null and a pressure unit.public static boolean isTemporal(Unit<?> unit)
true
if the given unit is a temporal unit.
Temporal units are convertible to SECOND
.unit
- the unit to check (may be null
).true
if the given unit is non-null and temporal.ensureTemporal(Unit)
public static boolean isScale(Unit<?> unit)
unit
- the unit to check (may be null
).true
if the given unit is non-null and a dimensionless scale.UNITY
,
ensureScale(Unit)
public static Unit<Angle> ensureAngular(Unit<?> unit) throws IllegalArgumentException
unit
- the unit to check, or null
if none.unit
argument, which may be null.IllegalArgumentException
- if unit
is non-null and not an angular unit.isAngular(Unit)
public static Unit<Length> ensureLinear(Unit<?> unit) throws IllegalArgumentException
unit
- the unit to check, or null
if none.unit
argument, which may be null.IllegalArgumentException
- if unit
is non-null and not a linear unit.isLinear(Unit)
public static Unit<Time> ensureTemporal(Unit<?> unit) throws IllegalArgumentException
unit
- the unit to check, or null
if none.unit
argument, which may be null.IllegalArgumentException
- if unit
is non-null and not a temporal unit.isTemporal(Unit)
public static Unit<Dimensionless> ensureScale(Unit<?> unit) throws IllegalArgumentException
unit
- the unit to check, or null
if none.unit
argument, which may be null.IllegalArgumentException
- if unit
is non-null and not a scale unit.isScale(Unit)
public static <Q extends Quantity<Q>> Unit<Q> multiply(Unit<Q> unit, double numerator, double denominator)
CENTIMETRE
by 254/100 gives
INCH
. Invoking this method is equivalent to invoking Unit.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.Q
- the quantity measured by the unit.unit
- the unit to multiply.numerator
- the numerator of the multiplication factor.denominator
- the denominator of the multiplication factor.@Deprecated @Workaround(library="JSR-275", version="0.9.3") public static <Q extends Quantity<Q>> Unit<Q> multiply(Unit<Q> unit, double factor)
Unit.multiply(double)
.METRE
by 1000 gives KILOMETRE
. Invoking this method is equivalent to invoking
Unit.multiply(double)
except for the following:
multiply(RADIANS, 0.0174532925199...)
will return DEGREE
even if the given numerical value is slightly different than π/180.
The tolerance factor and the set of units handled especially may change in future SIS versions.Q
- the quantity measured by the unit.unit
- the unit to multiply.factor
- the multiplication factor.public static <Q extends Quantity<Q>> double toStandardUnit(Unit<Q> unit)
Unit.getSystemUnit()
.
KILOMETRE
, 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
(here METRE
).null
or if the conversion to the "standard" unit can not be expressed
by a single multiplication factor, then this method returns Double.NaN
.Q
- the quantity measured by the unit, or null
.unit
- the unit for which we want the multiplication factor to standard unit, or null
.public static Number[] coefficients(UnitConverter converter)
null
if it can not get the polynomial equation coefficients from the given converter.converter
- the converter from which to get the coefficients of the polynomial equation, or null
.null
if the given
converter is null
or if this method can not get the coefficients.public static double derivative(UnitConverter converter, double value)
NaN
if this method can not compute it.converter
- the converter for which we want the derivative at a given point, or null
.value
- the point at which to compute the derivative.NaN
if unknown.AbstractMathTransform.derivative(DirectPosition)
public static Unit<?> valueOf(String uom) throws ParserException
UnitFormat.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.
uom
arguments is of the form "EPSG:####"
or "urn:ogc:def:uom:EPSG:####"
(ignoring case and whitespaces), then "####"
is parsed as an integer and forwarded to the valueOfEPSG(int)
method.
"degrees_east"
or "degrees_north"
. This valueOf
method
ignores those suffixes and unconditionally returns DEGREE
for all axis directions.
In particular, the units for "degrees_west"
and "degrees_east"
do not have opposite sign.
It is caller responsibility to handle the direction of axes associated to netCDF units.uom
- the symbol to parse, or null
.null
if uom
was null.ParserException
- if the given symbol can not be parsed.UnitFormat.parse(CharSequence)
public static Unit<?> valueOfEPSG(int code)
code
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 returns null
.
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, like CommonAuthorityFactory
which uses EPSG code for identifying units.
The currently recognized values are:
Angular units | Linear units | Temporal units | Scale units | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
code
- the EPSG code for a unit of measurement.null
if the code is unrecognized.GeodeticAuthorityFactory.createUnit(String)
public static Integer getEpsgCode(Unit<?> unit, boolean inAxis)
null
if unknown.
This method is the converse of valueOfEPSG(int)
.
The same unit may be represented by different EPSG codes depending on the context:
inAxis
argument,
which specifies whether the code will be used for axis definition or in other context.unit
- the unit for which to get the EPSG code.inAxis
- true
for a unit used in Coordinate System Axis definition.null
if unknown.CoordinateSystems.getEpsgCode(Unit, AxisDirection...)
Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.