def _dms2dd(d, m, s, dir):
    """
    convert lat/lon degrees/minutes/seconds into decimal degrees
    """
    degrees = float(d) + (float(m) / 60) + (float(s) / 3600)
    if dir in ['S', 'W']:
        degrees = degrees * -1
    return degrees