Package com.yahoo.geo
Class DistanceParser
- java.lang.Object
-
- com.yahoo.geo.DistanceParser
-
public class DistanceParser extends Object
Utility for parsing a geographical distance with unit.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getDegrees()
static double
parse(String distance)
Parse a distance in some kind of units, converting to geographical degrees.
-
-
-
Field Detail
-
m2deg
public static final double m2deg
- See Also:
- Constant Field Values
-
km2deg
public static final double km2deg
- See Also:
- Constant Field Values
-
mi2deg
public static final double mi2deg
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDegrees
public double getDegrees()
-
parse
public static double parse(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".
-
-