Geodatabase-Create a feature class.

Source: Internet
Author: User

In net, you will encounter properties that end with "_2", which are writable.

The following code creates a new Point feature class under existing workspaces:

1 //for example, [email protected] "G:\doc\gis\1.400\data\pdb.mdb", featureclassname= "Newf"2  Public voidCreatefeatureclass (stringPersonaldbpath,stringfeatureclassname) {3             //Create a point type.4             //spatial reference.5ESRI. ArcGIS.Geometry.ISpatialReference sref =Mapctrl_main. ActiveView.FocusMap.SpatialReference;6 7ESRI. ArcGIS.Geodatabase.IGeometryDef Geodef =NewESRI. ArcGIS.Geodatabase.GeometryDefClass ();8ESRI. ArcGIS.Geodatabase.IGeometryDefEdit Geoedit =(ESRI. ArcGIS.Geodatabase.IGeometryDefEdit) Geodef;9geoedit.geometrytype_2 =ESRI. ArcGIS.Geometry.esriGeometryType.esriGeometryPoint;Tengeoedit.spatialreference_2 =Sref; One  A             //The field set. -ESRI. ArcGIS.Geodatabase.IFields fields =NewESRI. ArcGIS.Geodatabase.FieldsClass (); -ESRI. ArcGIS.Geodatabase.IFieldsEdit Fieldsedit =(ESRI. ArcGIS.Geodatabase.IFieldsEdit) fields; the  -             //add fields individually. -  -ESRI. ArcGIS.Geodatabase.IField field =NewESRI. ArcGIS.Geodatabase.FieldClass (); +ESRI. ArcGIS.Geodatabase.IFieldEdit Fieldedit =(ESRI. ArcGIS.Geodatabase.IFieldEdit) field; -fieldedit.name_2 ="SHAPE"; +fieldedit.type_2 =ESRI. ArcGIS.Geodatabase.esriFieldType.esriFieldTypeGeometry; AFieldedit.geometrydef_2 =Geodef; at Fieldsedit.addfield (field); -  -field =NewESRI. ArcGIS.Geodatabase.FieldClass (); -Fieldedit =(ESRI. ArcGIS.Geodatabase.IFieldEdit) field; -fieldedit.name_2 ="Stcd"; -fieldedit.type_2 =ESRI. ArcGIS.Geodatabase.esriFieldType.esriFieldTypeString; in Fieldsedit.addfield (field); -  tofield =NewESRI. ArcGIS.Geodatabase.FieldClass (); +Fieldedit =(ESRI. ArcGIS.Geodatabase.IFieldEdit) field; -fieldedit.name_2 ="SLM10"; thefieldedit.type_2 =ESRI. ArcGIS.Geodatabase.esriFieldType.esriFieldTypeString; * Fieldsedit.addfield (field); $ Panax Notoginsengfield =NewESRI. ArcGIS.Geodatabase.FieldClass (); -Fieldedit =(ESRI. ArcGIS.Geodatabase.IFieldEdit) field; thefieldedit.name_2 ="SLM20"; +fieldedit.type_2 =ESRI. ArcGIS.Geodatabase.esriFieldType.esriFieldTypeString; A Fieldsedit.addfield (field); the  +field =NewESRI. ArcGIS.Geodatabase.FieldClass (); -Fieldedit =(ESRI. ArcGIS.Geodatabase.IFieldEdit) field; $fieldedit.name_2 ="SLM40"; $fieldedit.type_2 =ESRI. ArcGIS.Geodatabase.esriFieldType.esriFieldTypeString; - Fieldsedit.addfield (field); -  the             //created from an existing workspace. -ESRI. ArcGIS.Geodatabase.IWorkspaceFactory WSF =NewESRI. ArcGIS.DataSourcesGDB.AccessWorkspaceFactory ();WuyiESRI. ArcGIS.Geodatabase.IFeatureWorkspace FWS = (ESRI. ArcGIS.Geodatabase.IFeatureWorkspace) wsf. Openfromfile (Personaldbpath,0); theESRI. ArcGIS.Geodatabase.IFeatureClass FC = FWS. Createfeatureclass (Featureclassname, fields,NULL,NULL, ESRI. ArcGIS.Geodatabase.esriFeatureType.esriFTSimple,"SHAPE",NULL); -}

Geodatabase-Create a feature class.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.