fixed check for nonzero lat/long
This commit is contained in:
parent
5f593a4231
commit
59ae35372e
@ -338,7 +338,7 @@ class PositionFile:
|
|||||||
lat = self._json['Latitude']
|
lat = self._json['Latitude']
|
||||||
if self.type() == PositionFile.GEO:
|
if self.type() == PositionFile.GEO:
|
||||||
lat = self._json['location']['lat']
|
lat = self._json['location']['lat']
|
||||||
if lat > 0:
|
if lat != 0:
|
||||||
return lat
|
return lat
|
||||||
raise ValueError("Lat is 0")
|
raise ValueError("Lat is 0")
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@ -351,7 +351,7 @@ class PositionFile:
|
|||||||
lng = self._json['Longitude']
|
lng = self._json['Longitude']
|
||||||
if self.type() == PositionFile.GEO:
|
if self.type() == PositionFile.GEO:
|
||||||
lng = self._json['location']['lng']
|
lng = self._json['location']['lng']
|
||||||
if lng > 0:
|
if lng != 0:
|
||||||
return lng
|
return lng
|
||||||
raise ValueError("Lng is 0")
|
raise ValueError("Lng is 0")
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user