private static IPolygon FlattenPolygon(IPolygon polygon, FgfGeometryFactory factory)
        {
            ILinearRing extRing = FlattenLinearRing(polygon.ExteriorRing, factory);

            //Copy interior rings
            LinearRingCollection intRings = new LinearRingCollection();

            for (int j = 0; j < polygon.InteriorRingCount; j++)
            {
                ILinearRing ring = polygon.GetInteriorRing(j);
                intRings.Add(FlattenLinearRing(ring, factory));
            }

            IPolygon flatPolygon = factory.CreatePolygon(extRing, intRings);

            return(flatPolygon);
        }
Exemple #2
0
        void ExportPolygon(Polygon pol)
        {
            // Get the exterior ring
            ILinearRing xr = GetLinearRing(pol);

            // Pick up any islands
            LinearRingCollection irs = null;

            if (pol.HasAnyIslands)
            {
                irs = new LinearRingCollection();

                foreach (Island i in pol.Islands)
                {
                    ILinearRing ir = GetLinearRing(i);
                    irs.Add(ir);
                }
            }

            IGeometry g = m_Factory.CreatePolygon(xr, irs);

            ExportGeometry(g);
        }
        void ExportPolygon(Polygon pol)
        {
            // Get the exterior ring
            ILinearRing xr = GetLinearRing(pol);

            // Pick up any islands
            LinearRingCollection irs = null;
            if (pol.HasAnyIslands)
            {
                irs = new LinearRingCollection();

                foreach (Island i in pol.Islands)
                {
                    ILinearRing ir = GetLinearRing(i);
                    irs.Add(ir);
                }
            }

            IGeometry g = m_Factory.CreatePolygon(xr, irs);
            ExportGeometry(g);
        }
        private static IPolygon FlattenPolygon(IPolygon polygon, FgfGeometryFactory factory)
        {
            ILinearRing extRing = FlattenLinearRing(polygon.ExteriorRing, factory);

            //Copy interior rings
            LinearRingCollection intRings = new LinearRingCollection();
            for (int j = 0; j < polygon.InteriorRingCount; j++)
            {
                ILinearRing ring = polygon.GetInteriorRing(j);
                intRings.Add(FlattenLinearRing(ring, factory));
            }

            IPolygon flatPolygon = factory.CreatePolygon(extRing, intRings);
            return flatPolygon;
        }