IFeatureLayer flayer = axMapControl1.Map.get_Layer(0) as IFeatureLayer;
IFeatureClass fClass = flayer.FeatureClass;
int fCount = fClass.FeatureCount(null);
IPolyline FirstPolyline = fClass.GetFeature(0) as IPolyline;
IPolyline SecondPolyline = fClass.GetFeature(1) as IPolyline;
ITopologicalOperator topoOperator = fClass.GetFeature(0).Shape as ITopologicalOperator;
IGeometry geo = topoOperator.Intersect(fClass.GetFeature(1).Shape, esriGeometryDimension.esriGeometry0Dimension);
if (!geo.IsEmpty)
{
IPointCollection Pc = geo as IPointCollection;
IPoint Pt = Pc.get_Point(0);
MessageBox.Show(Pc.PointCount.ToString()+ ":" + Pt.X.ToString() + "," + Pt.Y.ToString());
}
获取线要素交点
最新推荐文章于 2024-07-22 20:23:56 发布