Clean virtual district
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
from .database import *
|
from .database import *
|
||||||
from .s0_base import get_node_links
|
from .s0_base import get_node_links
|
||||||
#from .s32_region_util import calculate_boundary, calculate_convex_hull, inflate_boundary
|
|
||||||
|
|
||||||
|
|
||||||
def calculate_virtual_district(name: str, centers: list[str]) -> dict[str, Any]:
|
def calculate_virtual_district(name: str, centers: list[str]) -> dict[str, list[Any]]:
|
||||||
write(name, 'delete from temp_vd_topology')
|
write(name, 'delete from temp_vd_topology')
|
||||||
|
|
||||||
# map node name to index
|
# map node name to index
|
||||||
@@ -62,9 +61,6 @@ def calculate_virtual_district(name: str, centers: list[str]) -> dict[str, Any]:
|
|||||||
vds: list[dict[str, Any]] = []
|
vds: list[dict[str, Any]] = []
|
||||||
|
|
||||||
for center, value in center_node.items():
|
for center, value in center_node.items():
|
||||||
#p = calculate_boundary(name, value)
|
|
||||||
#b = inflate_boundary(name, p)
|
|
||||||
#c = calculate_convex_hull(name, value)
|
|
||||||
vds.append({ 'center': center, 'nodes': value })
|
vds.append({ 'center': center, 'nodes': value })
|
||||||
|
|
||||||
return { 'virtual_districts': vds, 'isolated_nodes': isolated_nodes }
|
return { 'virtual_districts': vds, 'isolated_nodes': isolated_nodes }
|
||||||
|
|||||||
Reference in New Issue
Block a user