[mapguide-commits] r6175 - trunk/MgDev/Common/CoordinateSystem

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Oct 15 15:34:44 EDT 2011


Author: baertelchen
Date: 2011-10-15 12:34:44 -0700 (Sat, 15 Oct 2011)
New Revision: 6175

Modified:
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPath.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformDef.cpp
Log:
Fix http://trac.osgeo.org/mapguide/ticket/1831.

The ::IsValid() checks performed when deserializing an MgCoordinateSystemGeodeticTransformationDef or MgCoordinateSystemGeodeticPath object from a CSMAP struct were too restrictive. Both did always require the datums to exist in the current dictionaries.

With that inconsistent behavior it was impossible to create a new datum and an accompanying transformation or path on the fly, because the code would always insist on the datum to be available. For exactly that reason, all other MgCoordinateSystem definition types like cs, datums and ellipsoids never required any "child object" to exist when (de-)serializing. 

In both classes, I've removed the cs_*CHK_* flags that were passed to the respective CSMAP chk() methods. CSMAP's "check" methods are now called with simply 0 instead - in which case CSMAP performs some basic validation only but doesn't require the datums to exist already in the dictionaries.

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPath.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPath.cpp	2011-10-14 09:39:55 UTC (rev 6174)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPath.cpp	2011-10-15 19:34:44 UTC (rev 6175)
@@ -120,8 +120,8 @@
     if (NULL == this->pathDefinition)
         return false;
 
-	int errorCount = CS_gpchk (this->pathDefinition,(cs_GPCHK_DATUM | cs_GPCHK_XFORM),NULL,0);
-	
+    int errorCount = CS_gpchk (this->pathDefinition, 0, NULL, 0);
+
     return (errorCount == 0);
 }
 

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformDef.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformDef.cpp	2011-10-14 09:39:55 UTC (rev 6174)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformDef.cpp	2011-10-15 19:34:44 UTC (rev 6175)
@@ -341,7 +341,7 @@
         return false;
 
     CriticalClass.Enter();
-    int nNumErrs = CS_gxchk(this->transformDefinition,cs_GXCHK_DATUM, NULL, 0);
+    int nNumErrs = CS_gxchk(this->transformDefinition, 0, NULL, 0);
     CriticalClass.Leave();
 
     return (0 == nNumErrs);



More information about the mapguide-commits mailing list