Select to view content in your preferred language

How can I convert IGeometry object IFeatureClass?

3388
3
06-24-2012 01:40 PM
InsuHong1
Emerging 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
0 Kudos
3 Replies
EdgarBejarano
Deactivated User
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
Honored Contributor

How to cast a FeatureClass as IPolyline?  Thanks.

0 Kudos
ShaningYu
Honored Contributor

both Duncan Hornby and Edgar Bejarano are right.  Thanks.

0 Kudos