2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-18 04:57:11 +00:00

undropped caves code -> GPX

This commit is contained in:
2025-07-29 17:08:36 +02:00
parent 7564ce4d27
commit 959c358c09
7 changed files with 45 additions and 3 deletions

View File

@@ -113,7 +113,13 @@ class SurvexStation(models.Model):
return diff_str, ref
def gpx_location(s): # s == self
# <wpt lon="13.82093593" lat="47.69501184"><ele>1857.90</ele><name>tunnocks</name></wpt>
latitude, longitude = utmToLatLng(33, s.x, s.y, northernHemisphere=True)
if s.name:
return f'<wpt lon="{longitude:0.8f}" lat="{latitude:0.8f}"><ele>{s.z:0.0f}</ele><name>{s.name[5:]}</name></wpt>\n'
else:
return ""
def utmToLatLng(zone, easting, northing, northernHemisphere=True): # move this to utils.py ?