判断要素是否自相交
ESRI.ArcGIS.Geometry.IGeometry pGeo = pFeature.ShapeCopy;
ESRI.ArcGIS.Geometry.IGeometryCollection pColl = pGeo as ESRI.ArcGIS.Geometry.IGeometryCollection;
int Count1 = pColl.GeometryCount;
ESRI.ArcGIS.Geometry.ITopologicalOperator2 pTopologicalOperator2 = pGeo as ESRI.ArcGIS.Geometry.ITopologicalOperator2;
pTopologicalOperator2.IsKnownSimple_2 = false;
pTopologicalOperator2.Simplify();
pColl = pGeo as ESRI.ArcGIS.Geometry.IGeometryCollection;
int Count2 = pColl.GeometryCount;
if (Count2 > Count1)
{
//自相交
}
IPolyline接口查询距离、获取某个部分
pPolyline.QueryPointAndDistance(esriSegmentExtension.esriExtendAtFrom, pPoint, false, pOutPoint, ref DistanceAlongCurve, ref distanceFromCurveis, ref bRightSide);
![](https://i-blog.csdnimg.cn/blog_migrate/992945dfcdd9e1f5ca094538ab617289.png)
ILine pLine = new LineClass();
pPolyline.QueryNormal(esriSegmentExtension.esriExtendAtFrom, 30, false, 75, pLine);
![](https://i-blog.csdnimg.cn/blog_migrate/6808e3e21b7101397971bd929e96e562.png)
ICurve pCurve = new PolylineClass();
pPolyline.GetSubcurve(60, 110, false, out pCurve);
![](https://i-blog.csdnimg.cn/blog_migrate/4613e0fd52c88c0e1e5e488d78ecd5a0.png)
IProximityOperator接口查询距离
IProximityOperator p = pPolyline as IProximityOperator;
IPoint sPoint = p.ReturnNearestPoint(pPoint, esriSegmentExtension.esriNoExtension);
![](https://i-blog.csdnimg.cn/blog_migrate/14cc3fe3db0324160843566d075825be.png)
IProximityOperator p = pPolyline as IProximityOperator;
IPoint sPoint = p.ReturnNearestPoint(pPoint, esriSegmentExtension.esriExtendEmbedded);
![](https://i-blog.csdnimg.cn/blog_migrate/ffcd26d6abbea7e3245ed609d505c507.png)