hmind
路人甲
路人甲
  • 注册日期2007-08-04
  • 发帖数6
  • QQ
  • 铜币120枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1383回复:0

c#中实现跨图层的求交运算

楼主#
更多 发布于:2007-11-02 17:19
<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>
喜欢0 评分0
游客

返回顶部