| 查看: 1017 | 回复: 10 | ||
| 当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖 | ||
zzahkj木虫 (著名写手)
龙
|
[求助]
Vb.net+ArcEngine生成的点状图层不显示?
|
|
|
我刚刚接触这个,望高手给个详细解答,谢谢!我的代码如下,为什么我生成的点状图层不显示呢? Dim pShpWksFact As IWorkspaceFactory = New ShapefileWorkspaceFactory() Dim pFeatWks As IFeatureWorkspace pFeatWks = CType(pShpWksFact.OpenFromFile(filePath, 0), IFeatureWorkspace) Const strShapeFieldName As String = "Shape" Dim pFields1 As IFields Dim pFieldsEdit1 As IFieldsEdit pFields1 = New FieldsClass() pFieldsEdit1 = CType(pFields1, IFieldsEdit) Dim pField1 As IField = New FieldClass() Dim pFieldEdit1 As IFieldEdit = New FieldClass() pFieldEdit1.Name_2 = strShapeFieldName pFieldEdit1.Type_2 = esriFieldType.esriFieldTypeGeometry pField1 = CType(pFieldEdit1, IField) Dim pGeomDef1 As IGeometryDef = New GeometryDefClass() Dim pGeomDefEdit1 As IGeometryDefEdit = New GeometryDefClass() pGeomDefEdit1 = CType(pGeomDef1, IGeometryDefEdit) pGeomDefEdit1.GeometryType_2 = esriGeometryType.esriGeometryPoint pGeomDefEdit1.SpatialReference_2 = Main.AxMapControl1.Map.SpatialReference pFieldEdit1.GeometryDef_2 = pGeomDef1 pFieldsEdit1.AddField(pField1) pFields1 = CType(pFieldsEdit1, IFields) Dim pFeatureClass1 As IFeatureClass pFeatureClass1 = pFeatWks.CreateFeatureClass("点", pFields1, Nothing, Nothing, esriFeatureType.esriFTSimple, strShapeFieldName, "" ) Dim pPointCol As IPointCollection = New MultipointClass() Dim sr As StreamReader = New StreamReader(My.Computer.FileSystem.CurrentDirectory & "\shu\dianceng.txt" ) Dim str As String = sr.ReadLine() Dim own As Long = 0 While str IsNot Nothing Dim strs() As String = Regex.Split(str, " " ) Dim x As Double = Convert.ToDouble(strs(0)) Dim y As Double = Convert.ToDouble(strs(1)) Dim pPoint As IPoint = New PointClass() pPoint.X = x pPoint.Y = y Dim missing As Object = Type.Missing pPointCol.AddPoint(pPoint, missing, missing) str = sr.ReadLine() End While Main.AxMapControl1.AddShapeFile(filePath, "点" ) [ Last edited by zzahkj on 2011-4-19 at 23:29 ] |
» 猜你喜欢
评审专家意见求助
已经有27人回复
理学267分,0709地质学,求调剂
已经有0人回复
地球物理学和空间物理学论文润色/翻译怎么收费?
已经有223人回复
» 本主题相关价值贴推荐,对您同样有帮助:
可显示上冲冲头行程的压片机
已经有8人回复
工作电极上有气体生成,可能是氯气和氧气,怎样鉴定有氧气生成嗯?
已经有14人回复
油酸+氯磺酸 反应生成 α-磺酸基油酸 的机理是什么样的?求稍微详细点的机理。
已经有3人回复
资源管理器无法显示硬盘内的文件和文件夹
已经有5人回复
关于优青的"生成草稿PDF"问题
已经有9人回复
酮和氨基反应生成希夫碱的反应
已经有3人回复
TiO2与Al2O3为什么没有生成钛酸铝?(耐火材料)
已经有14人回复
用氯钯酸等体积共浸渍制备Pd/CZ催化剂,焙烧后生成的催化剂却不是黑色的 为什么?
已经有16人回复
蒽醌上氨基的重氮化 生成氯盐
已经有7人回复
交流:晶体结构精修完了,生成完整的晶体结构报表指南
已经有18人回复
康宁推出面向高性能显示器的Corning Lotus™ Glass
已经有9人回复
Vb.net+ArcEngine生成点状图层的速度太慢了该怎么办?
已经有10人回复

yanggis
木虫 (著名写手)
小木虫GIS家族族长
- 应助: 16 (小学生)
- 贵宾: 0.034
- 金币: 1941.6
- 散金: 352
- 红花: 12
- 帖子: 1368
- 在线: 69.8小时
- 虫号: 74408
- 注册: 2005-06-12
- 性别: GG
- 专业: GIS/Spatial Analysis
10楼2011-04-22 21:24:50
zzahkj
木虫 (著名写手)
龙
- 应助: 42 (小学生)
- 金币: 1923.7
- 散金: 2554
- 红花: 30
- 帖子: 1517
- 在线: 465.1小时
- 虫号: 964751
- 注册: 2010-03-08
- 性别: GG
- 专业: 地理信息系统

2楼2011-04-21 09:52:01
xiangling1
金虫 (正式写手)
- 应助: 2 (幼儿园)
- 金币: 709.2
- 红花: 7
- 帖子: 339
- 在线: 80.9小时
- 虫号: 1234309
- 注册: 2011-03-15
- 性别: GG
- 专业: 地理信息系统

3楼2011-04-21 18:59:13
yanggis
木虫 (著名写手)
小木虫GIS家族族长
- 应助: 16 (小学生)
- 贵宾: 0.034
- 金币: 1941.6
- 散金: 352
- 红花: 12
- 帖子: 1368
- 在线: 69.8小时
- 虫号: 74408
- 注册: 2005-06-12
- 性别: GG
- 专业: GIS/Spatial Analysis
4楼2011-04-21 19:49:05













回复此楼