Exemple #1
0
 /// <summary>
 /// Converts a MultiPolygon to &lt;MultiPolygon Text&gt; format, then Appends to it to the writer.
 /// </summary>
 /// <param name="multiPolygon">The MultiPolygon to process.</param>
 /// <param name="level"></param>
 /// <param name="writer">The output stream to Append to.</param>
 protected void AppendMultiPolygonText(MultiPolygon multiPolygon, int level, StringWriter writer)
 {
     if (multiPolygon.IsEmpty())
     {
         writer.Write("EMPTY");
     }
     else
     {
         int  level2   = level;
         bool doIndent = false;
         writer.Write("(");
         for (int i = 0; i < multiPolygon.GetNumGeometries(); i++)
         {
             if (i > 0)
             {
                 writer.Write(", ");
                 level2   = level + 1;
                 doIndent = true;
             }
             //AppendPolygonText((Polygon) multiPolygon.GetGeometryN(i), level2, doIndent, writer);
             AppendPolygonText((Polygon)multiPolygon.GetGeometryN(i), level2, doIndent, writer);
         }
         writer.Write(")");
     }
 }
        public void test_Constructor()
        {
            //create a geomerty collection
            MultiPolygon mp1 = CreateMP1();
            MultiPolygon mp2 = CreateMP2();

            Assertion.AssertEquals("Constructor-1: ", false, mp1.IsEmpty());
            Assertion.AssertEquals("Constructor-2: ", false, mp2.IsEmpty());
        }
Exemple #3
0
 /// <summary>
 /// Converts a MultiPolygon to &lt;MultiPolygon Text&gt; format, then Appends to it to the writer.
 /// </summary>
 /// <param name="multiPolygon">The MultiPolygon to process.</param>
 /// <param name="writer">The output stream to Append to.</param>
 private static void AppendMultiPolygonText(MultiPolygon multiPolygon, StringWriter writer)
 {
     if (multiPolygon == null || multiPolygon.IsEmpty())
     {
         writer.Write("EMPTY");
     }
     else
     {
         writer.Write("(");
         for (int i = 0; i < multiPolygon.Polygons.Count; i++)
         {
             if (i > 0)
             {
                 writer.Write(", ");
             }
             AppendPolygonText(multiPolygon[i], writer);
         }
         writer.Write(")");
     }
 }
Exemple #4
0
 /// <summary>
 /// Converts a MultiPolygon to &lt;MultiPolygon Text&gt; format, then Appends to it to the writer.
 /// </summary>
 /// <param name="multiPolygon">The MultiPolygon to process.</param>
 /// <param name="writer">The output stream to Append to.</param>
 protected void AppendMultiPolygonText(MultiPolygon multiPolygon, TextWriter writer)
 {
     if (multiPolygon.IsEmpty())
     {
         writer.Write("EMPTY");
     }
     else
     {
         //writer.Write("M");
         for (int i = 0; i < multiPolygon.GetNumGeometries(); i++)
         {
             /*if (i > 0 && (i<multiPolygon.GetNumGeometries()-1) )
              * {
              *      writer.Write(", ");
              * }*/
             AppendPolygonText((Polygon)multiPolygon.GetGeometryN(i), writer);
         }
         //writer.Write("Z");
     }
 }
Exemple #5
0
 /// <summary>
 ///     Converts a MultiPolygon to &lt;MultiPolygon Text&gt; format, then Appends to it to the writer.
 /// </summary>
 /// <param name="multiPolygon">The MultiPolygon to process.</param>
 /// <param name="writer">The output stream to Append to.</param>
 private static void AppendMultiPolygonText(MultiPolygon multiPolygon, StringWriter writer)
 {
     if ((multiPolygon == null) || multiPolygon.IsEmpty())
         writer.Write("EMPTY");
     else
     {
         writer.Write("(");
         for (var i = 0; i < multiPolygon.Polygons.Count; i++)
         {
             if (i > 0)
                 writer.Write(", ");
             AppendPolygonText(multiPolygon[i], writer);
         }
         writer.Write(")");
     }
 }