Rinler
路人甲
路人甲
  • 注册日期2004-09-20
  • 发帖数95
  • QQ
  • 铜币490枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1365回复:0

C#中创建FeatureClass问题

楼主#
更多 发布于:2006-04-17 12:22
<P>          代码如下,在CreateFeatureClass的时候总是弹出异常</P>
<P>           PropertySet ps = new PropertySet();<BR>            ps.SetProperty("SERVER", "douw");<BR>            ps.SetProperty("INSTANCE", "5151");<BR>            ps.SetProperty("User", "sde");<BR>            ps.SetProperty("PASSWORD", "sde");<BR>            ps.SetProperty("VERSION", "SDE.DEFAULT");<BR>            pSdeFact = new SdeWorkspaceFactory();<BR>            pwks = pSdeFact.Open(ps, 0);</P>
<P>            if (pwks != null)<BR>                MessageBox.Show("success");<BR>            if (pwks == null)<BR>                return;<BR>            IFeatureWorkspace pfwks = pwks as IFeatureWorkspace;<BR>            string name = "drawing1";<BR>            IFields fds = new ESRI.ArcGIS.Geodatabase.FieldsClass();<BR>            IField fd = new ESRI.ArcGIS.Geodatabase.FieldClass();<BR>            IFieldEdit fde = fd as IFieldEdit;<BR>            fde.Name_2 = "SHAPE";<BR>            fde.Type_2 = esriFieldType.esriFieldTypeGeometry;<BR>            IGeometryDef pGeomDef = new GeometryDefClass();<BR>            IGeometryDefEdit pGeomDefEdit = pGeomDef as IGeometryDefEdit;<BR>            pGeomDefEdit.GeometryType_2 = esriGeometryType.esriGeometryPolygon;<BR>            pGeomDefEdit.SpatialReference_2 = new UnknownCoordinateSystemClass();<BR>            fde.GeometryDef_2 = pGeomDef;<BR>            IFieldsEdit fdse = fds as IFieldsEdit;<BR>            fdse.FieldCount_2 = 1;<BR>            fdse.set_Field(0, fd);<BR>            IFeatureClass pfc;<BR>            pfc=pfwks.CreateFeatureClass(name, fds, null, null, esriFeatureType.esriFTSimple, "SHAPE", "");</P>
喜欢0 评分0
游客

返回顶部