From a907f2f7c27f4267d32d9a818a9c8eabad57d414 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Wed, 8 Mar 2017 10:16:46 -0500 Subject: [PATCH] Textured mesh download option --- app/models.py | 6 +++--- app/static/app/js/classes/AssetDownloads.js | 1 + slate/source/includes/reference/_task.md | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models.py b/app/models.py index 2051928d..1e7ad1d6 100644 --- a/app/models.py +++ b/app/models.py @@ -427,9 +427,9 @@ class Task(models.Model): raise FileNotFoundError("{} does not exist".format(textured_mesh_directory)) if not os.path.exists(archive_path): - shutil.make_archive(archive_path, 'zip', textured_mesh_directory) - else: - return archive_path + shutil.make_archive(os.path.splitext(archive_path)[0], 'zip', textured_mesh_directory) + + return archive_path def delete(self, using=None, keep_parents=False): directory_to_delete = os.path.join(settings.MEDIA_ROOT, diff --git a/app/static/app/js/classes/AssetDownloads.js b/app/static/app/js/classes/AssetDownloads.js index 60c7afde..bb244ffd 100644 --- a/app/static/app/js/classes/AssetDownloads.js +++ b/app/static/app/js/classes/AssetDownloads.js @@ -32,6 +32,7 @@ const api = { all: function() { return [ new AssetDownload("GeoTIFF","geotiff","fa fa-map-o"), + new AssetDownload("Textured Mesh","texturedmesh","fa fa-connectdevelop"), new AssetDownload("LAS","las","fa fa-cube"), new AssetDownload("PLY","ply","fa fa-cube"), new AssetDownload("CSV","csv","fa fa-cube"), diff --git a/slate/source/includes/reference/_task.md b/slate/source/includes/reference/_task.md index 47b5d4ab..fb736ef6 100644 --- a/slate/source/includes/reference/_task.md +++ b/slate/source/includes/reference/_task.md @@ -115,6 +115,7 @@ Asset | Description ----- | ----------- all | Archive (.zip) containing all assets, including an orthophoto, TMS tiles, a textured 3D model and point cloud in various formats. geotiff | GeoTIFF orthophoto. +texturedmesh | Archive (.zip) containing the textured 3D model las | Point cloud in .LAS format. ply | Point cloud in .PLY format. csv | Point cloud in .CSV format.