def dms2decimal(decString, delimiter):
    """Converts a delimited string of Degrees:Minutes:Seconds format into
    decimal degrees.

    @type decString: string
    @param decString: coordinate string in D:M:S format
    @type delimiter: string
    @param delimiter: delimiter character in decString
    @rtype: float
    @return: coordinate in decimal degrees

    """
    if delimiter == '':
        decBits = str(decString).split()
    else:
        decBits = str(decString).split(delimiter)
    if len(decBits) > 1:
        decDeg = float(decBits[0])
        if decBits[0].find('-') != -1:
            if len(decBits) > 1:
                decDeg = decDeg - float(decBits[1]) / 60.0
            if len(decBits) > 2:
                decDeg = decDeg - float(decBits[2]) / 3600.0
        else:
            if len(decBits) > 1:
                decDeg = decDeg + float(decBits[1]) / 60.0
            if len(decBits) > 2:
                decDeg = decDeg + float(decBits[2]) / 3600.0
    else:
        decDeg = float(decString)
    return decDeg
