From 103342ea853862b9267d1a508d9d06117947f5e2 Mon Sep 17 00:00:00 2001 From: Mattia Date: Fri, 21 Jun 2024 16:31:38 +0200 Subject: [PATCH] [Fixes #246] Fix transform for 3dtiles handling --- importer/handlers/tiles3d/handler.py | 4 +--- importer/handlers/tiles3d/tests.py | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/importer/handlers/tiles3d/handler.py b/importer/handlers/tiles3d/handler.py index 8ea6b4b..be153e1 100755 --- a/importer/handlers/tiles3d/handler.py +++ b/importer/handlers/tiles3d/handler.py @@ -264,9 +264,7 @@ def set_bbox_from_region(self, js_file, resource): return resource def set_bbox_from_boundingVolume(self, js_file, resource): - transform_raw = ( - js_file.get("root", {}).get("boundingVolume", {}).get("transform", None) - ) + transform_raw = js_file.get("root", {}).get("transform", []) box_raw = js_file.get("root", {}).get("boundingVolume", {}).get("box", None) if not transform_raw and not box_raw: # skipping if values are missing from the json file diff --git a/importer/handlers/tiles3d/tests.py b/importer/handlers/tiles3d/tests.py index b1e25d5..0d493ce 100755 --- a/importer/handlers/tiles3d/tests.py +++ b/importer/handlers/tiles3d/tests.py @@ -262,8 +262,7 @@ def test_set_bbox_from_bounding_volume_wit_transform(self): "asset": {"version": "1.1"}, "geometricError": 1.0, "root": { - "boundingVolume": { - "transform": [ + "transform": [ 96.86356343768793, 24.848542777253734, 0, @@ -280,7 +279,8 @@ def test_set_bbox_from_bounding_volume_wit_transform(self): -4736682.902037748, 4081926.095098698, 1, - ], + ], + "boundingVolume": { "box": [0, 0, 0, 7.0955, 0, 0, 0, 3.1405, 0, 0, 0, 5.0375], } },