Add fastapi getnetworkinextent

This commit is contained in:
DingZQ
2025-01-04 16:11:26 +08:00
parent 98e58d1e53
commit 102f97b020

View File

@@ -1427,8 +1427,9 @@ async def fastapi_get_major_node_coords(network: str, diameter: int) -> list[str
# DingZQ, 2025-01-03, get network in extent
@app.get("/getnetworkinextent/")
async def fastapi_get_network_in_extent(network: str, x1: float, y1: float, x2: float, y2: float) -> dict[str, Any] | None:
# TODO
pass
nodes = api.get_nodes_in_extent(network, x1, y1, x2, y2)
links = api.get_links_in_extent(network, x1, y1, x2, y2)
return { 'nodes': nodes, 'links': links }
# DingZQ, 2024-12-08, get all links' start and end node
# link_id:link_type:node_id1:node_id2