我正在尝试编写一个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")
试试这个:
相关问题 更多 >
编程相关推荐