Package com.yahoo.geo

Class DistanceParser


  • @Beta
    public class DistanceParser
    extends java.lang.Object
    Utility for parsing a geographical distance with unit.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static double km2deg  
      static double m2deg  
      static double mi2deg  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getDegrees()  
      static double parse​(java.lang.String distance)
      Parse a distance in some kind of units, converting to geographical degrees.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getDegrees

        public double getDegrees()
      • parse

        public static double parse​(java.lang.String distance)
        Parse a distance in some kind of units, converting to geographical degrees. Note that the number and the unit should be separated by a single space only, or not separated at all. Supported units are "m", "km", "miles", and "deg", the last one meaning degrees with no conversion. For brevity "mi" = "miles" and "d" = "deg".