From 83ca0c66c7c347acfb5b68f159afef10e9a6ab60 Mon Sep 17 00:00:00 2001 From: fly Date: Thu, 27 Aug 2020 11:05:54 +0000 Subject: [PATCH] Bug fixes Signed-off-by: fly --- common.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common.py b/common.py index bf86b54..d68e683 100644 --- a/common.py +++ b/common.py @@ -73,20 +73,20 @@ def get_area_name(s, w, major=False): if s % 10 != 0: s = s - (s % 10) - return ew + norm(abs(w), 3) + ns + norm(abs(s), 2) + return ew + norm(abs(math.floor(w)), 3) + ns + norm(abs(math.floor(s)), 2) # Returns latitude of tiles SW corner in area scheme def get_lat(tile): - return ((16320 & tile) >> 6) - 90 + return ((16320 & int(tile)) >> 6) - 90 # Returns longditude of tiles SW corner in area scheme def get_lon(tile): - return ((16760832 & tile) >> 14) - 180 + return ((16760832 & int(tile)) >> 14) - 180 # Returns precise west boundary of tile def get_west(tile): - lon = ((16760832 & tile) >> 14) - 180 - y = (7 & tile) / (1 / get_tile_width(get_lat(tile))) + lon = ((16760832 & int(tile)) >> 14) - 180 + y = (7 & int(tile)) / (1 / get_tile_width(get_lat(tile))) return lon + y # Returns east boundary of tile @@ -95,8 +95,8 @@ def get_east(tile): # Returns precise south boundary of tile def get_south(tile): - lat = ((16320 & tile) >> 6) - 90 - x = ((56 & tile) >> 3) / 8 + lat = ((16320 & int(tile)) >> 6) - 90 + x = ((56 & int(tile)) >> 3) / 8 return lat + x # Returns north boundary of tile