QueryPoint方法可以查询多段线上的任意点,查询中间点代码示例如下:
/// <summary>
/// 查询多段线的中间点
/// </summary>
/// <param name="pPolyline">传入的多段线</param>
/// <returns>中间点</returns>
public static IPoint QueryMiddlePoint(IPolyline pPolyline)
{
if (null == pPolyline)
{
return null;
}
double dLength = pPolyline.Length;
IPoint pPoint = new PointClass();
pPolyline.QueryPoint(esriSegmentExtension.esriNoExtension, dLength * 0.5, false, pPoint);
return pPoint;
}
本文介绍了一种查询GIS中多段线中间点的方法,并提供了一个具体的代码示例。通过计算多段线长度的一半来定位中间点的位置。
1万+

被折叠的 条评论
为什么被折叠?



