From 1c16cb48a1faec2e8dc157748d0f870d1253fde7 Mon Sep 17 00:00:00 2001 From: Chris Pham Date: Thu, 25 Jan 2018 10:49:36 -0800 Subject: [PATCH] Creates Big Image --- ground_station/resources/core/mapping.py | 5 ++--- ground_station/resources/core/mappingtest.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ground_station/resources/core/mapping.py b/ground_station/resources/core/mapping.py index 0458758..b9a0b93 100644 --- a/ground_station/resources/core/mapping.py +++ b/ground_station/resources/core/mapping.py @@ -119,9 +119,8 @@ class GMapsStitcher(object): def _pixels_to_lat(self, iterator, lat_pixels): # Magic Lines - degree = self._pixels_to_degrees((iterator - self.num_tiles / 2) * _TILESIZE, self.zoom) - temp = math.atan(math.exp(((lat_pixels + degree) - _EARTHPIX))/ _PIXRAD) - return math.degrees(math.pi / 2 - 2 * temp) + return math.degrees(math.pi / 2 - 2 * math.atan( + math.exp(((lat_pixels + self._pixels_to_degrees((iterator - self.num_tiles / 2) * _TILESIZE, self.zoom)) - _EARTHPIX) / _PIXRAD))) def fetch_tiles(self): # cap floats to precision amount diff --git a/ground_station/resources/core/mappingtest.py b/ground_station/resources/core/mappingtest.py index 12ad56c..8d1b16e 100644 --- a/ground_station/resources/core/mappingtest.py +++ b/ground_station/resources/core/mappingtest.py @@ -1,5 +1,5 @@ import mapping -obj = mapping.GMapsStitcher(10000, 10000, 44.57078, -123.275998, 21, 'terrain', 200) +obj = mapping.GMapsStitcher(1, 1, 44.57078, -123.275998, 18, 'terrain', None, 20) obj.fetch_tiles() \ No newline at end of file