mirror of
https://github.com/OSURoboticsClub/Rover_2017_2018.git
synced 2025-11-08 10:11:14 +00:00
Added _pixels_to_lat
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
'''
|
||||
Mapping.py: Objected Orientated Google Maps for Python
|
||||
|
||||
Written by Chris Pham
|
||||
ReWritten by Chris Pham
|
||||
|
||||
Copyright OSURC, orginal code from GooMPy by Alec Singer and Simon D. Levy
|
||||
|
||||
|
||||
This code is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
@@ -25,10 +23,10 @@ along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||
# Python native imports
|
||||
import math
|
||||
import urllib2
|
||||
import PIL.Image
|
||||
from io import StringIO, BytesIO
|
||||
import os
|
||||
import time
|
||||
import PIL.Image
|
||||
|
||||
#####################################
|
||||
# Constants
|
||||
@@ -113,3 +111,7 @@ class GMapsStitcher(object):
|
||||
degrees = self._pixels_to_degrees(((iterator) - self.num_tiles / 2) * _TILESIZE, self.zoom)
|
||||
return math.degrees((lon_pixels + degrees - _EARTHPIX) / _pixrad)
|
||||
|
||||
def _pixels_to_lat(self, iterator, lat_pixels):
|
||||
# Magic Lines
|
||||
degree = self._pixels_to_degrees((iterator - self.num_tiles / 2) * _TILESIZE, self.zoom)
|
||||
return math.degrees(math.pi / 2 - 2 * math.atan(math.exp(((lat_pixels + degree) - _EARTHPIX) / _pixrad)))
|
||||
|
||||
Reference in New Issue
Block a user