Skip to content

Commit

Permalink
bug with listing Transforms
Browse files Browse the repository at this point in the history
  • Loading branch information
KatKatKateryna committed Nov 25, 2024
1 parent daa91f7 commit 58e959d
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions speckle/ui_widgets/widget_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import webbrowser
import specklepy_qt_ui.qt_ui

from plugin_utils.helpers import UNSUPPORTED_PROVIDERS

FORM_CLASS, _ = uic.loadUiType(
os.path.join(
os.path.join(
Expand Down Expand Up @@ -220,9 +222,11 @@ def populateLayersByTransform(self):

elif "elevation" in transform.lower():
if isinstance(layer, QgsRasterLayer):
# avoiding tiling layers
ds = gdal.Open(layer.source(), gdal.GA_ReadOnly)
if ds is None:
# avoiding Tile and WMS layers
data_provider_type = (
layer.providerType()
) # == ogr, memory, gdal, delimitedtext
if data_provider_type in UNSUPPORTED_PROVIDERS:
continue

# for satellites
Expand Down Expand Up @@ -309,9 +313,11 @@ def populateSavedElevationLayer(
countRaster = 1
for i, layer in enumerate(self.dataStorage.all_layers):
if isinstance(layer, QgsRasterLayer):
# avoiding tiling layers
ds = gdal.Open(layer.source(), gdal.GA_ReadOnly)
if ds is None:
# avoiding Tile and WMS layers
data_provider_type = (
layer.providerType()
) # == ogr, memory, gdal, delimitedtext
if data_provider_type in UNSUPPORTED_PROVIDERS:
continue
elif layer.bandCount() != 1:
continue
Expand Down Expand Up @@ -382,7 +388,7 @@ def saveElevationLayer(self) -> "DataStorage":
)
layer = None
break

set_elevationLayer(self.dataStorage)

try:
Expand Down

0 comments on commit 58e959d

Please sign in to comment.