Skip to content

Commit

Permalink
Fix lat lon in get_from_location
Browse files Browse the repository at this point in the history
  • Loading branch information
FL550 committed Oct 8, 2024
1 parent 918bf57 commit 90f1fe8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="simple_dwd_weatherforecast",
version="2.1.9",
version="2.1.10",
author="Max Fermor",
description="A simple tool to retrieve a weather forecast from DWD OpenData",
long_description=long_description,
Expand Down
12 changes: 6 additions & 6 deletions simple_dwd_weatherforecast/dwdmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@ def get_from_location(
):
if radius_km <= 0:
raise ValueError("Radius must be greater than 0")
if latitude < -90 or latitude > 90:
raise ValueError("Latitude must be between -90 and 90")
if longitude < -180 or longitude > 180:
raise ValueError("Longitude must be between -180 and 180")
if longitude < -90 or longitude > 90:
raise ValueError("Longitude must be between -90 and 90")
if latitude < -180 or latitude > 180:
raise ValueError("Latitude must be between -180 and 180")
radius = math.fabs(radius_km / (111.3 * math.cos(latitude)))
return get_map(
latitude - radius,
longitude - radius,
latitude + radius,
latitude - radius,
longitude + radius,
latitude + radius,
map_type,
background_type,
image_width,
Expand Down

0 comments on commit 90f1fe8

Please sign in to comment.