summaryrefslogtreecommitdiffstats
path: root/core/methods_millenial.py
diff options
context:
space:
mode:
authorRad <radost.waszkiewicz@gmail.com>2019-02-28 12:36:49 +0000
committerRad <radost.waszkiewicz@gmail.com>2019-02-28 12:36:49 +0000
commit6b59e3a68908b2ee3b05e4734a8f72d10a349c34 (patch)
tree93e75e8f0994bbd1c2aed1c6d91f243d524e081c /core/methods_millenial.py
parentce268ec306946e4f4aadd8ee358a28e79f22b9b3 (diff)
downloadtroggle-6b59e3a68908b2ee3b05e4734a8f72d10a349c34.tar.gz
troggle-6b59e3a68908b2ee3b05e4734a8f72d10a349c34.tar.bz2
troggle-6b59e3a68908b2ee3b05e4734a8f72d10a349c34.zip
rebuild descriptions database, some visuals
Diffstat (limited to 'core/methods_millenial.py')
-rw-r--r--core/methods_millenial.py26
1 files changed, 24 insertions, 2 deletions
diff --git a/core/methods_millenial.py b/core/methods_millenial.py
index 5d2483a..ce7ce11 100644
--- a/core/methods_millenial.py
+++ b/core/methods_millenial.py
@@ -1,2 +1,24 @@
-def emptyfun():
- return
+import utm
+import math
+from django.conf import settings
+
+def lat_lon_entrance(utmstring):
+ try:
+ x = float(utmstring.split()[0])
+ y = float(utmstring.split()[1])
+ #return ' '+str(x+y)+' '+str(y)
+ q = utm.to_latlon(x, y, 33, 'U')
+ return "{:.5f} {:.5f}".format(q[0],q[1])
+ except:
+ return 'Not found'
+
+def top_camp_distance(utmstring):
+ try:
+ x = float(utmstring.split()[0])
+ y = float(utmstring.split()[1])
+ tx = settings.TOPCAMPX
+ ty = settings.TOPCAMPY
+ dist = math.sqrt( (tx-x)*(tx-x) + (ty-y)*(ty-y) )
+ return "{:.1f}".format(dist)
+ except:
+ return 'Not found'