feat: 市场出图改为按图层分步选择

未勾选生成的图层会跳过对应计算,也不会进入成果工程;导入页只列出仍需要的数据源。
This commit is contained in:
nixevol
2026-10-15 15:15:45 +08:00
parent 8ce1b78e58
commit e8c8218d11
11 changed files with 595 additions and 267 deletions
+10
View File
@@ -22,9 +22,19 @@ def market_options(path):
f'SELECT "fid", "Name" FROM {gpkg.quote_identifier(layer.table_name)} ORDER BY "fid"')]
def market_source_keys(params):
from marketgrid.output_layers import needed_sources, normalize
if isinstance(params.get("OUTPUT_LAYERS"), dict):
return needed_sources(normalize(params["OUTPUT_LAYERS"])) & set(SOURCES)
return set(SOURCES)
def validate(kind, params):
if kind == "market":
wanted = market_source_keys(params)
for key, (label, _, suffix) in SOURCES.items():
if key not in wanted:
continue
path = Path(params[key])
if not path.is_file():
raise ValueError(f"{label}文件不存在:{path}")