77范文网 - 专业文章范例文档资料分享平台

ArcEngine - 开发接口集(10)

来源:网络收集 时间:2020-02-21 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

======================================================== 怎样在buffer里面选择要素:

======================================================== 1. Dim pSpFilter As ISpatialFilter 2. Set pSpFilter = New SpatialFilter 3.

4. Dim pTopOper As ITopologicalOperator 5. Set pTopOper = pfeature.Shape 6. Dim pGeometry As IGeometry 7. Set pGeometry = pTopOper.Buffer(1) 8.

9. Set pSpFilter.Geometry = pGeometry

10. pSpFilter.SpatialRel = esriSpatialRelContains

11. '(esriSpatialRelContains是ISpatialFilter里面SpatialRel的一种参数

esriSpatialRelEnum,值为8,代表在这个区域内包含的要素) 12. 13. Set m_pSelGW_D = pLyr_D

14. m_pSelGW_D.SelectFeatures pSpFilter, esriSelectionResultNew, False 15. '(m_pSelGW_D是IfeatureSelection类型的变量) 16. pSpFilter.SpatialRel = esriSpatialRelIntersects 17.

18. Set m_pSelGW_X = pLyr

19. m_pSelGW_X.SelectFeatures pSpFilter, esriSelectionResultNew, False

25. Merge要素Union要素

1. Private Sub UnionSelected() 2. Dim pMxDoc As IMxDocument 3. Dim pFtrLyr As IFeatureLayer 4. Dim pFtrCls As IFeatureClass 5. Dim pFtrSel As IFeatureSelection

6. Dim pFtr As IFeature

7. Dim pEnumGeom As IEnumGeometry 8. Dim pEnumGeomBind As IEnumGeometryBind 9. Dim pTopOp As ITopologicalOperator 10. Dim pUnionedPolylines As IPolyline 11.

12. ' Get a ref to the selected polylines in the 1st layer 13. Set pMxDoc = ThisDocument

14. Set pFtrLyr = pMxDoc.FocusMap.Layer(0) 15. Set pFtrSel = pFtrLyr

16. Set pFtrCls = pFtrLyr.FeatureClass 17.

18. ' Create an enumeration of the selected polyines 19. Set pEnumGeom = New EnumFeatureGeometry 20. Set pEnumGeomBind = pEnumGeom

21. pEnumGeomBind.BindGeometrySource Nothing, pFtrSel.SelectionSet 22. pEnumGeom.Reset 23.

24. ' Union the polylines

25. Set pUnionedPolylines = New Polyline 26. Set pTopOp = pUnionedPolylines 27. pTopOp.ConstructUnion pEnumGeom 28.

29. ' Add this new unioned polyline to the featureclass 30. Set pFtr = pFtrCls.CreateFeature 31. Set pFtr.Shape = pUnionedPolylines 32. pFtr.Store 33. 34. End Sub C#语言

1. if (pFC.ShapeType ==

ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon) 2. {

3. IEnumGeometry pEnumGeom;

4. IEnumGeometryBind pEnumGeomBind = new EnumFeatureGeometryClass(); 5. IFeatureLayer pLyr = new FeatureLayerClass(); 6. pLyr.FeatureClass = pFC;

7. IFeatureSelection pFeatSel = (IFeatureSelection)pLyr; 8.

9. IQueryFilter pQfliter = new QueryFilterClass(); 10. pQfliter.WhereClause = this.SQLText.Text; 11. 12.

pFeatSel.SelectFeatures(pQfliter,

esriSelectionResultEnum.esriSelectionResultNew, false); 13.

14. pEnumGeomBind.BindGeometrySource(null, pFeatSel.SelectionSet); 15. pEnumGeom = (IEnumGeometry)pEnumGeomBind; 16. ITopologicalOperator pTopo = new PolygonClass(); 17. pTopo.ConstructUnion(pEnumGeom); 18. pGeom = (IGeometry)pTopo; 19. }

20. return pGeom;

26. 怎样从Table中获取具体需求值的Row

1. ITable pTable = (ITable)pFC; 2.

int

index

=

pTable.Fields.FindField(\

3. IQueryFilter pQFilter = new QueryFilterClass(); 4. ICursor pCur;

5. pCur = pTable.Search(pQFilter, false);

6. IRow pRow = new Row(); 7. IRow pAnswerRow = new Row(); 8. pRow = pCur.NextRow(); 9. while (pRow != null) 10. { 11.

string

Value

=

pRow.get_Value(index).ToString();

12. if (Value == \13. {

14. pAnswerRow = pRow; 15. break; 16. }

17. pRow = pCur.NextRow(); 18. }

27. 怎样ZoomInCenter

1. Public Sub ZoomInCenter()

2. Dim pMxDocument As IMxDocument 3. Dim pActiveView As IActiveView

4. Dim pDisplayTransform As IDisplayTransformation 5. Dim pEnvelope As IEnvelope 6. Dim pCenterPoint As IPoint 7.

8. Set pMxDocument = Application.Document 9. Set pActiveView = pMxDocument.FocusMap 10. Set

pDisplayTransform

=

pActiveView.ScreenDisplay.DisplayTransformation 11. Set pEnvelope = pDisplayTransform.VisibleBounds

12. 'In this case, we could have set pEnvelope to IActiveView::Extent 13. 'Set pEnvelope = pActiveView.Extent 14. Set pCenterPoint = New Point

15.

16. pCenterPoint.x = ((pEnvelope.XMax - pEnvelope.XMin) / 2) + pEnvelope.XMin 17. pCenterPoint.y = ((pEnvelope.YMax - pEnvelope.YMin) / 2) + pEnvelope.YMin 18. pEnvelope.width = pEnvelope.width / 2 19. pEnvelope.height = pEnvelope.height / 2 20. pEnvelope.CenterAt pCenterPoint

21. pDisplayTransform.VisibleBounds = pEnvelope 22. pActiveView.Refresh 23. End Sub

28. 怎样读取一个字段内的所有值 1.

IFeatureClass

pFC

=

m_SDEQuery.getFeatureClass();

2. IFeatureCursor pFeaCur = pFC.Search(null, false); 3. IFeature pFeature = pFeaCur.NextFeature(); 4.

int

pFieldIndex

=

pFC.Fields.FindField(this.m_cboQryFld.SelectedItem.Value.ToString()); 5. System.Collections.ArrayList pArr = new

System.Collections.ArrayList();

6. while (pFeature != null) 7. { 8.

string

theFieldValue

=

pFeature.get_Value(pFieldIndex).ToString();

9. if (!pArr.Contains(theFieldValue) &&

(theFieldValue.Trim() != \10. {

11. m_cboQryText.Items.Add(theFieldVa

lue);

12. pArr.Add(theFieldValue); 13. }

14. pFeature = pFeaCur.NextFeature();

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库ArcEngine - 开发接口集(10)在线全文阅读。

ArcEngine - 开发接口集(10).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/jiaoyu/772901.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: