@staticmethod
def _parse_dms(dms):
    """Convert a string of the form dd:mm:ss.decimal into decimal degrees.
        """
    import re
    tokens = tuple(filter(None, re.split('([\\.\\d]+)', dms.strip())))
    if len(tokens) <= 1:
        raise ValueError('string is not of the expected format')
    sign = 1
    try:
        dd = float(tokens[0])
    except ValueError:
        if tokens[0].strip() == '-':
            sign = -1
        tokens = tokens[1:]
        dd = float(tokens[0])
        if len(tokens) <= 1:
            raise ValueError('string is not of the expected format')
    if len(tokens) <= 2:
        return sign * dd
    mm = float(tokens[2])
    if len(tokens) <= 4:
        return sign * (dd + mm / 60)
    if len(tokens) >= 7:
        raise ValueError('string is not of the expected format')
    ss = float(tokens[4])
    return sign * (dd + mm / 60.0 + ss / 3600.0)
