From dadc9f9cadb8333789d4e2d168d8e78fb18f8a01 Mon Sep 17 00:00:00 2001 From: ptresson <paul.tresson@ird.fr> Date: Fri, 28 Feb 2025 09:30:34 +0100 Subject: [PATCH] dirty temporary fix for gpd io error if using pygrio (try except causes a rasterio error ??) --- utils/algo.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/utils/algo.py b/utils/algo.py index e0a4c62..bb71d36 100644 --- a/utils/algo.py +++ b/utils/algo.py @@ -7,6 +7,7 @@ import joblib from collections import Counter from pathlib import Path from typing import Dict, Any + from qgis.core import ( Qgis, QgsGeometry, @@ -25,11 +26,23 @@ from qgis.core import ( QgsProcessingParameterDefinition, QgsProcessingParameterVectorLayer, ) + import rasterio from rasterio import windows from rasterio.enums import Resampling import geopandas as gpd +# SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) +# PLUGIN_ROOT_DIR = os.path.realpath( +# os.path.abspath(os.path.join(SCRIPT_DIR, "..")) +# ) +# try: +# tmp = gpd.read_file(os.path.abspath(os.path.join(PLUGIN_ROOT_DIR, 'assets','ml.shp'))) +# except ValueError: +# gpd.options.io_engine = "fiona" +# print('Using fiona as gpd backend') + +gpd.options.io_engine = "fiona" from shapely.geometry import box import torch -- GitLab