From f7fca58c57890294691f852375c2a1d142da35a0 Mon Sep 17 00:00:00 2001 From: Martin Green Date: Mon, 8 May 2023 01:10:43 +0100 Subject: [PATCH] Start of creating kmz file, with entrance photos and links to expo.survex.com --- core/views/caves.py | 51 +++++++++++++++- kmz_icons/camp.png | Bin 0 -> 9694 bytes kmz_icons/large_cave.png | Bin 0 -> 11828 bytes kmz_icons/small_cave.png | Bin 0 -> 8643 bytes templates/entrance.kml | 10 ++++ templates/entrance_html.kml | 55 +++++++++++++++++ templates/expo.kml | 115 ++++++++++++++---------------------- urls.py | 3 +- 8 files changed, 160 insertions(+), 74 deletions(-) create mode 100644 kmz_icons/camp.png create mode 100644 kmz_icons/large_cave.png create mode 100644 kmz_icons/small_cave.png create mode 100644 templates/entrance.kml create mode 100644 templates/entrance_html.kml diff --git a/core/views/caves.py b/core/views/caves.py index b5a13f4..82e9d64 100644 --- a/core/views/caves.py +++ b/core/views/caves.py @@ -1,10 +1,15 @@ import os import re import subprocess +import tempfile +import zipfile +import urllib +from bs4 import BeautifulSoup + from pathlib import Path from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist -from django.http import HttpResponse, HttpResponseNotFound, HttpResponseRedirect +from django.http import HttpResponse, HttpResponseNotFound, HttpResponseRedirect, FileResponse from django.shortcuts import render from django.urls import NoReverseMatch, reverse @@ -17,6 +22,8 @@ from troggle.core.views import expo from troggle.settings import CAVEDESCRIPTIONS, ENTRANCEDESCRIPTIONS from troggle.parsers.caves import read_cave, read_entrance +from django.template import loader +from django.utils.safestring import mark_safe from .auth import login_required_if_public @@ -628,3 +635,45 @@ def expo_kml(request): }, content_type = "application/vnd.google-earth.kml+xml" ) + +def expo_kmz(request): + notablecaves = set(getnotablecaves()) + #Zip file written to a file, to save this function using too much memory + with tempfile.TemporaryDirectory() as tmpdirname: + zippath = os.path.join(tmpdirname, 'expo.kmz') + with zipfile.ZipFile(zippath, 'w', compression=zipfile.ZIP_DEFLATED) as myzip: + entrances = [] + for e in Entrance.objects.all(): + html = loader.get_template("entrance_html.kml").render({"entrance": e}, request) + soup=BeautifulSoup(html) + for img in soup.find_all("img"): + #src_orig = img['src'] + src = urllib.parse.urljoin(e.cavelist()[0].url.rpartition("/")[0] + "/", img['src']) + img['src'] = src + p = os.path.join(settings.EXPOWEB, src) + #print(e.cavelist()[0].url, e.cavelist()[0].url.rpartition("/")[0] + "/", src_orig, p) + if os.path.isfile(p): + myzip.write(p, src) + for a in soup.find_all("a"): + try: + ao = a['href'] + aa = urllib.parse.urljoin(e.cavelist()[0].url.rpartition("/")[0] + "/", ao) + a['href'] = urllib.parse.urljoin("https://expo.survex.com/", aa) + print(e.cavelist()[0].url.rpartition("/")[0] + "/", ao, a['href']) + except: + pass + html = mark_safe(soup.prettify("utf-8").decode("utf-8")) + + size = {True: "large", False:"small"}[bool(set(e.cavelist()) & notablecaves)] + + entrances.append(loader.get_template("entrance.kml").render({"entrance": e, "html": html, "size": size}, request)) + + s = loader.get_template("expo.kml").render({"entrances": entrances}, request) + myzip.writestr("expo.kml", s) + for f in os.listdir(settings.KMZ_ICONS_PATH): + p = os.path.join(settings.KMZ_ICONS_PATH, f) + if os.path.isfile(p): + myzip.write(p, os.path.join("icons", f)) + return FileResponse(open(zippath, 'rb'), content_type="application/vnd.google-earth.kmz .kmz") + + diff --git a/kmz_icons/camp.png b/kmz_icons/camp.png new file mode 100644 index 0000000000000000000000000000000000000000..57dd2c677b44ed97a48032d9d309dfeca157c0b6 GIT binary patch literal 9694 zcmeHMXH-*J*ABfmsZxd*x)2gN2}PxYbdcUc5+HPwP!*($fJ&DlO^Sjd(xvwz9YH`T z(iNl%2nymCbY|X}^}T;)t?&CcS?ebEp7ZQy@BN&8&N}zxj-kFL9W^I4005xV)>1Pj z{PLb%l;mgM&)HxA0BdHTsRiB`;Rp1_dO2a-(Lj8FHyVic$2b81{_jdNFoAqe6Qh1q z#@G=f0sWzX?8koI58ivlCvIkZ+OP9X5hyfHXY7y*nK>Q)@!R30ljMoU{zBO`PoC?~&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r0>6S{VUf$Qs5tf|E;cn<@!eo{3Gzc)%AZS7xjN$c+j4NU63E)b!Ok{DG%XQ zh{{{b5(fZ?^POEp{)Lx(35^tZZ9R304`dXqLZYX#+?#}^^LTX&ysDSS*)AFIbMuBq z0sSy|7vS0E%{-KzodAl_R=Z-V)zkGxfxZ>UNMf{f{65_j15)3({iZ-OTa&3^tG4>7 zrXJm4PbO2*_~CLFhsk=wXO(1;gP;J(q2xe~>}cu2>?8`LUa|8^sEf(^-qHL{mYcoR zwGa^>`_q!xK$G?Clc(U1dc~hUUqTyiSACNXIkjUZG}ql0cp_Jr9b`-rXyU3J2uS5r W=90b9&qas|pslX2_FTmw?0*3Et&lGO literal 0 HcmV?d00001 diff --git a/kmz_icons/large_cave.png b/kmz_icons/large_cave.png new file mode 100644 index 0000000000000000000000000000000000000000..06b7d2cc7f23fcb717b78ccbae68c1f5084b25ed GIT binary patch literal 11828 zcmeHtWl&t(wl(e$+#P~TN<-}#HU>Ec92^|BlA@f}!KMSZKwh*iZq7CkM=&kS#|2Ca_J-KN!FkV@XF_}zg_A>nZ4kO69SpmE zlo(&Mh?8^CwDcnx2*)n&mx*5x~ z&k5Z4=_$CpGETE2z8!G4=tq6xN9c_`o-^8><1De$`r;S#Saq@ghKA%vi}sG`56|4I ztMk*1osHJqN=frwDruMTtV7@S6El`;FS*m37i|nf<*799>$hL*TnFg1-_yvRih%X$ z+w&U=H~Vh)oH#!0OiGPk9GbC+WB$15>|dcN^6lI7a_Kx14fRTq{uMFdqk84V15C`J zrVm_>Kk7188N?-pyl|dA+_4O37hIX$eH9qU$2qJzHaoatczAxv+d|7Yih2 ztvP)Wx1e6dQT35y7o>p2)2Fo`WqL)nFY`$6b_^Cu(&Eqm234VBAPwcf;U=2B?TEqdm`5IW@Aq=vtOV; zP1SK@EzFpFUYXaIVP8==J8$pYhP)~&uwFYeYjnI=>%KMCAj*6pafikb$A89>A7`VG z(>NZ(H!3##p=Px04&xP^xzB4|ePjRTSoXulsj=pRriCL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 entrance.latlong.1 }},{{ entrance.latlong.0 }},0 + + + {% endif %} diff --git a/templates/entrance_html.kml b/templates/entrance_html.kml new file mode 100644 index 0000000..b45b11b --- /dev/null +++ b/templates/entrance_html.kml @@ -0,0 +1,55 @@ +
+ Cave: {{entrance.cavelist.0.name }} + {% if entrance.marking %} +
Marking
{{ entrance.marking_val|safe }}
+ {% endif %} + {% if entrance.marking_comment %} +
Marking Comment
{{ entrance.marking_comment|safe }}
+ {% endif %} + {% if entrance.findability %} +
Findability
{{ entrance.findability_val|safe }}
+ {% endif %} + {% if entrance.findability_comment %} +
Findability Comment
{{ entrance.findability_comment|safe }}
+ {% endif %} + {% if entrance.location_description %} +
Location
{{ entrance.location_description|safe }}
+ {% endif %} + {% if entrance.approach %} +
Approach
{{ entrance.approach|safe }}
+ {% endif %} + {% if entrance.map_description %} +
Map
{{ entrance.map_description|safe }}
+ {% endif %} + {% if entrance.underground_description %} +
Underground
{{ entrance.underground_description|safe }}
+ {% endif %} + {% if entrance.photo %} +
Photo
{{ entrance.photo|safe }}
+ {% endif %} + {% if entrance.entrance_description %} +
Description
{{ entrance.entrance_description|safe }}
+ {% endif %} + {% if entrance.explorers %} +
Explorers
{{ entrance.explorers|safe }}
+ {% endif %} + {% if entrance.northing %} +
Location
?BMN? Northing: {{ entrance.northing|safe }}, Easting: {{ entrance.easting|safe }}, {{ entrance.alt|safe }}m
+ {% endif %} + {% if entrance.tag_station %} +
Tag Location
{{ entrance.tag_station }} {{ entrance.tag.latlong.0|floatformat:5 }}N {{ entrance.tag.latlong.1|floatformat:5 }}E - UTM33 {{ entrance.tag.y|floatformat:0 }}, {{ entrance.tag.x|floatformat:0 }}, {{ entrance.tag.z|floatformat:0 }}m
+ {% endif %} + {% if entrance.bearings %} +
Bearings
{{ entrance.bearings|safe }}
+ {% endif %} + {% if entrance.exact_station %} +
Exact Station
{{ entrance.exact_station|safe }} {{ entrance.exact_location.latlong.0|floatformat:5 }}N {{ entrance.exact_location.latlong.1|floatformat:5 }}E - UTM33 {{ entrance.exact_location.y|floatformat:0 }}, {{ entrance.exact_location.x|floatformat:0 }}, {{ entrance.exact_location.z|floatformat:0 }}m
+ {% endif %} + {% if entrance.other_station %} +
Other Station
{{ entrance.other_station|safe }} + {% if entrance.other_description %} + - {{ entrance.other_description|safe }} + {% endif %} {{ entrance.other_location.latlong.0|floatformat:5 }}N {{ entrance.other_location.latlong.1|floatformat:5 }}E - UTM33 {{ entrance.other_location.y|floatformat:0 }}, {{ entrance.other_location.x|floatformat:0 }}, {{ entrance.other_location.z|floatformat:0 }}m +
+ {% endif %} +
diff --git a/templates/expo.kml b/templates/expo.kml index 9179ee9..3861276 100644 --- a/templates/expo.kml +++ b/templates/expo.kml @@ -2,104 +2,75 @@ Expo.KML - - - + normal - #default0 + #small_cave_ highlight - #hl + #small_cave_hl + + + + + + + + normal + #large_cave_ + + + highlight + #large_cave_hl Expo.KML {% for entrance in entrances %} - {% if entrance.latlong %} - - {{ entrance.slug }} - - {% if entrance.marking %} -
Marking
{{ entrance.marking_val|safe }}
- {% endif %} - {% if entrance.marking_comment %} -
Marking Comment
{{ entrance.marking_comment|safe }}
- {% endif %} - {% if entrance.findability %} -
Findability
{{ entrance.findability_val|safe }}
- {% endif %} - {% if entrance.findability_comment %} -
Findability Comment
{{ entrance.findability_comment|safe }}
- {% endif %} - {% if entrance.location_description %} -
Location
{{ entrance.location_description|safe }}
- {% endif %} - {% if entrance.approach %} -
Approach
{{ entrance.approach|safe }}
- {% endif %} - {% if entrance.map_description %} -
Map
{{ entrance.map_description|safe }}
- {% endif %} - {% if entrance.underground_description %} -
Underground
{{ entrance.underground_description|safe }}
- {% endif %} - {% if entrance.photo %} -
Photo
{{ entrance.photo|safe }}
- {% endif %} - {% if entrance.entrance_description %} -
Description
{{ entrance.entrance_description|safe }}
- {% endif %} - {% if entrance.explorers %} -
Explorers
{{ entrance.explorers|safe }}
- {% endif %} - {% if entrance.northing %} -
Location
?BMN? Northing: {{ entrance.northing|safe }}, Easting: {{ entrance.easting|safe }}, {{ entrance.alt|safe }}m
- {% endif %} - {% if entrance.tag_station %} -
Tag Location
{{ entrance.tag_station }} UTM33 {{ entrance.tag.y|floatformat:0 }}, {{ entrance.tag.x|floatformat:0 }}, {{ entrance.tag.z|floatformat:0 }}m
- {% endif %} - {% if entrance.bearings %} -
Bearings
{{ entrance.bearings|safe }}
- {% endif %} - {% if entrance.exact_station %} -
Exact Station
{{ entrance.exact_station|safe }} UTM33 {{ entrance.exact_location.y|floatformat:0 }}, {{ entrance.exact_location.x|floatformat:0 }}, {{ entrance.exact_location.z|floatformat:0 }}m
- {% endif %} - {% if entrance.other_station %} -
Other Station
{{ entrance.other_station|safe }} - {% if entrance.other_description %} - - {{ entrance.other_description|safe }} - {% endif %} UTM33 {{ entrance.other_location.y|floatformat:0 }}, {{ entrance.other_location.x|floatformat:0 }}, {{ entrance.other_location.z|floatformat:0 }}m -
- {% endif %} - ]]>
- #default - - {{ entrance.latlong.1 }},{{ entrance.latlong.0 }},0 - -
- {% endif %} + {{ entrance }} {% endfor %}
diff --git a/urls.py b/urls.py index 1fca988..c7fc81c 100644 --- a/urls.py +++ b/urls.py @@ -8,7 +8,7 @@ from troggle.core.views import statistics, survex from troggle.core.views.auth import expologin, expologout from troggle.core.views.caves import (cave3d, caveEntrance, caveindex, cavepage, caveQMs, edit_cave, cave_debug, - edit_entrance, get_entrances, qm, expo_kml) + edit_entrance, get_entrances, qm, expo_kml, expo_kmz) from troggle.core.views.drawings import dwgallfiles, dwgfilesingle from troggle.core.views.editor_helpers import image_selector, new_image_form from troggle.core.views.expo import (editexpopage, expofiles_redirect, @@ -232,6 +232,7 @@ trogglepatterns = [ re_path(r'^new_image_form/(?P.*)', new_image_form, name = 'new_image_form'), re_path(r'^expo.kml', expo_kml, name = 'expo.kml'), + re_path(r'^expo.kmz', expo_kmz, name = 'expo.kmz'), # Final catchall which also serves expoweb handbook pages and imagestiny re_path(r'^(.*)$', expopage, name="expopage"), # CATCHALL assumed relative to EXPOWEB