我正在尝试编写一个 python 脚本来确定水管网络上的流向。我已经使用这个脚本找到了每条折线的中点,现在我需要将此数据转换为点要素类,这将成为流向的箭头。
我尝试将其保存为列表,但无法将列表转换为点特征。谁能建议将中点位置保存为点要素类的方法?
#FlowArrows.py
import arcpy
#setting the environment
arcpy.env.workspace = "J:/PYTHON/Flow_Direction.gdb"
#arcpy.env.overwriteOutput = True
#Setting the containers
Pipes = r"J:\PYTHON\Flow_Direction.gdb\Pipes"
Nodes = r"J:\PYTHON\Flow_Direction.gdb\Nodes"
MidList = []
#Getting the mid point
Cursor = arcpy.SearchCursor(Pipes)
for i in Cursor:
Midpoint = i.shape.positionAlongLine(0.50,True).firstPoint
MidList.append(Midpoint)
print ("done")