scripts/generate_lat_lon_geojson.py
def _decimal_degrees_to_dms(decimal, *, lat_or_lon, include_secs=True):
    """Convert decimal degrees to degrees, minutes, seconds.

    There are 60 minutes in a degree, and 60 seconds in a minute.
    """
    if lat_or_lon == 'lat':
        cardinal = 'S' if decimal < 0 else 'N'
    elif lat_or_lon == 'lon':
        cardinal = 'W' if decimal < 0 else 'E'
    else:
        raise RuntimeError(f"{lat_or_lon} is not 'lat' or 'lon'")

    degs = math.floor(decimal)

    mins_decimal = (decimal - math.floor(decimal)) * 60
    mins = math.floor(mins_decimal)

    secs = (mins_decimal - math.floor(mins_decimal)) * 60

    if include_secs is True:
        return f"{degs}° {mins}' {secs}\" {cardinal}"
    else:
        return f"{degs}° {mins}' {cardinal}"
Convert decimal degrees to degrees, minutes, seconds.

    There are 60 minutes in a degree, and 60 seconds in a minute.
    
Convert decimal degrees to degrees, minutes, seconds.
There are 60 minutes in a degree, and 60 seconds in a minute.
Convert decimal degrees to degrees minutes seconds . There are 60 minutes in a degree and 60 seconds in a minute .
def _decimal_degrees_to_dms(decimal, *, lat_or_lon, include_secs=True):
    if lat_or_lon == 'lat':
        cardinal = 'S' if decimal < 0 else 'N'
    elif lat_or_lon == 'lon':
        cardinal = 'W' if decimal < 0 else 'E'
    else:
        raise RuntimeError(f"{lat_or_lon} is not 'lat' or 'lon'")
    degs = math.floor(decimal)
    mins_decimal = (decimal - math.floor(decimal)) * 60
    mins = math.floor(mins_decimal)
    secs = (mins_decimal - math.floor(mins_decimal)) * 60
    if include_secs is True:
        return f"{degs}° {mins}' {secs}\" {cardinal}"
    else:
        return f"{degs}° {mins}' {cardinal}"
def _decimal_degrees_to_dms ( decimal , * , lat_or_lon , include_secs = True ) : if lat_or_lon == 'lat' : cardinal = 'S' if decimal < 0 else 'N' elif lat_or_lon == 'lon' : cardinal = 'W' if decimal < 0 else 'E' else : raise RuntimeError ( f"{lat_or_lon} is not 'lat' or 'lon'" ) degs = math . floor ( decimal ) mins_decimal = ( decimal - math . floor ( decimal ) ) * 60 mins = math . floor ( mins_decimal ) secs = ( mins_decimal - math . floor ( mins_decimal ) ) * 60 if include_secs is True : return f"{degs}° {mins}' {secs}\" {cardinal}" else : return f"{degs}° {mins}' {cardinal}"
Convert decimal degrees to degrees, minutes, seconds.
Convert decimal degrees to degrees minutes seconds .
"""Convert decimal degrees to degrees, minutes, seconds.

    There are 60 minutes in a degree, and 60 seconds in a minute.
    """
decimal
lat_or_lon
include_secs