在道路编辑过程,要素方向也很重要,比如在地图导航时,如果方向不正确,则为逆行。要素方向即为绘制的方向,每一条都有一个起点(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));
        }
    }

  

相关文章:

  • 2021-11-26
  • 2021-11-08
  • 2021-05-13
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-27
猜你喜欢
  • 2021-12-30
  • 2021-07-14
  • 2021-07-23
  • 2021-10-17
  • 2021-06-19
  • 2022-12-23
相关资源
相似解决方案