在道路编辑过程中,要素方向也很重要,比如在地图导航时,如果方向不正确,则为逆行。要素方向即为绘制的方向,每一条都有一个起点(FromPoint)和终点(ToPoint),在编辑过程中难免绘制错误,那么如何修改过来呢?
方法一:编辑翻转
方法二:翻转线工具
可对整个图层进行翻转操作。
也可对选中的部分要素进行翻转操作。如下图所示:
方法三:代码编程
Python:
arcpy.FlipLine_edit(inFeatures)
ArcEngine:
public void ReverseOrientation(IFeatureClass featureClass, int oidToEdit)
{
IFeature feature = featureClass.GetFeature(oidToEdit);
if (feature.Shape.GeometryType == esriGeometryType.esriGeometryPolygon)
{
IArea area = feature.Shape as IArea;
double beforeReverse = area.Area;
ICurve curve = feature.Shape as ICurve;
curve.ReverseOrientation();
double afterReverse = area.Area;
System.Windows.Forms.MessageBox.Show(String.Format("The polygon area is originally {0}, after the orientation was reversed the area is {1}.",beforeReverse,afterReverse));
}
}
本文来自投稿,不代表本站立场,如若转载,请注明出处: