feat: 成果包加入当前市场边界图层

每个市场包和全量包写入「市场名称+边界」GPKG,沿用用户样板的无填充紫色描边,
在 GIS.qgz 中放在 BuildInfo 下方并默认勾选。
This commit is contained in:
nixevol
2026-10-15 10:38:23 +08:00
parent 95a515453d
commit dda408bc6a
6 changed files with 669 additions and 1 deletions
+8 -1
View File
@@ -10,12 +10,13 @@ from .aoi_theme import normalize_aoi_gpkg
from .result_xlsx import create_result_xlsx
from .gpkg import build_summary_market
from .files import competitor_signal_raster_filename
from .files import copy_full_source_file
from .qgis import copy_gis_project_to_market
from .gpkg import export_market_aoi_gpkg
from .gpkg import export_market_building_info_gpkg
from .competitor import export_market_grid_outputs
from .gpkg import gpkg_layer_extent
from .market_boundary import boundary_filename
from .market_boundary import export_market_boundary_gpkg
from .files import market_zip_output_path
from .gpkg import open_read_connection
from .files import remove_file_with_retry
@@ -117,6 +118,7 @@ def process_market(market, pixel_width, pixel_height, output_dir):
market_dir / config.AOI_OUTPUT_FILENAME,
)
nr_buildings_path.unlink()
boundary_result = export_market_boundary_gpkg(market, market_dir / boundary_filename(market))
gis_project_result = copy_gis_project_to_market(
config.GIS_PROJECT_SOURCE,
gis_project_path,
@@ -125,6 +127,7 @@ def process_market(market, pixel_width, pixel_height, output_dir):
competitor_signal_result["raster_extent"],
aoi_result=aoi_result,
building_themes_result=nr_buildings_result,
boundary_result=boundary_result,
)
building_elapsed = perf_counter() - building_started_at
@@ -147,6 +150,7 @@ def process_market(market, pixel_width, pixel_height, output_dir):
"building_theme_results": [rewrite_result_for_zip(r, zip_path, market_dir) for r in theme_results],
"result_xlsx": rewrite_result_for_zip(result_xlsx, zip_path, market_dir),
"aoi_result": rewrite_result_for_zip(aoi_result, zip_path, market_dir),
"boundary_result": rewrite_result_for_zip(boundary_result, zip_path, market_dir),
"gis_project_result": rewrite_result_for_zip(gis_project_result, zip_path, market_dir),
"zip_result": zip_result,
"timings": {
@@ -241,6 +245,7 @@ def process_summary_grid_outputs(markets, pixel_width, pixel_height, output_dir)
aoi_path,
)
nr_buildings_path.unlink()
boundary_result = export_market_boundary_gpkg(summary_market, summary_dir / boundary_filename(summary_market))
gis_project_path = summary_dir / config.GIS_PROJECT_OUTPUT_FILENAME
gis_project_result = copy_gis_project_to_market(
config.GIS_PROJECT_SOURCE,
@@ -251,6 +256,7 @@ def process_summary_grid_outputs(markets, pixel_width, pixel_height, output_dir)
aoi_result=aoi_result,
building_themes_result=nr_buildings_result,
include_online=False,
boundary_result=boundary_result,
)
zip_result = write_market_zip(summary_dir, zip_path, summary_market)
legacy_zip_path = output_dir / config.LEGACY_SUMMARY_OUTPUT_FILENAME
@@ -267,6 +273,7 @@ def process_summary_grid_outputs(markets, pixel_width, pixel_height, output_dir)
"building_theme_results": [rewrite_result_for_zip(r, zip_path, summary_dir) for r in theme_results],
"result_xlsx": rewrite_result_for_zip(result_xlsx, zip_path, summary_dir),
"aoi_result": rewrite_result_for_zip(aoi_result, zip_path, summary_dir),
"boundary_result": rewrite_result_for_zip(boundary_result, zip_path, summary_dir),
"gis_project_result": rewrite_result_for_zip(gis_project_result, zip_path, summary_dir),
"zip_result": zip_result,
"elapsed_seconds": perf_counter() - started_at,