def minsec2dec(old):
    """ 
    convert latlon from DMS (minute second) to DD (decimal)

    Parameters
    ----------

    old : string 
        format : DMS format

    Example 
    -------

        >>> from pylayers.gis.gisutil import minsec2dec
        >>> minsec2dec('50 03 59 N')
         -50.06638888888889


    """
    direction = {'N':-1, 'S':1, 'E': -1, 'W':1}
    new = old.replace(u'',' ').replace('\'',' ').replace('"',' ')
    new = new.split()
    new_dir = new.pop()
    return (int(new[0])+int(new[1])/60.0+int(new[2])/3600.0) * direction[new_dir]