/// <summary>
 /// 在内存中创建要素类
 /// </summary>
 /// <returns></returns>
 public IFeatureClass MemoryFeatureClass()
 {
     AccessGeoData accData = new AccessGeoData();
     IFeatureWorkspace pFeaWorkspace = accData.FeatureWorkspace();
     IFields fields = new FieldsClass();
     IFieldsEdit fedits = (IFieldsEdit)fields;
     IField objfield = new FieldClass();
     IFieldEdit objEdit = (IFieldEdit)objfield;
     objEdit.Name_2 = "OBJECTID";
     objEdit.Type_2 = esriFieldType.esriFieldTypeOID;
     fedits.AddField(objEdit);
     IField Spfield = new FieldClass();
     IFieldEdit fEdit = (IFieldEdit)Spfield;
     IGeometryDef pGeoDef = new GeometryDefClass();
     IGeometryDefEdit pGeoDefEdit = (IGeometryDefEdit)pGeoDef;
     pGeoDefEdit.GeometryType_2 = esriGeometryType.esriGeometryPoint;
     pGeoDefEdit.SpatialReference_2 = spatialRef;
     fEdit.Name_2 = "Shape";
     fEdit.Type_2 = esriFieldType.esriFieldTypeGeometry;
     fEdit.GeometryDef_2 = pGeoDef;
     fedits.AddField(Spfield);
     IField fieldZ = new FieldClass();
     IFieldEdit EditZ = (IFieldEdit)fieldZ;
     EditZ.Name_2 = "Z";
     EditZ.Type_2 = esriFieldType.esriFieldTypeDouble;
     fedits.AddField(EditZ);
     IFeatureClass pFeaClass = pFeaWorkspace.CreateFeatureClass("FeaturePoints", fields, null, null, esriFeatureType.esriFTSimple, "Shape", "");
     return pFeaClass;
 }
 /// <summary>
 /// 在地理数据库中创建要素类
 /// </summary>
 /// <param name="workspacePath">工作空间路径</param>
 /// <param name="feaclassName">所创建要素类名称</param>
 /// <param name="GeometeyType">枚举要素类类型: esriGeimetryType(</param>
 /// <param name="gcsType">地理空间坐标系类型,格式如: (int)esriSRGeoCS3Type.esriSRGeoCS_Xian1980</param>
 /// <returns></returns>
 public IFeatureClass CreateFeatureClass(string workspacePath, string feaclassName, esriGeometryType GeometeyType, int gcsType)
 {
     AccessGeoData accData = new AccessGeoData();
     IFeatureWorkspace pFeaWorkspace = accData.OpenFeatureWorkspace(workspacePath);
     spatialRef = spatialRefFactory.CreateGeographicCoordinateSystem(gcsType);
     //字段编辑:包括ObjectID 与 Shape
     IFields fields = new FieldsClass();
     IFieldsEdit fedits = (IFieldsEdit)fields;
     //构建唯一标识符字段
     IField objfield = new FieldClass();
     IFieldEdit objEdit = (IFieldEdit)objfield;
     objEdit.Name_2 = "OBJECTID";
     objEdit.Type_2 = esriFieldType.esriFieldTypeOID;
     fedits.AddField(objEdit);
     //构建shape
     IField Spfield = new FieldClass();
     IFieldEdit fEdit = (IFieldEdit)Spfield;
     IGeometryDef pGeoDef = new GeometryDefClass();
     IGeometryDefEdit pGeoDefEdit = (IGeometryDefEdit)pGeoDef;
     pGeoDefEdit.GeometryType_2 = GeometeyType;
     pGeoDefEdit.SpatialReference_2 = spatialRef;
     fEdit.Name_2 = "Shape";
     fEdit.Type_2 = esriFieldType.esriFieldTypeGeometry;
     fEdit.GeometryDef_2 = pGeoDef;
     fedits.AddField(Spfield);
     //附加一个可编辑字段,存放属性值
     IField fieldZ = new FieldClass();
     IFieldEdit EditZ = (IFieldEdit)fieldZ;
     EditZ.Name_2 = "Value";
     EditZ.Type_2 = esriFieldType.esriFieldTypeDouble;
     fedits.AddField(EditZ);
     //若有其他需求,在此处添加字段,参加Value字段添加方式
     IFeatureClass pFeaClass = pFeaWorkspace.CreateFeatureClass(feaclassName, fields, null, null, esriFeatureType.esriFTSimple, "Shape", "");
     return pFeaClass;
 }
        public IFeatureClass ReadFeatureClass(string workspacePath, string feaclassName)
        {
            AccessGeoData accData = new AccessGeoData();
            IFeatureWorkspace pFeaWorkspace = accData.OpenFeatureWorkspace(workspacePath);
            //若有其他需求,在此处添加字段,参加Value字段添加方式
            IFeatureClass pFeaClass = null;
            try
            {
                pFeaClass = pFeaWorkspace.OpenFeatureClass(feaclassName);
            }
            catch (Exception)
            {

                //throw;
            }

            return pFeaClass;
        }