ArcObject 几何距离计算

2021/9/9 23:34:47

本文主要是介绍ArcObject 几何距离计算,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

ArcObject 几何距离计算

 /// <summary>
        /// 获取两个几何图形的距离
        /// </summary>
        /// <param name="geometry">几何图形A</param>
        /// <param name="geometryOther">几何图形B</param>
        /// <returns>两个几何图形的距离</returns>
        private double GeometryDistance(IGeometry geometry, IGeometry geometryOther)
        {
            if (geometry == null || geometryOther == null) return -1;

            IProximityOperator proOperator = geometry as IProximityOperator;
            double distance = proOperator.ReturnDistance(geometryOther);

            // 距离转换 度->米
            IUnitConverter convert = new UnitConverterClass();
            distance = convert.ConvertUnits(distance, esriUnits.esriDecimalDegrees, esriUnits.esriMeters);
            
            return distance;
        }



这篇关于ArcObject 几何距离计算的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程