Prevent infinite loop

This commit is contained in:
WQY\qiong
2023-06-08 21:25:13 +08:00
parent 491e70f79f
commit 6dbf701318
3 changed files with 63 additions and 3 deletions

View File

@@ -41,7 +41,7 @@ def generate_sub_district_metering_area(name: str, dma: str, part_count: int = 1
for nodes in calculate_district_metering_area_for_region(name, dma, part_count, part_type):
boundary = calculate_boundary(name, nodes)
boundary = inflate_boundary(name, boundary, inflate_delta)
cs.add({ 'type': 'district_metering_area', 'id': f"DMA_{level}_{i}", 'boundary': boundary, 'parent': dma, 'nodes': nodes })
cs.add({ 'type': 'district_metering_area', 'id': f"DMA_[{dma}]_{level}_{i}", 'boundary': boundary, 'parent': dma, 'nodes': nodes })
i += 1
return execute_batch_command(name, cs)