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

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Nov 29 14:46:07 EST 2010


Author: NormOlsen
Date: 2010-11-29 11:46:07 -0800 (Mon, 29 Nov 2010)
New Revision: 5413

Modified:
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPath.cpp
Log:
Trac #1542.  Add call to CS_gpchk() to determine validity of a Geodetic Path definition. 

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPath.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPath.cpp	2010-11-29 05:49:48 UTC (rev 5412)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPath.cpp	2010-11-29 19:46:07 UTC (rev 5413)
@@ -120,41 +120,9 @@
     if (NULL == this->pathDefinition)
         return false;
 
-    //make sure, the names for this path and the datums are set
-    size_t pathNameLength = strlen(this->pathDefinition->pathName);
-    if (0 == pathNameLength || pathNameLength >= sizeof(this->pathDefinition->pathName))
-        return false;
-
-    size_t srcDatumNameLength = strlen(this->pathDefinition->srcDatum);
-    if (0 == srcDatumNameLength || srcDatumNameLength >= sizeof(this->pathDefinition->srcDatum))
-        return false;
-
-    size_t trgDatumNameLength = strlen(this->pathDefinition->trgDatum);
-    if (0 == trgDatumNameLength || trgDatumNameLength >= sizeof(this->pathDefinition->trgDatum))
-        return false;
-
-    //check, whether there are only valid path elements according to MgCoordinateSystemGeodeticPathElement::IsValid()
-    Ptr<MgDisposableCollection> pathElements = this->GetPathElements();
-    INT32 pathElementCount = pathElements->GetCount();
-    if (0 == pathElementCount || pathElementCount > csPATH_MAXXFRM)
-        return false;
-
-    if (pathElementCount != this->pathDefinition->elementCount)
-        return false;
-
-    for(INT32 i = 0; i < pathElementCount; i++)
-    {
-        Ptr<MgDisposable> mgDisposable = pathElements->GetItem(i);
-        MgCoordinateSystemGeodeticPathElement* pathElement = dynamic_cast<MgCoordinateSystemGeodeticPathElement*>(mgDisposable.p);
-        if (NULL == pathElement)
-            throw new MgInvalidArgumentException(L"CCoordinateSystemGeodeticPath.IsValid", __LINE__, __WFILE__, NULL, L"", NULL);
-
-        if (!pathElement->IsValid())
-            return false;
-    }
-
-    //TODO: add gp_gpchk in cs_map.h
-    return true; //for any other stuff, like [accuracy] etc. rely on cs_gpcheck
+	int errorCount = CS_gpchk (this->pathDefinition,(cs_GPCHK_DATUM | cs_GPCHK_XFORM),NULL,0);
+	
+    return (errorCount == 0);
 }
 
 //all getters and setters



More information about the mapguide-commits mailing list