Пример #1
0
        private void btnUnion_Click(object sender, EventArgs e)
        {
            ITopologicalOperator2D topoOpera = geo1 as ITopologicalOperator2D;

            if (topoOpera == null)
            {
                return;
            }
            IGeometry geo = topoOpera.Union2D(geo2);

            draw(geo);
        }
Пример #2
0
        private void btnUnion_Click(object sender, EventArgs e)
        {
            IGeometry p = polygonList[0];

            for (int i = 0; i < polygonList.Count - 1; i++)
            {
                IPolygon piplus = polygonList[i + 1];
                ITopologicalOperator2D topoOpera = p as ITopologicalOperator2D;
                if (topoOpera == null)
                {
                    continue;
                }
                p = topoOpera.Union2D(piplus);
            }
            if (p.GeometryType == gviGeometryType.gviGeometryMultiPolygon)
            {
                _multiPolygon = p as IMultiPolygon;
            }
            else if (p.GeometryType == gviGeometryType.gviGeometryPolygon)
            {
                _multiPolygon.AddGeometry(p);
            }
        }