Exemple #1
0
        public void Execute(IPlatformFactory factory, ITestLogger logger)
        {
            MgGeometryFactory      gf          = new MgGeometryFactory();
            MgCoordinate           pt1         = gf.CreateCoordinateXY(0, 0);
            MgCoordinate           pt2         = gf.CreateCoordinateXY(0, 10);
            MgCoordinate           pt3         = gf.CreateCoordinateXY(10, 10);
            MgCoordinate           pt4         = gf.CreateCoordinateXY(10, 0);
            MgCoordinateCollection coordinates = new MgCoordinateCollection();

            coordinates.Add(pt1);
            coordinates.Add(pt2);
            coordinates.Add(pt3);
            coordinates.Add(pt4);
            MgLinearRing linearRing = gf.CreateLinearRing(coordinates);
            MgPolygon    polygon    = gf.CreatePolygon(linearRing, null);

            Assert.AreEqual(linearRing.ToString(), polygon.ExteriorRing.ToString());
            Assert.AreEqual(0, polygon.InteriorRingCount);
            Assert.AreEqual(MgGeometryType.Polygon, polygon.GeometryType);
            Assert.AreEqual(2, polygon.Dimension);
        }