Skip to content

Commit

Permalink
fix: correct empty bounds report
Browse files Browse the repository at this point in the history
  • Loading branch information
Sieboldianus committed Jan 29, 2019
1 parent 9b8dbd8 commit 1bde961
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tagmaps/classes/shared_structure.py
Expand Up @@ -90,10 +90,10 @@ def __init__(self):
(lat, lng coordinates)
"""
self.lim_lat_min = 0
self.lim_lat_max = 0
self.lim_lng_min = 0
self.lim_lng_max = 0
self.lim_lat_min = None
self.lim_lat_max = None
self.lim_lng_min = None
self.lim_lng_max = None

def _upd_latlng_bounds(self, lat, lng):
"""Update lat/lng bounds based on coordinate pair."""
Expand All @@ -111,6 +111,11 @@ def _upd_latlng_bounds(self, lat, lng):
self.lim_lng_max = lng

def get_bound_report(self):
if (self.lim_lat_min is None
or self.lim_lat_max is None
or self.lim_lng_min is None
or self.lim_lng_max is None):
return f'Bounds have not been initlialized'
bound_report = f'Bounds are: ' \
f'Min {float(self.lim_lng_min)} {float(self.lim_lat_min)} ' \
f'Max {float(self.lim_lng_max)} {float(self.lim_lat_max)}'
Expand Down

0 comments on commit 1bde961

Please sign in to comment.