コード例 #1
0
def _filter_format_degrees(degrees):
    arcminutes = units.arcminutes(degrees=degrees - int(degrees))
    arcseconds = units.arcseconds(arcminutes=arcminutes - int(arcminutes))
    format_dict = dict(deg='°',
                       arcmin="'",
                       arcsec='"',
                       degrees=degrees,
                       minutes=round(abs(arcminutes)),
                       seconds=round(abs(arcseconds)))
    return DEGREES_FORMAT % format_dict
コード例 #2
0
def format_degrees(degrees, format=DEGREES_FORMAT, symbols=ASCII_SYMBOLS):
    arcminutes = units.arcminutes(degrees=degrees - int(degrees))
    arcseconds = units.arcseconds(arcminutes=arcminutes - int(arcminutes))
    format_dict = dict(
        symbols,
        degrees=degrees,
        minutes=abs(arcminutes),
        seconds=abs(arcseconds)
    )
    return format % format_dict
コード例 #3
0
ファイル: format.py プロジェクト: detlevn/geopy
def format_degrees(degrees, fmt=DEGREES_FORMAT, symbols=None):
    """
    TODO docs.
    """
    symbols = symbols or ASCII_SYMBOLS
    arcminutes = units.arcminutes(degrees=degrees - int(degrees))
    arcseconds = units.arcseconds(arcminutes=arcminutes - int(arcminutes))
    format_dict = dict(symbols,
                       degrees=degrees,
                       minutes=abs(arcminutes),
                       seconds=abs(arcseconds))
    return fmt % format_dict
コード例 #4
0
ファイル: format.py プロジェクト: Libermentix/geopy
def format_degrees(degrees, fmt=DEGREES_FORMAT, symbols=ASCII_SYMBOLS):
    """
    TODO docs.
    """
    arcminutes = round(units.arcminutes(degrees=degrees - int(degrees)))
    arcseconds = units.arcseconds(arcminutes=arcminutes - int(arcminutes))
    format_dict = dict(
        symbols,
        degrees=degrees,
        minutes=abs(arcminutes),
        seconds=abs(arcseconds)
    )
    return fmt % format_dict