频道栏目
IT货架 > > 正文
ArcSDE中创建要素类
网友分享于:Jun 12, 2018 11:59:08 PM    来源: IT货架   

IFields pFields = new FieldsClass();

IFieldsEdit pFieldsEdit = (IFieldsEdit)pFields;

IGeometryDef pGometryDef = new GeometryDefClass();

IGeometryDefEdit pGeometryDefEdit = (IGeometryDefEdit)pGometryDef;

{

pGeometryDefEdit.GeometryType_2 = esriGeometryType.esriGeometryPolygon;

     pGeometryDefEdit.HasM_2 = false;

     pGeometryDefEdit.HasZ_2 = true;

     pGeometryDefEdit.SpatialReference_2 = (ISpatialReference)axMap1.SpatialReference;

     pGeometryDefEdit.SpatialReference.SetZDomain(-1000, 60000);

}

IField pField = new FieldClass();

IFieldEdit pFieldEdit = (IFieldEdit)pField;

pFieldEdit.Name_2 = "SHAPE";

pFieldEdit.Type_2 = esriFieldType.esriFieldTypeGeometry;

pFieldEdit.GeometryDef_2 = pGometryDef;

pFieldsEdit.AddField(pField);

 

pField = new FieldClass();

pFieldEdit = (IFieldEdit)pField;

pFieldEdit.Name_2 = "GRIDNAME";

pFieldEdit.Type_2 = esriFieldType.esriFieldTypeString;

pFieldEdit.Length_2 = 40;

pFieldsEdit.AddField(pFieldEdit);

 

pField = new FieldClass();

pFieldEdit = (IFieldEdit)pField;

pFieldEdit.Name_2 = "SHAPE.AREA";

pFieldEdit.Type_2 = esriFieldType. esriFieldTypeDouble;

pFieldsEdit.AddField(pFieldEdit);

 

pField = new FieldClass();

pFieldEdit = (IFieldEdit)pField;

pFieldEdit.Name_2 = "SHAPE.LEN";

pFieldEdit.Type_2 = esriFieldType. esriFieldTypeDouble;

pFieldsEdit.AddField(pFieldEdit);

 

//创建网格图层

SDELINK.SdeOracle sdeOracle = Md.OracleSDELink;

 

IFeatureWorkspace pFeatureWorkspace = sdeOracle.getOracleFeatureWS();

IFeatureDataset pFeatureDataset= pFeatureWorkspace.OpenFeatureDataset(sDataSetName);

try

{

pFeatureDataset.CreateFeatureClass(sGridLayerName + "12", pFields, null, null, esriFeatureType.esriFTSimple, "shape", "");

}

catch (Exception ex2)

{

MessageBox.Show("创建失败!\r\n"+ex2.Message);

return;

}

广告服务联系QQ:1134687142 | 网站地图

版权所有: IT货架- 内容来自互联网,仅供用于技术学习,请遵循相关法律法规. 京ICP备11030978号-1