How can I convert IGeometry object IFeatureClass?

2599
3
06-24-2012 01:40 PM
InsuHong1
New Contributor
Hello,

How can I convert IGeometry object like IGeometry or IPolygon or IPolyline to IFeatureClass ?

I make IPointCollection from existing IFeatureClass, then do some job. After that I want convert result IPointCollection and IPolyline to IFeatureClass in the file geodatabase.

How can I do that?


Thank you.


Insu
Reply
0 Kudos
3 Replies
EdgarBejarano
Occasional Contributor
Hi,

You cannot convert a geometry object into a FeatureClass object.  Instead, you assign certain geometry objects (specifically Points, Polylines, Polygons and MultiPoints) to a Feature object and that Feature object is then added to the FeatureClass object.  Common ways of doing this is either using 1) the CreateFeature and Store methods or b) using insert cursors.  Both ways are discussed and demonstrated in the help document below:

Creating features
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000049v000000
ShaningYu
Frequent Contributor

How to cast a FeatureClass as IPolyline?  Thanks.

Reply
0 Kudos
ShaningYu
Frequent Contributor

both Duncan Hornby and Edgar Bejarano are right.  Thanks.

Reply
0 Kudos