src/main/java/de/blau/android/photos/Photo.java
/**
     * Convert the DMS string to degrees
     * 
     * @param stringDMS the DMS string
     * @return degrees
     * @throws NumberFormatException if the String couldn't be parsed for whatever reason
     */
Convert the DMS string to degrees

@param stringDMS the DMS string
@return degrees
@throws NumberFormatException if the String couldn't be parsed for whatever reason
Convert the DMS string to degrees @param stringDMS the DMS string @return degrees @throws NumberFormatException if the String couldn ' t be parsed for whatever reason
private Float convertToDegree(@NonNull String stringDMS) throws NumberFormatException {
        try {
            Float result = null;
            String[] dms = stringDMS.split(",", 3);
            String[] stringD = dms[0].split("/", 2);
            Double d0 = Double.valueOf(stringD[0]);
            Double d1 = Double.valueOf(stringD[1]);
            Double d = d0 / d1;
            String[] stringM = dms[1].split("/", 2);
            Double m0 = Double.valueOf(stringM[0]);
            Double m1 = Double.valueOf(stringM[1]);
            Double m = m0 / m1;
            String[] stringS = dms[2].split("/", 2);
            Double s0 = Double.valueOf(stringS[0]);
            Double s1 = Double.valueOf(stringS[1]);
            Double s = s0 / s1;
            result = (float) (d + (m / 60) + (s / 3600));
            return result;
        } catch (Exception ex) {
            Log.e(DEBUG_TAG, "couldn't parse >" + stringDMS + "< exception " + ex);
            throw new NumberFormatException("couldn't parse: " + stringDMS);
        }
    }
private Float convertToDegree ( @ NonNull String stringDMS ) throws NumberFormatException { try { Float result = null ; String [ ] dms = stringDMS . split ( "," , 3 ) ; String [ ] stringD = dms [ 0 ] . split ( "/" , 2 ) ; Double d0 = Double . valueOf ( stringD [ 0 ] ) ; Double d1 = Double . valueOf ( stringD [ 1 ] ) ; Double d = d0 / d1 ; String [ ] stringM = dms [ 1 ] . split ( "/" , 2 ) ; Double m0 = Double . valueOf ( stringM [ 0 ] ) ; Double m1 = Double . valueOf ( stringM [ 1 ] ) ; Double m = m0 / m1 ; String [ ] stringS = dms [ 2 ] . split ( "/" , 2 ) ; Double s0 = Double . valueOf ( stringS [ 0 ] ) ; Double s1 = Double . valueOf ( stringS [ 1 ] ) ; Double s = s0 / s1 ; result = ( float ) ( d + ( m / 60 ) + ( s / 3600 ) ) ; return result ; } catch ( Exception ex ) { Log . e ( DEBUG_TAG , "couldn't parse >" + stringDMS + "< exception " + ex ) ; throw new NumberFormatException ( "couldn't parse: " + stringDMS ) ; } }
Convert the DMS string to degrees
Convert the DMS string to degrees