Changed texturedmesh to texturedmodel download URL

pull/116/head
Piero Toffanin 2017-03-08 11:11:31 -05:00
rodzic 5a10da6861
commit 7d83268fa4
5 zmienionych plików z 11 dodań i 11 usunięć

Wyświetl plik

@ -225,7 +225,7 @@ class TaskDownloads(TaskNestedView):
allowed_assets = {
'all': 'all.zip',
'geotiff': os.path.join('odm_orthophoto', 'odm_orthophoto.tif'),
'texturedmesh': '_SEE_PATH_BELOW_',
'texturedmodel': '_SEE_PATH_BELOW_',
'las': os.path.join('odm_georeferencing', 'odm_georeferenced_model.ply.las'),
'ply': os.path.join('odm_georeferencing', 'odm_georeferenced_model.ply'),
'csv': os.path.join('odm_georeferencing', 'odm_georeferenced_model.csv')
@ -233,8 +233,8 @@ class TaskDownloads(TaskNestedView):
# Generate textured mesh if requested
try:
if asset == 'texturedmesh':
allowed_assets[asset] = os.path.basename(task.get_textured_mesh_archive())
if asset == 'texturedmodel':
allowed_assets[asset] = os.path.basename(task.get_textured_model_archive())
except FileNotFoundError:
raise exceptions.NotFound("Asset does not exist")

Wyświetl plik

@ -419,15 +419,15 @@ class Task(models.Model):
}
}
def get_textured_mesh_archive(self):
def get_textured_model_archive(self):
archive_path = self.assets_path("odm_texturing.zip")
textured_mesh_directory = self.assets_path("odm_texturing")
textured_model_directory = self.assets_path("odm_texturing")
if not os.path.exists(textured_mesh_directory):
raise FileNotFoundError("{} does not exist".format(textured_mesh_directory))
if not os.path.exists(textured_model_directory):
raise FileNotFoundError("{} does not exist".format(textured_model_directory))
if not os.path.exists(archive_path):
shutil.make_archive(os.path.splitext(archive_path)[0], 'zip', textured_mesh_directory)
shutil.make_archive(os.path.splitext(archive_path)[0], 'zip', textured_model_directory)
return archive_path

Wyświetl plik

@ -32,7 +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("Textured Model","texturedmodel","fa fa-connectdevelop"),
new AssetDownload("LAS","las","fa fa-cube"),
new AssetDownload("PLY","ply","fa fa-cube"),
new AssetDownload("CSV","csv","fa fa-cube"),

Wyświetl plik

@ -170,7 +170,7 @@ class TestApiTask(BootTransactionTestCase):
self.assertTrue(res.status_code == status.HTTP_404_NOT_FOUND)
# Cannot download assets (they don't exist yet)
assets = ["all", "geotiff", "texturedmesh", "las", "csv", "ply"]
assets = ["all", "geotiff", "texturedmodel", "las", "csv", "ply"]
for asset in assets:
res = client.get("/api/projects/{}/tasks/{}/download/{}/".format(project.id, task.id, asset))

Wyświetl plik

@ -115,7 +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
texturedmodel | 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.