fix: 加快竞对信号和采样点生成

This commit is contained in:
nixevol
2026-10-15 16:03:29 +08:00
parent 6227cef264
commit 609b1e39b8
5 changed files with 52 additions and 30 deletions
+12 -1
View File
@@ -31,7 +31,12 @@ from .files import safe_filename
from .files import write_market_zip
def process_market(market, pixel_width, pixel_height, output_dir):
def process_market(market, pixel_width, pixel_height, output_dir, report=None):
def note(message):
print(message, flush=True)
if report:
report(message)
config.check_cancelled()
started_at = perf_counter()
output_dir = Path(output_dir)
@@ -85,6 +90,7 @@ def process_market(market, pixel_width, pixel_height, output_dir):
grid_started_at = perf_counter()
competitor_signal_result = None
if enabled(plan, "competitor"):
note(f"正在生成竞对信号:{market.name}")
(
# user_count_result,
competitor_signal_result,
@@ -101,6 +107,8 @@ def process_market(market, pixel_width, pixel_height, output_dir):
None,
# (grid_4g_conn, grid_4g_layer, grid_4g_rtree),
)
if enabled(plan, "sample"):
note(f"正在合并采样点:{market.name}")
sample_result = export_sample_grid(
grid_5g_conn, grid_5g_layer, grid_5g_rtree,
grid_4g_conn, grid_4g_layer, grid_4g_rtree,
@@ -109,6 +117,8 @@ def process_market(market, pixel_width, pixel_height, output_dir):
grid_elapsed = perf_counter() - grid_started_at
building_started_at = perf_counter()
if enabled(plan, "buildinfo"):
note(f"正在导出建筑信息:{market.name}")
building_info_result = export_market_building_info_gpkg(
building_info_conn,
building_info_layer,
@@ -140,6 +150,7 @@ def process_market(market, pixel_width, pixel_height, output_dir):
boundary_result = export_market_boundary_gpkg(
market, market_dir / boundary_filename(market),
) if enabled(plan, "boundary") else None
note(f"正在写入工程:{market.name}")
gis_project_result = copy_gis_project_to_market(
config.GIS_PROJECT_SOURCE,
gis_project_path,