阅读:1383回复:0
c#中实现跨图层的求交运算
<P>以点图层和面图层求交为例,实现选中面图层某个Feature中所有点,代码如下</P>
<P>ESRI.MapObjects2.Core.Point pt = axMap1.ToMapPoint(e.x, e.y);<BR>MapLayer cntyLayer = (MapLayer)axMap1.Layers.Item("点图层名");<BR>if (cntyLayer.shapeType == ShapeTypeConstants.moShapeTypePoint)<BR>{<BR> MapLayer zoneLayer = (MapLayer)axMap1.Layers.Item("面图层名");<BR> Recordset m_zone = zoneLayer.SearchShape(pt, SearchMethodConstants.moPointInPolygon, "");<BR> Object intersectZone = m_zone.Fields.Item("shape").Value;<BR> m_query = cntyLayer.SearchShape(intersectZone, SearchMethodConstants.moContaining, "");<BR> axMap1.CtlRefresh();<BR>}</P> |
|