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;
}
标签:distance,return,几何图形,geometry,距离,ArcObject,几何,geometryOther 来源: https://blog.csdn.net/weixin_45611944/article/details/120184927