From 08c56644ebfd694c3f57de1e9b9e7afcfef1dba2 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Wed, 8 Nov 2023 22:53:30 +0200 Subject: [PATCH] Make maps an 'unvarnished' url --- core/utils.py | 15 +++++++++++++++ core/views/expo.py | 6 +++--- urls.py | 4 ++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/core/utils.py b/core/utils.py index 5d2d262..a76f41f 100644 --- a/core/utils.py +++ b/core/utils.py @@ -344,6 +344,21 @@ def find_nearest_point(points, target_point): nearest_distance = math.sqrt(nearest_distance_squared) return nearest_point_alt, nearest_distance +# This data was extarcted by Radost: +# The original source of heights (and positions is the file) +# loser/surface/terrain/SRTM-7x9-M31-482-279-offset.svx +""" +; Survex terrain data created by TerrainTool version 1.12a from Shuttle Radar Topography Mission data +; SRTM DEM data is public-domain. +; Used coordinate system AustrianM31 with ellipsoid "Bessel 1841" and datum "MGI Datum (Austria)" +; Grid centred at XXX 488000 283750 +; Lat/Long of centre = 47.691318 13.838777 ( 13 E 50' 19.6" 47 N 41' 28.7") relative to WGS84/GRS80 datum +; Grid convergence at centre = -0.374 degrees ( 0 W 22' 27.9") +; Point scale factor at centre = 1.0000177 +; Output offset by adding (-450000.00,-200000.00, 0.00) to calculated results; +; TerrainTool (c) 2008 - 2012 Mike McCombe +""" +#let raw = [[406264.72, 5278037.57, 873.53], rawheights = [[406264.72, 5278037.57, 873.53], [406314.69, 5278036.50, 861.60], [406364.66, 5278035.43, 852.51], diff --git a/core/views/expo.py b/core/views/expo.py index 900ca32..1ff8824 100644 --- a/core/views/expo.py +++ b/core/views/expo.py @@ -60,13 +60,13 @@ def spider(request, _): return redirect("/?#") # so that suffixes applied by spider are no longer part of the url def map(request): - """Serves unadorned the expoweb/map/map.html file""" - fn = Path(settings.EXPOWEB, "map", "map.html") + """Serves unadorned the expoweb/map/slippy/map.html file""" + fn = Path(settings.EXPOWEB, "map", "slippy", "map.html") return HttpResponse(content=open(fn, "r"), content_type="text/html") def mapfile(request, path): - """Serves unadorned file""" + """Serves unadorned file: everything in the /map/... folder tree""" fn = Path(settings.EXPOWEB, "map", path) return HttpResponse(content=open(fn, "r"), content_type=getmimetype(fn)) diff --git a/urls.py b/urls.py index 65d3ac4..5283849 100644 --- a/urls.py +++ b/urls.py @@ -236,8 +236,8 @@ trogglepatterns = [ # This next set are all intercepted by Apache, if it is running, with no problem. re_path(r'^photos/(?P.*)$', mediapage, {'doc_root': settings.PHOTOS_ROOT}, name="mediapage"), # photo galleries - re_path(r'^map/map.html', map, name="map"), # Redirects to OpenStreetMap JavaScript. NOT WORKING - re_path(r'^map/(?P.*)$', mapfile, name="mapfile"), # css, js, gpx. NOT WORKING + re_path(r'^map/slippy/map.html', map, name="map"), # Redirects to OpenStreetMap JavaScript. NOT WORKING + re_path(r'^map/slippy/(?P.*)$', mapfile, name="mapfile"), # css, js, gpx. NOT WORKING # This next set are all intercepted by Apache, if it is running, AND troggle must manage these, # even though the code is not in the troggle repo