Union of buffer polygons - ConstructUnion

Discussion created by JulianaCR_Woolpert on Nov 29, 2012
Latest reply on Nov 29, 2012 by JulianaCR_Woolpert
Hi all. I initially posted this under the ArcGIS Server General forum, but realized it would fit more in here.

I'm having issues when trying to combine multiple buffer polygon geometries into one while using the ConstructUnion method from the ITopologicalOperator2 class.
It does not give me an error, but the polygon I get, is not exactly the union of all other polygons.
I've attached an image of the polygon result geometry.


Here is the code I'm using.

for (int geomIdx = 0; geomIdx < bufferGeometryCollection.GeometryCount; geomIdx++)

                    IGeometry currentGeom = bufferGeometryCollection.Geometry[geomIdx];
                    ISpatialReference geomSR = currentGeom.SpatialReference;

                    //if geometry is a point, convert to polygon
                    if (currentGeom.GeometryType == esriGeometryType.esriGeometryPoint)
                        IEnvelope pEnv = currentGeom.Envelope;
                        pEnv.Expand(0.0001, 0.0001, false);
                        IPolygon pPoly = new PolygonClass();
                        ISegmentCollection pSegCol = (ISegmentCollection)pPoly;
                        currentGeom = (IGeometry)pSegCol;

                    //Create an ITopologicalOperator object based upon a geometry
                    ITopologicalOperator topoOp = (ITopologicalOperator)currentGeom;
                    //'Generate the buffer
                    IPolygon bufferPolygon = (IPolygon)topoOp.Buffer(bufferDistance);

                    topoOp2 = (ITopologicalOperator2)bufferPolygon;
                    topoOp2.IsKnownSimple_2 = false;

                    geometryCollection.AddGeometry(topoOp2 as IGeometry, ref missing, ref missing);


                IPolygon poly = new PolygonClass();
                poly.SpatialReference = _outputSpatialReference;

                ITopologicalOperator2 topologicalOperator;
                topologicalOperator = poly as ITopologicalOperator2;

                topologicalOperator.ConstructUnion(geometryCollection as IEnumGeometry);

                return topologicalOperator as IPolygon;

I'm following ESRI samples, and this is the result, which does not work.
I've tried without the simplify and it gives me the same result.
I've also tried to create the polygon by adding the rings separately with the same result.

What am I missing?