/// 粗略判断一个已知点是否在线上
private bool isPointOnLine(IPoint pPoint, IPolyline myLine)
{
ITopologicalOperator topo = pPoint as ITopologicalOperator;
IGeometry buffer = topo.Buffer(0.00001); //缓冲一个极小的距离
topo = buffer as ITopologicalOperator;
IGeometryCollection pgeo = topo.Intersect(myLine, esriGeometryDimension.esriGeometry0Dimension) as IGeometryCollection;
bool result = false;
if (pgeo.GeometryCount > 0)
result = true;
return result;
}
private bool isPointOnLine(IPoint pPoint, IPolyline myLine,int juli)
{
ITopologicalOperator topo = pPoint as ITopologicalOperator;
IGeometry buffer = topo.Buffer(juli); //缓冲一个极小的距离
topo = buffer as ITopologicalOperator;
if (topo == null)
{
return false;
}
IGeometryCollection pgeo = topo.Intersect(myLine, esriGeometryDimension.esriGeometry0Dimension) as IGeometryCollection;
bool result = false;
if (pgeo.GeometryCount > 0)
result = true;
return result;
//_map.SelectFeature();
}
arcengine c# 判断一个已知点是否在线上
最新推荐文章于 2022-04-26 18:04:24 发布