欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ArcGIS Engine代码段笔记【二】

程序员文章站 2022-07-14 10:00:28
...

判断要素是否自相交

 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);
ArcGIS Engine代码段笔记【二】
ILine pLine = new LineClass();
pPolyline.QueryNormal(esriSegmentExtension.esriExtendAtFrom, 30, false, 75, pLine);
ArcGIS Engine代码段笔记【二】
ICurve pCurve = new PolylineClass();
pPolyline.GetSubcurve(60, 110, false, out pCurve);
ArcGIS Engine代码段笔记【二】


IProximityOperator接口查询距离

IProximityOperator p = pPolyline as IProximityOperator;
IPoint sPoint =  p.ReturnNearestPoint(pPoint, esriSegmentExtension.esriNoExtension);
ArcGIS Engine代码段笔记【二】


IProximityOperator p = pPolyline as IProximityOperator;
IPoint sPoint =  p.ReturnNearestPoint(pPoint, esriSegmentExtension.esriExtendEmbedded);
ArcGIS Engine代码段笔记【二】