def calculate_boundingbox ( lng , lat , miles ) : latChange = change_in_latitude ( miles ) latSouth = lat - latChange latNorth = lat + latChange lngChange = change_in_longitude ( lat , miles ) lngWest = lng + lngChange lngEast = lng - lngChange return ( lngWest , latSouth , lngEast , latNorth )
python how to get a small bounding box around lat lon coordinate
Given a latitude longitude and a distance in miles calculate the co - ordinates of the bounding box 2 * miles on long each side with the given co - ordinates at the center .
def calculate_boundingbox(lng, lat, miles):
    """
    Given a latitude, longitude and a distance in miles, calculate
    the co-ordinates of the bounding box 2*miles on long each side with the
    given co-ordinates at the center.
    """

    latChange = change_in_latitude(miles)
    latSouth = lat - latChange
    latNorth = lat + latChange
    lngChange = change_in_longitude(lat, miles)
    lngWest = lng + lngChange
    lngEast = lng - lngChange
    return (lngWest, latSouth, lngEast, latNorth)