From 46a7b968e14d17499222dd2f34141dc2625fbc4b Mon Sep 17 00:00:00 2001 From: KatKatKateryna Date: Thu, 7 Nov 2024 23:33:26 +0000 Subject: [PATCH] expand context list with VectorLayers (not only displayable) --- pygeoapi/provider/speckle.py | 4 +++- pygeoapi/provider/speckle_utils/crs_utils.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pygeoapi/provider/speckle.py b/pygeoapi/provider/speckle.py index 5222333..b66eee2 100644 --- a/pygeoapi/provider/speckle.py +++ b/pygeoapi/provider/speckle.py @@ -474,7 +474,9 @@ class SpeckleProvider(BaseProvider): and (isinstance(getattr(x, item, None), list) or ("grasshopper" in self.sourceApp.lower() and x.speckle_type == "Base") ) ], ) - context_list = [x for x in GraphTraversal([rule]).traverse(commit_obj) if isDisplayable(x.current)] + + # for the context list, save the displayable objects and Layers (for getting CRS for now) + context_list = [x for x in GraphTraversal([rule]).traverse(commit_obj) if isDisplayable(x.current) or x.current.speckle_type.endswith("VectorLayer")] get_set_crs_settings(self, commit_obj, context_list, data) diff --git a/pygeoapi/provider/speckle_utils/crs_utils.py b/pygeoapi/provider/speckle_utils/crs_utils.py index 3490383..8709b12 100644 --- a/pygeoapi/provider/speckle_utils/crs_utils.py +++ b/pygeoapi/provider/speckle_utils/crs_utils.py @@ -51,7 +51,7 @@ def get_set_crs_settings(self: "SpeckleProvider", commit_obj: "Base", context_li root_objects = [] try: - root_objects = [commit_obj] + commit_obj.elements + root_objects = [commit_obj] + commit_obj.elements + [c.current for c in context_list] except AttributeError as ex: pass # old commit structure