Skip to content

Commit

Permalink
(x, y) -> (lat, lng)
Browse files Browse the repository at this point in the history
  • Loading branch information
hayfield committed May 15, 2017
1 parent e703c46 commit 66a1e61
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions stats/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ def valid_coords(x):
if len(coords) != 2:
return False
try:
x = decimal.Decimal(coords[0])
y = decimal.Decimal(coords[1])
lat = decimal.Decimal(coords[0])
lng = decimal.Decimal(coords[1])
# the (0, 0) coordinate is invalid since it's in the ocean in international waters and near-certainly not actual data
if x == 0 and y == 0:
if lat == 0 and lng == 0:
return False
# values outside the valid (lat, lng) coordinate space are invalid
elif x < -90 or x > 90 or y < -180 or y > 180:
elif lat < -90 or lat > 90 or lng < -180 or lng > 180:
return False
else:
return True
Expand Down

0 comments on commit 66a1e61

Please sign in to comment.