[mapguide-commits] r7351 - in trunk/Tools/Maestro: MaestroAPITests OSGeo.MapGuide.MaestroAPI/Internal

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Feb 13 03:00:30 PST 2013


Author: jng
Date: 2013-02-13 03:00:29 -0800 (Wed, 13 Feb 2013)
New Revision: 7351

Modified:
   trunk/Tools/Maestro/MaestroAPITests/MiscTests.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Internal/FixedWKTReader.cs
Log:
#2216: Add XYZM support for FixedWKTReader. Patch by morkl. Unit test by me.

Modified: trunk/Tools/Maestro/MaestroAPITests/MiscTests.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/MiscTests.cs	2013-02-13 09:51:24 UTC (rev 7350)
+++ trunk/Tools/Maestro/MaestroAPITests/MiscTests.cs	2013-02-13 11:00:29 UTC (rev 7351)
@@ -38,5 +38,14 @@
             reader.Read(wkt1);
             reader.Read(wkt2);
         }
+
+        [Test]
+        public void TestParseXyzmWkt()
+        {
+            var wkt1 = "POINT XYZM (1 2 3 4)";
+
+            var reader = new FixedWKTReader();
+            reader.Read(wkt1);
+        }
     }
 }

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Internal/FixedWKTReader.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Internal/FixedWKTReader.cs	2013-02-13 09:51:24 UTC (rev 7350)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Internal/FixedWKTReader.cs	2013-02-13 11:00:29 UTC (rev 7351)
@@ -152,6 +152,8 @@
             coord.Y = GetNextNumber(tokens);
             if (IsNumberNext(tokens))
                 coord.Z = GetNextNumber(tokens);
+            if (IsNumberNext(tokens))
+                coord.M = GetNextNumber(tokens);
 
             if (skipExtraParenthesis &&
                 extraParenthesisFound &&
@@ -238,6 +240,10 @@
             {
                 nextWord = GetNextWord(tokens);
             }
+            else if (nextWord.Equals("XYZM")) //NOXLATE
+            {
+                nextWord = GetNextWord(tokens);
+            }
             else if (nextWord.Equals("ZM")) //NOXLATE
             {
                 nextWord = GetNextWord(tokens);



More information about the mapguide-commits mailing list