Here you can find the source of toDecimalDegrees(String picaValue)
public static double toDecimalDegrees(String picaValue)
//package com.java2s; //License from project: Open Source License public class Main { /**/*w w w .j a v a 2s. c o m*/ * Converts coordinates to decimal degree (as used by google maps). * */ public static double toDecimalDegrees(int degree, int minutes, double seconds) { return (((seconds / 60) + minutes) / 60) + degree; } /** * Converts coordinates in pica format to decimal degree (as used by google maps). * * @return the decimal degree representation of the coordinates */ public static double toDecimalDegrees(String picaValue) { if (picaValue == null || picaValue.length() == 0 || (!isValid(picaValue))) { return 0d; } String[] strings = picaValue.split(" "); if (strings.length < 3) { return 0d; } int degree = Integer.valueOf(strings[1]); int minutes = Integer.valueOf(strings[2]); double seconds = 0d; if (strings.length >= 4) { seconds = Double.valueOf(strings[3]); } int factor = "W".equals(strings[0]) || "S".equals(strings[0]) ? -1 : 1; return ((((seconds / 60) + minutes) / 60) + degree) * factor; } /** * @param picaValue * @return */ private static boolean isValid(String picaValue) { String regex = "[EWSN]{1}\\s[0-9]{3}\\s[0-9]{2}(\\s[0-9]*)*"; return picaValue.matches(regex); } }