IsEmpty() public method

If true, then this Geometry represents the empty point set, Ø, for the coordinate space.
public IsEmpty ( ) : bool
return bool
Ejemplo n.º 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());
		}
Ejemplo n.º 2
0
 /// <summary>
 /// Converts a MultiLineString to &lt;MultiLineString Text&gt;
 /// format, then Appends it to the writer.
 /// </summary>
 /// <param name="multiLineString">The MultiLineString to process.</param>
 /// <param name="writer">The output stream writer to Append to.</param>
 private static void AppendMultiLineStringText(MultiLineString multiLineString, StringWriter writer)
 {
     if (multiLineString == null || multiLineString.IsEmpty())
         writer.Write("EMPTY");
     else
     {
         writer.Write("(");
         for (int i = 0; i < multiLineString.LineStrings.Count; i++)
         {
             if (i > 0)
                 writer.Write(", ");
             AppendLineStringText(multiLineString[i], writer);
         }
         writer.Write(")");
     }
 }