Support inflate delta

This commit is contained in:
WQY\qiong
2023-05-19 22:59:25 +08:00
parent 4e14b9398d
commit 99c82fcf15
4 changed files with 16 additions and 16 deletions

View File

@@ -3,7 +3,7 @@ from .s34_sa_cal import *
from .s34_sa import get_all_service_area_ids
from .batch_exe import execute_batch_command
def generate_service_area(name: str) -> ChangeSet:
def generate_service_area(name: str, inflate_delta: float = 0.5) -> ChangeSet:
cs = ChangeSet()
for id in get_all_service_area_ids(name):
@@ -15,7 +15,7 @@ def generate_service_area(name: str) -> ChangeSet:
for sas in sass:
for source, nodes in sas.items():
boundary = calculate_boundary(name, nodes)
boundary = inflate_boundary(name, boundary)
boundary = inflate_boundary(name, boundary, inflate_delta)
cs.add({ 'type': 'service_area', 'id': f"SA_{source}_{time_index}", 'boundary': boundary, 'time_index': time_index, 'source': source, 'nodes': nodes })
time_index += 1