欢迎来到冰点文库! | 帮助中心 分享价值,成长自我!
冰点文库
全部分类
  • 临时分类>
  • IT计算机>
  • 经管营销>
  • 医药卫生>
  • 自然科学>
  • 农林牧渔>
  • 人文社科>
  • 工程科技>
  • PPT模板>
  • 求职职场>
  • 解决方案>
  • 总结汇报>
  • ImageVerifierCode 换一换
    首页 冰点文库 > 资源分类 > DOCX文档下载
    分享到微信 分享到微博 分享到QQ空间

    ArcGIS接口详细说明之个人开发心得.docx

    • 资源ID:10685773       资源大小:48.46KB        全文页数:72页
    • 资源格式: DOCX        下载积分:3金币
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录
    二维码
    微信扫一扫登录
    下载资源需要3金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP,免费下载
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    ArcGIS接口详细说明之个人开发心得.docx

    1、ArcGIS接口详细说明之个人开发心得ArcGIS接口详细说明之个人开发心得万人迷先生217 /文 tj051181 /整理1. 关于IField接口(esriGeoDatabase)3楼2. 关于IFieldEdit接口(esriGeoDatabase)4楼3. 关于IFields接口(esriGeoDatabase)5楼4. 关于IPoint接口(esriGeometry)6楼5. 关于IPointArray接口(esriGeometry)7楼6. 关于IPointCollection接口(esriGeometry)8楼 7. 关于IPolyline接口(esriGeometry)9楼8.

    2、 关于IGeometry接口(esriGeometry)10楼9. 关于IArea接口(esriGeometry)11楼10. 关于IEnvelope接口(esriGeometry)12楼11. 关于IFeature接口(esriGeoDatabase)13楼12. 关于IRow接口(esriGeoDatabase)14楼13. 关于IFeatureClass接口(esriGeoDatabase)15楼14. 关于ITable接口(esriGeoDatabase)16楼15. 关于IFeatureCursor接口(esriGeoDatabase)17楼16. 关于IQueryFilter接口(

    3、esriGeoDatabase)18楼17. 关于IFeatureLayer接口(esriCarto)19楼18. 关于IFeatureSelection接口(esriCarto)20楼19. 关于IMap接口(esriCarto) 21楼20. 关于IPropertySet接口(esriSystem) 22楼21. 关于IFeatureWorkspace接口(esriGeoDatabase)23楼22. 关于IWorkspaceEdit接口(esriGeoDatabase)24楼23. 关于IWorkspaceFactory接口(esriGeoDatabase)25楼24. 关于ITopol

    4、ogicalOperator接口(esriGeometry)26楼25. 创建Buffer并选择里面的要素 27楼26. Merge要素Union要素28楼27. 怎样从Table中获取具体需求值的Row 42楼28. 怎样ZoomInCenter 43楼29. 怎样读取一个字段内的所有值 44楼30. 怎样编辑更改属性字段的值 45楼31. 怎样将MapControl中的Map复制到PageLayoutControl中 47楼32. 怎样判断是否出于编辑状态 63楼33. 怎样用点创建一个Polygon 64楼34. 怎样运用属性来计算总面积 65楼35. 关于属性域的一些心得 82楼36.

    5、 怎样实现翻折Flip方法 83楼37. 回答cumtbGIS关于ITopologicalOperator接口Clip方法的问题 87楼38. 回答机器猫FJJ关于ISpatialFilter接口方法的问题(完整函数) 91楼39. 回答网友韶华响当当关于更改符号的代码(完整函数) 100楼40. 回答网友韶华响当当关于显示属性的代码(完整函数) 101楼41. 回答gjw1015关于IFeature变量添加进List数组里的问题 112楼1. 关于IField接口(esriGeoDatabase)IField接口的第一个属性AliasName(只读,获得字段的别名)IField接口的第二个方

    6、法CheckValue(Value)(方法,对于指定的属性字段,基于字段类型判断参数值是否有效,有效,则返回True,否则返回False)例子代码:IFeatureClass pFC_SCP_PT;editPT = new FieldClass();editPT.Precision_2 = 8;editPT.Scale_2 = 3;editPT.Name_2 = ELEV1;editPT.Type_2 = esriFieldType.esriFieldTypeDouble;IField接口的其他属性均为只读属性,常用有Name(只读,获得字段的名称)例子代码:Dim pFields As IF

    7、ieldsDim pField As IFieldDim pGeoDef As IGeometryDefDim pDomain As IDomainDim i As LongSet pFields = pFeatClass.FieldsFor i = 0 To pFields.FieldCount - 1Set pField = pFields.Field(i)If pField.Type = esriFieldTypeGeometry Then Set pGeoDef = pField.GeometryDefElse Debug.Print pField.AliasName Debug.Pr

    8、int pField.DefaultValue Set pDomain = pField.Domain Debug.Print pField.Editable Debug.Print pField.IsNullable Debug.Print pField.Length Debug.Print pField.Name Debug.Print pField.Precision Debug.Print pField.Required Debug.Print pField.Scale Debug.Print pField.Type Debug.Print pField.VarTypeEnd IfNe

    9、xt2. 关于IFieldEdit接口(esriGeoDatabase)所有该接口的属性均为可读可写,经常用与对新建字段的设置,因为字段一旦被设置,其基本属性就不能被更改,所以就需要该接口类型的变量去转换,方法为:IFeatureClass pFC_SCP_PT;IFieldEdit editPT = new FieldClass();pFC_SCP_PT.AddField(IField)editPT);如果在vb中去编写代码,则赋值和获取均为同一属性,而在C#中,为了区分设置和获取,属性均有两个,类似于Name和Name_2,这样就可以区分了,普遍用设置的带有_2的那个属性。IFieldEd

    10、it接口的第一个属性Name (读写,设置或者获取该变量类型变量字段的名称)IFieldEdit接口的第二个属性Precision(读写,设置或者获取该变量类型变量字段的长度)IFieldEdit接口的第三个属性Scale(读写,设置或者获取该变量类型变量字段的精度)IFieldEdit接口的第四个属性Type(读写,设置或者获取该变量类型变量字段的类型)例子代码:IFeatureClass pFC_SCP_PT;editPT = new FieldClass();editPT.Precision_2 = 8;editPT.Scale_2 = 3;editPT.Name_2 = ELEV1;e

    11、ditPT.Type_2 = esriFieldType.esriFieldTypeDouble;3. 关于IFields接口(esriGeoDatabase)IFields接口的第一个属性Field(Index)(只读,以用于获取具体的字段,返回类型为IField)IFields接口的第二个属性FieldCount(只读,以用于获取属性的数量)利用上面两个接口并用索引去依次循环获得每一列的属性pField(Ifield接口)例子代码:Dim i As LongDim pField As IFieldFor i = 0 To (pFields.FieldCount - 1) Set pFiel

    12、d = pFields.Field(i) Debug.Print pField.Name & : & pField.TypeNext iIFields接口的第三个方法FindField(Name)(方法,输入想要查找的属性域字段的名称,如果有,则返回该属性域字段在此Fields的索引,没有则返回-1)例子代码:Dim i As IntegerDim pFields As IFieldsDim pField As IFieldGet FieldsSet pFields = pFeatClass.FieldsFind the field named average_incomei = pField

    13、s.FindField(average_income)Set the current fieldSet pField = pFields.Field(i)Delete field from featureclasspFeatClass.DeleteField pFieldIFields接口的第四个方法FindFieldByAliasName(Name)(方法,与第三个方法类似,此时输入的为该列属性字段的别名,此方法不经常用)例子代码:Dim i As IntegerDim pFields As IFieldsDim pField As IFieldGet FieldsSet pFields =

    14、 pFeatClass.Fields Find the field with the aliasname current populationi = pFields.FindFieldByAliasName(current population)Set the current fieldSet pField = pFields.Field(i)Delete field from featureclasspFeatClass.DeleteField pField4. 关于IPoint接口(esriGeometry)IPoint接口的第一个方法PutCoords(X,Y)(方法,设置该点的坐标)或

    15、者直接调用可以读写的属性X和Y,将坐标赋值给X和Y例子代码:Dim pPoint As IPointSet pPoint = New PointpPoint.PutCoords 100, 100IPoint接口的第二个方法QueryCoords(X,Y) (方法,得到该点的坐标)例子代码:Dim pPoint as IPointDim dX as Double, dY as DoublepPoint.QueryCoords dX, dYIPoint接口的第三个方法ConstrainAngle (constraintAngle, anchor, allowOpposite ) (方法,如果第三个

    16、参数allowOpposite为True,则将第二个参数anchor这个点作为一个原点,然后以第一个参数 constraintAngle为与x轴的角度,做一条直线,再将调用此参数的点向该直线做垂线并交于一个新点,并将调用此方法的点移动到该点)例子代码:Finds the closes point to line from (0,0) with angles defined by steps of pi/4 (Note all angles in radians) Dim pApoint As IPoint Dim pNpoint As IPoint Dim pi As Double Dim d

    17、Angle As Double Dim i As Long Set pApoint = New Point pi = 4 * Atn(1) dAngle = 0 pApoint.PutCoords 0, 0 Set pNpoint = New Point For i = 0 To 7 pNpoint.PutCoords 1, 0 dAngle = i * pi / 4 pNpoint.ConstrainAngle dAngle, pApoint, True MsgBox angle = & i & *pi/4 & vbCrLf & pNpoint.X & , & pNpoint.Y Next

    18、iIPoint接口的第四个方法ConstrainDistance (constraintRadius, anchor ) (方法,以第二个参数anchor这个点为圆心,然后以第一个参数constraintRadius为半径做一个圆,将调用此参数的点移动到该点与圆心做线段交于该圆的交点上)例子代码:Public Sub t_constraindistance() Dim pPoint As IPoint Dim pNPoint As IPoint Dim dRadius As Double Set pPoint = New Point pPoint.PutCoords 0, 0 Set pNPo

    19、int = New Point pNPoint.PutCoords 2, 2 dRadius = 1.4142135623731 pNPoint.ConstrainDistance dRadius, pPoint MsgBox Radius = & dRadius & x,y = & pNPoint.X & , & pNPoint.Y End Sub5. 关于IPointArray接口(esriGeometry)IPointArray接口的第一个方法Add(p) (方法,向该类型的数组变量添加Point)IPointArray接口的第二个属性Count (只读,获得该数组变量中Point的个数

    20、,返回Long类型变量)IPointArray接口的第三个属性Element(Index) (只读,获得该数组变量中位于参数Index索引位置的点Point,返回一个Point类型的变量)IPointArray接口的第四个方法Insert (Index, p ) (方法,向索引位置Index插入一个点Point)IPointArray接口的第五个方法Remove (Index )(方法,移除索引位置Index的点Point)IPointArray接口的第六个方法RemoveAll (方法,移除所有在此数组中的点)6. 关于IPointCollection接口(esriGeometry)IPoi

    21、ntCollection接口的第一个方法AddPoint(inPoint ,before ,after) (方法,向该类型的点集变量添加Point,第一个参数为添加的Point,第二个第三个参数为可选择的参数,默认添加进点集的末尾)IPointCollection接口的第二个属性Point(i) (只读,获得该点集变量中第i个位置的Point,返回IPoint类型变量,i从0计算开始)IPointCollection接口的第三个属性PointCount (只读,获得该点集变量中点的个数,返回Long类型变量,切记,如果一个PointCollection变量是由闭合的Geometry转换而来的话

    22、,那么点的个数比节点数多一个,因为是闭合的,所以首位节点是同一个点)7. 关于IPolyline接口(esriGeometry)IPolyline接口的第一个属性FromPoint与ToPoint(读写,设置或者读取该点的起始点和终止点,返回都是IPoint类型的变量)IPolyline接口的第二个方法QueryFromPoint (from )(方法,返回IPoint类型的变量到参数from)IPolyline接口的第三个方法QueryToPoint (to ) (方法,返回IPoint类型的变量到参数to)Public Sub t_ICurve_QueryPoints() Dim pID

    23、As New UID pID = esriEditor.editor Dim pEditor As IEditor Dim pApp As IApplication Set pApp = MxApplication Set pEditor = pApp.FindExtensionByCLSID(pID) If pEditor.SelectionCount 1 Then MsgBox select one Curve Exit Sub End If Dim pEnumFeat As IEnumFeature Dim pFeature As IFeature Set pEnumFeat = pEd

    24、itor.EditSelection Dim pCurve As ICurve Dim pPointFrom As IPoint Dim pPointTo As IPoint Set pPointFrom = New Point Set pPointTo = New Point Set pFeature = pEnumFeat.Next While Not pFeature Is Nothing If pFeature.Shape.GeometryType = esriGeometryPolyline Or _ esriGeometryPolyline Or esriGeometryLine

    25、Then Set pCurve = pFeature.Shape pCurve.QueryFromPoint pPointFrom pCurve.QueryToPoint pPointTo MsgBox +ICurve properties. & vbCrLf _ & Curve.QueryFromPoint (x,y) = & pPointFrom.X & , & pPointFrom.Y & vbCrLf _ & Curve.QueryToPoint (x,y) = & pPointTo.X & , & pPointTo.Y & vbCrLf End If Set pFeature = p

    26、EnumFeat.Next WendEnd SubIPolyline接口的第四个方法Generalize (maxAllowableOffset ) (方法,用道格拉斯普克发来简化polyline)IPolyline接口的第五个方法Weed (maxAllowableOffsetFactor ) (方法,和方法Generalize类似,均为简化polyline的方法,不同的是参数。)8. 关于IGeometry接口(esriGeometry)Public Sub t_IGeometry_polygon() Dim pID As New UID pID = esriEditor.editor D

    27、im pEditor As IEditor Dim pApp As IApplication Set pApp = Application Set pEditor = pApp.FindExtensionByCLSID(pID) If pEditor.SelectionCount 1 Then MsgBox select one polygon Exit Sub End If Dim pEnumFeat As IEnumFeature Dim pFeature As IFeature Set pEnumFeat = pEditor.EditSelection Dim pGeometry As

    28、IGeometry Set pFeature = pEnumFeat.Next While Not pFeature Is Nothing If pFeature.Shape.GeometryType = esriGeometryPolygon Then(通过pFeature.Shape获得Geometry) Set pGeometry = pFeature.Shape MsgBox +Polygon:IGeometry properties. & vbCrLf _ & Dimension = & pGeometry.Dimension & vbCrLf _ & Geometry type = & pGeometry.GeometryType & vbCrLf _ & Envelope = & pGeometry.Envelope.XMin & , & pGeometry.Envelope.YMin & , _ & pGeometry.Envelope.XMax & , & pGeometry.Envelope.YMin & vbCrLf _ & IsEmpty = & pGeometry.IsEmpty & vbCrLf _ & SpatialReference = &


    注意事项

    本文(ArcGIS接口详细说明之个人开发心得.docx)为本站会员主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2023 冰点文库 网站版权所有

    经营许可证编号:鄂ICP备19020893号-2


    收起
    展开