Class PrecisionScales

java.lang.Object
org.opensextant.extractors.xcoord.PrecisionScales

public class PrecisionScales extends Object
Author:
ubaldino
  • Field Details

    • DEFAULT_UNKNOWN_RESOLUTION

      public static final float DEFAULT_UNKNOWN_RESOLUTION
      See Also:
    • LAT_DEGREE_PRECISION

      public static final float LAT_DEGREE_PRECISION
      See Also:
    • DD_precision_list

      public static final double[] DD_precision_list
      Maximal error in METERS in coordinate with N decimal places; for up to 12 decimal places.
    • DMS_MIN_PREC

      public static final float DMS_MIN_PREC
      See Also:
    • DMS_SEC_PREC

      public static final float DMS_SEC_PREC
      See Also:
    • MGRS_precision_list

      public static final float[] MGRS_precision_list
      Precision appears in pairs, as we tolerate some typo/errors in MGRs.
    • MGRS_offset_precision_list

      public static final float[] MGRS_offset_precision_list
    • MGRS2DEC_digits

      public static final int[] MGRS2DEC_digits
  • Constructor Details

    • PrecisionScales

      public PrecisionScales()
  • Method Details

    • setDDPrecision

      public static void setDDPrecision(GeocoordMatch m)
      Sets the precision on a decimal degrees match
      Parameters:
      m - given match
    • getDDPrecision

      public static GeocoordPrecision getDDPrecision(String lat)
      Return XCoord precision (+/- meters) in latitude.
      Parameters:
      lat - string representing latitude
      Returns:
      precision
    • count_DD_digits

      public static int count_DD_digits(String lat)
      Count the number of decimal places in a lat or lon text string.
      Parameters:
      lat - string representing latitude
      Returns:
      number of digits in lat, as a proxy for precision
    • count_DMS_digits

      public static int count_DMS_digits(String lat)
      Counts all digits in latitude.
      Parameters:
      lat - string representing latitude
      Returns:
      number of digits in lat as a proxy for precision
    • setDMSPrecision

      public static void setDMSPrecision(GeocoordMatch m)
      set precision on a DMS text coordinate -- simply if the Match latitude "has seconds" then its precision is seconds, otherwise if it has minutes, then it is precise to +/- 1 minute, etc. Default precision is half-degree ~ +/- 55KM. Prior implementation was based on digit counting, whereas with decimal degrees you must count digits to infer precision.
      Parameters:
      m - DMS match
    • setMGRSPrecision

      public static void setMGRSPrecision(GeocoordMatch m)
      Parameters:
      m - MGRS match
    • setUTMPrecision

      public static void setUTMPrecision(GeocoordMatch m)
      Parameters:
      m - UTM match
    • UTM_precision

      public static float UTM_precision(String utm)
      For now default UTM precision to +/- 100m
      Parameters:
      utm - UTM string
      Returns:
      precision
    • format

      public static String format(double f, int digits)
      This was deemed to be more Java like, however performs 10x slower than format2() -- which unfortunately rounds too early.
      Parameters:
      f - value
      digits - digits to include in format
      Returns:
      formatted value.