This commit is contained in:
DingZQ
2023-05-26 19:20:27 +08:00
parent afeeed6403
commit 6c9ef0efa2

View File

@@ -1610,15 +1610,14 @@ async def fastapi_set_district_metering_area(network: str, req: Request) -> Chan
@app.post('/adddistrictmeteringarea/')
async def fastapi_add_district_metering_area(network: str, req: Request) -> ChangeSet:
props = await req.json()
print(props)
# boundary should be [(x,y), (x,y)]
boundary = props['boundary']
newBoundary = []
for pt in boundary:
newBoundary.append((pt[0], pt[1]))
props['boundary'] = newBoundary
print(props)
return add_district_metering_area(network, ChangeSet(props))