修复Step7采样点布设路径读取问题:GDAL环境变量保护+路径归一化+FileNotFoundError检查+水域掩膜备选路径扫描

This commit is contained in:
DXC
2026-05-08 18:05:11 +08:00
parent 3c0bd29275
commit d7b5c45dd4
3 changed files with 45 additions and 3 deletions

View File

@ -229,6 +229,11 @@ class WorkerThread(QThread):
def run(self):
"""运行 pipeline:子线程内切换 Matplotlib 为 Agg,避免 Qt5Agg 在后台线程绘图导致界面卡死。"""
import os
# GDAL 环境变量保护(放在最前面,防止路径/编码问题)
os.environ['GDAL_FILENAME_IS_UTF8'] = 'YES'
os.environ['SHAPE_ENCODING'] = 'UTF-8'
mpl_prev = None
try:
import matplotlib