diff --git a/setup.py b/setup.py index dbecc74..e2e55ac 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="simple_dwd_weatherforecast", - version="1.0.4", + version="1.0.5", author="Max Fermor", description="A simple tool to retrieve weather forecast from DWD OpenData", long_description=long_description, diff --git a/simple_dwd_weatherforecast/dwdforecast.py b/simple_dwd_weatherforecast/dwdforecast.py index 675d0d6..404d7d9 100644 --- a/simple_dwd_weatherforecast/dwdforecast.py +++ b/simple_dwd_weatherforecast/dwdforecast.py @@ -23,8 +23,10 @@ def get_nearest_station_id(lat: float, lon: float): distance = 99999999 for line in stations.splitlines(): if (len(line) > 0 and line[0].isdigit()): - _lat = float(line[45:51].strip()) - _lon = float(line[52:59].strip()) + _lat = line[45:51].strip().split('.') + _lat = round(float(_lat[0])+float(_lat[1])/60, 2) + _lon = line[52:59].strip().split('.') + _lon = round(float(_lon[0])+float(_lon[1])/60, 2) distance_temp = get_distance(lat, lon, _lat, _lon) if distance > distance_temp: distance = distance_temp