示例#1
0
 /**
  * Returns the appropriate UOM mapping for a given Java Unit.
  *
  * @param unit a Java Unit (e.g., <code>SI.METER</code>).
  * @return the corresponding UnitOfMeasure.
  * @throws IllegalArgumentException if the provided Unit is not part of the OGC SE specification.
  */
 public static UomOgcMapping get(Unit<Length> unit) throws IllegalArgumentException {
   for (UomOgcMapping uom : UomOgcMapping.values()) {
     if (uom.getUnit().equals(unit)) return uom;
   }
   throw new IllegalArgumentException(
       "'" + unit + "' is not a valid OGC SE standard Unit of Measure");
 }
示例#2
0
 /**
  * Returns the appropriate UOM mapping for a given OGC SE standard string.
  *
  * @param seString a String that follows the OGC SE specification.
  * @return the corresponding UnitOfMeasure.
  * @throws IllegalArgumentException if the provided String is not a valid OGC SE value.
  */
 public static UomOgcMapping get(String seString) throws IllegalArgumentException {
   for (UomOgcMapping uom : UomOgcMapping.values()) {
     if (uom.getSEString().equals(seString)) return uom;
   }
   throw new IllegalArgumentException(
       "'" + seString + "' is not a valid OGC SE standard Unit of Measure");
 }