From d57b022dc62f5b5bd8d13fc7040561a4615b4848 Mon Sep 17 00:00:00 2001
From: ptresson <paul.tresson@ird.fr>
Date: Wed, 4 Sep 2024 10:26:04 +0200
Subject: [PATCH] work in temporary directory by default

---
 encoder.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/encoder.py b/encoder.py
index 06b9e10..5e16d27 100644
--- a/encoder.py
+++ b/encoder.py
@@ -1,5 +1,6 @@
 import os
 import time
+import tempfile
 import re
 import hashlib
 import numpy as np
@@ -81,6 +82,7 @@ class EncoderAlgorithm(QgsProcessingAlgorithm):
         with some other properties.
         """
         cwd = Path(__file__).parent.absolute()
+        tmp_wd = os.path.join(tempfile.gettempdir(), "iamap_features")
 
         self.addParameter(
             QgsProcessingParameterRasterLayer(
@@ -196,7 +198,7 @@ class EncoderAlgorithm(QgsProcessingAlgorithm):
                 self.OUTPUT,
                 self.tr(
                     "Output directory (choose the location that the image features will be saved)"),
-            defaultValue=os.path.join(cwd,'features'),
+            defaultValue=tmp_wd,
             )
         )
 
-- 
GitLab