From 1386c592bf3919863d286abbf8720c7ad86edcfd Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby Date: Mon, 20 Oct 2025 15:18:20 +0200 Subject: [PATCH] Geotiff: Try load geotiff otherelse disable features. --- src/View/Results/Window.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/View/Results/Window.py b/src/View/Results/Window.py index 9238c1bc..efad1db5 100644 --- a/src/View/Results/Window.py +++ b/src/View/Results/Window.py @@ -19,7 +19,11 @@ import os import csv import logging -# import rasterio +try: + import rasterio + _rasterio_loaded = True +except: + _rasterio_loaded = False from numpy import sqrt @@ -337,10 +341,12 @@ class ResultsWindow(PamhyrWindow): "action_add": self._add_custom_plot, "action_export": self._export, # "action_export": self.export_current, - "action_Geo_tiff": self.import_geotiff } - self.find(QAction, "action_Geo_tiff").setEnabled(False) - self.find(QAction, "action_Geo_tiff").setVisible(False) + if _rasterio_loaded: + actions["action_Geo_tiff"] = self.import_geotiff + else: + self.find(QAction, "action_Geo_tiff")\ + .setEnabled(False) if len(self._results) > 1: self.find(QAction, "action_reload").setEnabled(False)