コード例 #1
0
        public void MultiLinestring()
        {
            MultiLineString mls = new MultiLineString();

            Assert.IsTrue(mls.IsEmpty());
            mls.LineStrings.Add(new LineString());
            Assert.IsTrue(mls.IsEmpty());
            mls.LineStrings[0].Vertices.Add(new Point(45, 68));
            mls.LineStrings[0].Vertices.Add(new Point(82, 44));
            mls.LineStrings.Add(CreateLineString());
            foreach (LineString ls in mls)
            {
                Assert.IsFalse(ls.IsEmpty());
            }
            Assert.IsFalse(mls.IsEmpty());
            foreach (LineString ls in mls)
            {
                Assert.IsFalse(ls.IsClosed);
            }
            Assert.IsFalse(mls.IsClosed);
            //Close linestrings
            foreach (LineString ls in mls)
            {
                ls.Vertices.Add(ls.StartPoint.Clone());
            }
            foreach (LineString ls in mls)
            {
                Assert.IsTrue(ls.IsClosed);
            }
            Assert.IsTrue(mls.IsClosed);
            Assert.AreEqual(new BoundingBox(1, 2, 930, 123), mls.GetBoundingBox());
        }
コード例 #2
0
 public void GetBoundingBox()
 {
     Assert.Equal(new BoundingBox(16, 48, 18, 50), TestMultiLineString.GetBoundingBox());
 }