Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know how to convert existing line geometry to polygons with arcobjects as it works with the geoprocessing tool "feature to polygon"?

share|improve this question
A simple google search should give you examples of how to do this. – artwork21 Apr 28 '13 at 16:49
you can go through this: – Emi Apr 29 '13 at 9:03

The IFeatureConstruct interface has several different methods for doing this.

share|improve this answer

Here is a function I use:

    public static IPolyline6 PolygonToPolyline(IPolygon4 inPolygon) {

        ISegmentCollection outPolyline = new PolylineClass() as ISegmentCollection;

        try {

            outPolyline.AddSegmentCollection(inPolygon as ISegmentCollection);

            // Mirror spatial reference of input
            IPolyline6 outPolyline_ = outPolyline as IPolyline6;
            outPolyline_.SpatialReference = inPolygon.SpatialReference;

        } catch (Exception ex) {

            Program.Log.Error(string.Format("Util::PolygonToPolyline - {0}", ex.Message));


        return outPolyline as IPolyline6;

share|improve this answer
It sounds like the opposite is what is being requested. – blah238 Apr 29 '13 at 4:55
Thank you very much for this reply. But I think this is to transform polygon to polyline and I happen to want the opposite solution which is to transform lines to polygon. – Yvan May 3 '13 at 21:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.