[mapguide-commits] r4862 - in trunk/Tools/Maestro/MaestroAPI: . Generated

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed May 12 20:32:29 EDT 2010


Author: jng
Date: 2010-05-12 20:32:27 -0400 (Wed, 12 May 2010)
New Revision: 4862

Modified:
   trunk/Tools/Maestro/MaestroAPI/Generated/FeatureSource-1.0.0.cs
   trunk/Tools/Maestro/MaestroAPI/MgFeatureSetReader.cs
Log:
This submission has 2 fixes:
 - Fix #1356
 - Let MgFeatureSetReader default geometries to null if it turns out they are invalid.

Modified: trunk/Tools/Maestro/MaestroAPI/Generated/FeatureSource-1.0.0.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPI/Generated/FeatureSource-1.0.0.cs	2010-05-12 20:02:42 UTC (rev 4861)
+++ trunk/Tools/Maestro/MaestroAPI/Generated/FeatureSource-1.0.0.cs	2010-05-13 00:32:27 UTC (rev 4862)
@@ -222,7 +222,7 @@
 
 		public FeatureSourceDescription DescribeSource()
 		{
-			return DescribeSource(null);
+			return DescribeSource("");
 		}
 
 		public FeatureSourceDescription DescribeSource(string schema)

Modified: trunk/Tools/Maestro/MaestroAPI/MgFeatureSetReader.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPI/MgFeatureSetReader.cs	2010-05-12 20:02:42 UTC (rev 4861)
+++ trunk/Tools/Maestro/MaestroAPI/MgFeatureSetReader.cs	2010-05-13 00:32:27 UTC (rev 4862)
@@ -136,12 +136,22 @@
                             m_items[ordinal] = this.MgReader.ReadGeometry(ref rd, p);
                         else*/
                         {
-                            //No MapGuide dll, convert to WKT and then to internal representation
-                            System.IO.MemoryStream ms = Utility.MgStreamToNetStream(rd, rd.GetType().GetMethod("GetGeometry"), new string[] { p });
-                            OSGeo.MapGuide.MgAgfReaderWriter rdw = new OSGeo.MapGuide.MgAgfReaderWriter();
-                            OSGeo.MapGuide.MgGeometry g = rdw.Read(rd.GetGeometry(p));
-                            OSGeo.MapGuide.MgWktReaderWriter rdww = new OSGeo.MapGuide.MgWktReaderWriter();
-                            m_items[ordinal] = this.Reader.Read(rdww.Write(g));
+                            try
+                            {
+                                //No MapGuide dll, convert to WKT and then to internal representation
+                                System.IO.MemoryStream ms = Utility.MgStreamToNetStream(rd, rd.GetType().GetMethod("GetGeometry"), new string[] { p });
+                                OSGeo.MapGuide.MgAgfReaderWriter rdw = new OSGeo.MapGuide.MgAgfReaderWriter();
+                                OSGeo.MapGuide.MgGeometry g = rdw.Read(rd.GetGeometry(p));
+                                OSGeo.MapGuide.MgWktReaderWriter rdww = new OSGeo.MapGuide.MgWktReaderWriter();
+                                m_items[ordinal] = this.Reader.Read(rdww.Write(g));
+                            }
+                            catch (MgException ex)
+                            {
+                                //Just like the XmlFeatureSetReader, invalid geometry can bite us again
+                                m_nulls[ordinal] = true;
+                                m_items[ordinal] = ex.Message;
+                                ex.Dispose();
+                            }
                         }
                     }
                     else if (parent.Columns[ordinal].Type == Utility.UnmappedType)



More information about the mapguide-commits mailing list