ImageVerifierCode 换一换
格式:DOCX , 页数:62 ,大小:3.58MB ,
资源ID:19959690      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/19959690.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(AE创建各种类型的featureclass代码Word格式.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

AE创建各种类型的featureclass代码Word格式.docx

1、SpatialReference;pFieldEdit.GeometryDef_2 = pGeometryDef;pFieldsEdit.AddField(pField);/新建字段pField = new FieldClass();pFieldEdit = pField as IFieldEdit;pFieldEdit.Length_2 = 15;SchoolNamepFieldEdit.AliasName_2 = pFieldEdit.Type_2 = esriFieldType.esriFieldTypeString;string mappath = E:datastring layer

2、name=schoolIWorkspaceFactory pWorkspaceFactory = new ShapefileWorkspaceFactory();IFeatureWorkspace pFeatureWorkspace = pWorkspaceFactory.OpenFromFile(mappath,0) as IFeatureWorkspace;pFeatureWorkspace.CreateFeatureClass(layername+.shp,pFields,null,null,esriFeatureType.esriFTSimple,);axMapControl1.Add

3、ShapeFile(mappath,layername+代码中路径名称可以自定义posted on 2008-07-12 15:28 duckweeds 阅读(137) 评论(0) 编辑 收藏 网摘 所属分类:AE+C#AE 创建各种类型的 featureclass 代码VB.Net 源码 创建 Annotation 类型的 featureclass/summaryparam name=pWorkspaceannotation 的工作空间pTextSymbolannotation 的 symbolpRefeScaleannotation 的比例pAnnoFeatNameannotation 的

4、名称创建的 Annotation FeatureclassremarksPrivate Function CreateAnnoFeatCls(ByVal pWorkspace As IFeatureWorkspace, ByVal pTextSymbol As ITextSymbol, ByVal pRefeScale As Double, ByVal pAnnoFeatName As String, Optional ByVal pSymbolID As Integer = 0) As IFeatureClassDim pField As IField Dim pFields As IFie

5、lds Dim pSource As ICloneDim pObjectClassDesc As IObjectClassDescriptionDim pFeatClassDesc As IFeatureClassDescription创建 Annotation 的 FieldspObjectClassDesc = New AnnotationFeatureClassDescription pFeatClassDesc = pObjectClassDescpSource = pObjectClassDesc.RequiredFields pFields = pSource.Clone创建 An

6、notation 的 Geometry defintionpField = pFields.Field(pFields.FindField(pFeatClassDesc.ShapeFieldName)创建 Reference scaleDim pGraphicsLayerScale As IGraphicsLayerScalepGraphicsLayerScale = New GraphicsLayerScale pGraphicsLayerScale.ReferenceScale = pRefeScale pGraphicsLayerScale.Units = esriUnits.esriM

7、eters创建 SymbolcollectionDim pSymbolColl As ISymbolCollection2Dim pSymbolIdent As ISymbolIdentifier2 = New SymbolIdentifier pSymbolColl = New SymbolCollection pSymbolColl.AddSymbol(pTextSymbol, Default, pSymbolIdent)If pSymbolID = 1 Then pSymbolColl.AddSymbol(pTextSymbol, Default 1创建 Label 的相关属性Dim p

8、OverposterProperties As IOverposterPropertiesDim pAnnoPropsColl As IAnnotateLayerPropertiesCollectionDim pLabelEngineLP As ILabelEngineLayerProperties Dim pAnnotateLayerProps As IAnnotateLayerProperties pOverposterProperties = New BasicOverposterProperties pAnnoPropsColl = New AnnotateLayerPropertie

9、sCollection pLabelEngineLP = New LabelEngineLayerProperties pAnnotateLayerProps = pLabelEngineLP pAnnotateLayerProps.Class = pLabelEngineLP.Symbol = pTextSymbol pLabelEngineLP.SymbolID = pSymbolIdent.ID pAnnoPropsColl.Add(pLabelEngineLP)创建 Annotation layerDim pAnnoLayerFactory As IAnnotationLayerFac

10、tory Dim pAnnoLayer As IAnnotationLayer pAnnoLayerFactory = New FDOGraphicsLayerFactorypAnnoLayer = pAnnoLayerFactory.CreateAnnotationLayer(pWorkspace, Nothing, pAnnoFeatName, pField.GeometryDef, Nothing, pAnnoPropsColl, pGraphicsLayerScale, pSymbolColl, False, False, False, True, pOverposterPropert

11、ies, )Return CType(pAnnoLayer, IFeatureLayer).FeatureClassEnd Function 创建存于 Shapefile 中的 featureclasssDirsNameshapeTypehasMhasZpSRpFieldsPublic Shared Function CreateShapefile(ByVal sDir As String, ByVal sName As String, ByVal shapeType As esriGeometryType, _ByVal hasM As Boolean, ByVal hasZ As Bool

12、ean, ByVal pSR As ISpatialReference, ByVal pFields As IFields) As IFeatureClassTryDim shapeWorkspaceFactory As IWorkspaceFactory shapeWorkspaceFactory = New ShapefileWorkspaceFactory Dim shapeWorkspace As IFeatureWorkspaceshapeWorkspace = shapeWorkspaceFactory.OpenFromFile(sDir, 0) If (Not shapeWork

13、space Is Nothing) ThenIf pFields Is Nothing Then pFields = CreateBasicFields(shapeType, hasM, hasZ, pSR) Dim pFClass As IFeatureClasspFClass = shapeWorkspace.CreateFeatureClass(sName, pFields, Nothing, Nothing, esriFeatureType.esriFTSimple, Shape, Return pFClassEnd IfReturn NothingCatch ex As Except

14、ion MsgBox(ex.Message) Return NothingEnd Try 创建存于内存中的 FeatureclassfeatureClassNamePublic Shared Function GetSimpleFeatureClass(ByVal pFields As IFields, ByVal featureClassName As String) As IFeatureClassDim pSwf As IWorkspaceFactory = New InMemoryWorkspaceFactoryDim pWorkspaceName As IWorkspaceName

15、= pSwf.Create(MyWorkspace, Nothing, 0) Dim pFWS As IFeatureWorkspace = CType(pWorkspaceName, IName).Open()Dim pFC As IFeatureClass = pFWS.CreateFeatureClass(featureClassName, pFields, Nothing, Nothing, esriFeatureType.esriFTSimple, , Nothing)Return pFCCatch ex As Exception 创建存于 Access 中的 featureclas

16、spAccessPathpAccessNamePublic Function CreateAccessFeatureClass(ByVal pFields As IFields, ByVal pAccessPath As String, ByVal pAccessName As String, ByVal featureClassName As String) As IFeatureClassDim pSwf As IWorkspaceFactory = New ESRI.ArcGIS.DataSourcesGDB.AccessWorkspaceFactory Dim pWorkspaceNa

17、me As IWorkspaceName = pSwf.Create(pAccessPath, pAccessName, Nothing, 0) Dim pFWS As IFeatureWorkspace = CType(pWorkspaceName, IName).Open()pFields = CreateBasicFields(esriGeometryType.esriGeometryPoint, False, False, NewUnknownCoordinateSystem)AE+C#实现鹰眼功能(二)(带鼠标拖动)vs2005+AE9.2 实现,主要功能:鹰眼视图里面鼠标左键画红框

18、,右键拖动代码中主视图为 Mapcontrol1,鹰眼视图为 MapControl2。 主要利用了 Envelope 进行视图范围传递,从而控制视图同步等。 代码如下:几个变量声明 :/变量IMapDocument pMapDocument = new MapDocumentClass();IEnvelope pEn = new EnvelopeClass();object oFillobject = new object();private void CreateOverviewSymbol()IRgbColor iRgb = new RgbColorClass();iRgb.RGB = 2

19、55;ILineSymbol pOutline = new SimpleLineSymbolClass();pOutline.Color = iRgb;pOutline.Width = 2.3;ISimpleFillSymbol pSimpleFillSymbol = new SimpleFillSymbolClass();pSimpleFillSymbol.Outline = pOutline;pSimpleFillSymbol.Style = esriSimpleFillStyle.esriSFSHollow;oFillobject = pSimpleFillSymbol;控制拖动变量:p

20、rivate IMoveEnvelopeFeedback pSmallViewerEnvelope;/鹰眼小地图的红框,IMoveEnvelopeFeedback,用来移动 Envelope 的接口private IPoint pSmallViewerMouseDownPt;/拖动时鼠标落点private bool isTrackingSmallViewer = false; /标识是否在拖动static int moveCount = 0;/记录移动的个数,为移动过程中显示红框用。axMapControl1_OnMapReplaced 事件:axMapControl2.LoadMxFile(

21、axMapControl1.DocumentFilename); 两个视图加载数据可能存在鹰眼视图数据显示不完全(不知道是不是我电脑的毛病。),这 样加载可以控制数据的同步更新axMapControl1_OnExtentUpdated 事件:pEn = e.newEnvelope as IEnvelope;axMapControl2.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewForeground, null, null);axMapControl1_OnAfterDraw:esriViewDrawPhase viewDrawPhas

22、e = (esriViewDrawPhase)e.viewDrawPhase;if (viewDrawPhase = esriViewDrawPhase.esriViewForeground)axMapControl2.DrawShape(pEn, ref oFillobject);axMapControl2_OnMouseDown:if(e.button=1)/左键画红框pEn = axMapControl2.TrackRectangle();axMapControl1.Extent = pEn;if (e.button = 2)/右键拖动红框pSmallViewerMouseDownPt

23、= new PointClass();pSmallViewerMouseDownPt.PutCoords(e.mapX, e.mapY);axMapControl1.CenterAt(pSmallViewerMouseDownPt);isTrackingSmallViewer = true;if (pSmallViewerEnvelope = null)pSmallViewerEnvelope = new MoveEnvelopeFeedbackClass();pSmallViewerEnvelope.Display = axMapControl2.ActiveView.ScreenDispl

24、ay;pSmallViewerEnvelope.Symbol = (ISymbol)oFillobject;pSmallViewerEnvelope.Start(pEn, pSmallViewerMouseDownPt);axMapControl2_OnMouseMove:if (isTrackingSmallViewer)moveCount+;if (moveCount % 4 = 0)/因为一刷新,红框就没了。所以每移动 4 次就刷新一下,保持红框的连续性。axMapControl2.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewForeground, null, null);pSmallViewerEnvelope.MoveTo(pSmallViewerMouseDownPt);axMapControl2_OnMouseUp:if (pSmallViewerEnvelope != null)pEn = pSmallViewerEnvelope.St

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1