Skip to content

Commit

Permalink
Make background of germany map selectable
Browse files Browse the repository at this point in the history
  • Loading branch information
FL550 committed Jan 6, 2024
1 parent 9ba7ba4 commit 67b1531
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class WeatherBackgroundMapType(Enum):

def get_from_location(longitude, latitude, radius_km, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, optional integer image_width, optional integer image_height) #Returns map as pillow image with given radius from coordinates

get_germany(map_type: WeatherMapType, optional integer image_width, optional integer image_height, optional string save_to_filename) #Returns map as pillow image of whole germany
get_germany(map_type: WeatherMapType, optional WeatherBackgroundMapType background_type, optional integer image_width, optional integer image_height, optional string save_to_filename) #Returns map as pillow image of whole germany

get_map(minx,miny,maxx,maxy, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, optional integer image_width, optional integer image_height, optional string save_to_filename) #Returns map as pillow image
```
Expand Down
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.0.27",
version="2.0.28",
author="Max Fermor",
description="A simple tool to retrieve a weather forecast from DWD OpenData",
long_description=long_description,
Expand Down
4 changes: 2 additions & 2 deletions simple_dwd_weatherforecast/dwdmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def get_from_location(longitude, latitude, radius_km, map_type: WeatherMapType,
radius = math.fabs(radius_km / (111.3 * math.cos(latitude)))
return get_map(latitude-radius, longitude-radius, latitude+radius, longitude+radius, map_type, background_type, image_width, image_height)

def get_germany(map_type: WeatherMapType, image_width=520, image_height=580):
return get_map(4.4, 46.4, 16.1, 55.6, map_type, WeatherBackgroundMapType.BUNDESLAENDER, image_width, image_height)
def get_germany(map_type: WeatherMapType, background_type: WeatherBackgroundMapType = WeatherBackgroundMapType.BUNDESLAENDER, image_width=520, image_height=580):
return get_map(4.4, 46.4, 16.1, 55.6, map_type, background_type, image_width, image_height)

def get_map(minx,miny,maxx,maxy, map_type: WeatherMapType, background_type: WeatherBackgroundMapType, image_width=520, image_height=580):
if image_width > 1200 or image_height > 1400:
Expand Down

0 comments on commit 67b1531

Please sign in to comment.