Remove unneeded function.

This commit is contained in:
2013-04-13 20:32:26 +01:00
parent 7a3d8ff734
commit f151a10d8d

View File

@@ -1,25 +1,8 @@
from math import radians, cos, sin, asin, sqrt
from django.core.cache import cache
from geopy.geocoders import GoogleV3
from geopy.geocoders.base import GeocoderResultError
def haversine(lon1, lat1, lon2, lat2):
"""
Calculate the great circle distance between two points
on the earth (specified in decimal degrees)
"""
# convert decimal degrees to radians
lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2])
# haversine formula
dlon = lon2 - lon1
dlat = lat2 - lat1
a = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2
c = 2 * asin(sqrt(a))
km = 6367 * c
return km
def caching_geo_lookup(address):
"""
Preforms a geo lookup against Google V3 and caches the results