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

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Oct 19 12:34:45 EDT 2010


Author: brucedechant
Date: 2010-10-19 09:34:45 -0700 (Tue, 19 Oct 2010)
New Revision: 5296

Modified:
   trunk/MgDev/Common/CoordinateSystem/CoordSys.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysEllipsoid.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPath.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformDef.cpp
Log:
Fix for trac ticket 1468 - Unset the EPSG code when cloning a Coordinate System entity
http://trac.osgeo.org/mapguide/ticket/1468

Notes:
- Unset the EPSG code when cloning

Submitted on behalf of Andr?\195?\169 Barth


Modified: trunk/MgDev/Common/CoordinateSystem/CoordSys.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSys.cpp	2010-10-19 16:32:00 UTC (rev 5295)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSys.cpp	2010-10-19 16:34:45 UTC (rev 5296)
@@ -1650,6 +1650,10 @@
     pNew->m_csprm = m_csprm;
     pNew->m_bEncrypted = m_bEncrypted;
 
+    //unset the EPSG code; we've an editable instance now where we neither can guarantee the correctness of the EPSG code
+    //nor is it currently supported by CsMap's NameMapper anyway
+    pNew->m_csprm.csdef.epsgNbr = 0;
+
     if (m_pDatum)
     {
         Ptr<MgCoordinateSystemDatum> pDtClone=m_pDatum->CreateClone();

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp	2010-10-19 16:32:00 UTC (rev 5295)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp	2010-10-19 16:34:45 UTC (rev 5296)
@@ -450,7 +450,14 @@
     //
     pNew->m_datum = m_datum;
     pNew->m_DtDef = m_DtDef;
+
+    //unset the EPSG code; we've an editable instance now where we neither can guarantee the correctness of the EPSG code
+    //nor is it currently supported by CsMap's NameMapper anyway
+    pNew->m_DtDef.epsgNbr = 0;
+
     pNew->m_ElDef = m_ElDef;
+    //don't unset the EPSG code of the ellipsoid this datum refers to
+
     pNew->m_bEncrypted = m_bEncrypted;
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemDatum.CreateClone")

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysEllipsoid.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysEllipsoid.cpp	2010-10-19 16:32:00 UTC (rev 5295)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysEllipsoid.cpp	2010-10-19 16:34:45 UTC (rev 5296)
@@ -306,6 +306,10 @@
     //data members are added to CCoordinateSystemEllipsoid, this will
     //need to be updated.
     pDef->m_def = m_def;
+
+    //unset the EPSG code; we've an editable instance now where we neither can guarantee the correctness of the EPSG code
+    //nor is it currently supported by CsMap's NameMapper anyway
+    pDef->m_def.epsgNbr = 0;
     pDef->m_bEncrypted = m_bEncrypted;
 
     MG_CATCH_AND_THROW(L"MgCoordinateSystemEllipsoid.CreateClone")

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPath.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPath.cpp	2010-10-19 16:32:00 UTC (rev 5295)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticPath.cpp	2010-10-19 16:34:45 UTC (rev 5296)
@@ -82,6 +82,10 @@
 
     Ptr<CCoordinateSystemGeodeticPath> clonedPath = new CCoordinateSystemGeodeticPath(this->catalog);
     clonedPath->Initialize(*this->pathDefinition);
+
+    //unset the EPSG code; we've an editable instance now where we neither can guarantee the correctness of the EPSG code
+    //nor is it currently supported by CsMap's NameMapper anyway
+    clonedPath->pathDefinition->epsgCode = 0;
     clonedPath->pathDefinition->protect = 0; //unset the protection flag; otherwise the caller wouldn't be able to change any values
 
     return clonedPath.Detach();

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformDef.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformDef.cpp	2010-10-19 16:32:00 UTC (rev 5295)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformDef.cpp	2010-10-19 16:34:45 UTC (rev 5296)
@@ -194,6 +194,11 @@
 
     Ptr<CCoordinateSystemGeodeticTransformDef> clonedTransformDef = new CCoordinateSystemGeodeticTransformDef(this->catalog.p);
     clonedTransformDef->Initialize(*this->transformDefinition);
+
+    //unset the EPSG code; we've an editable instance now where we neither can guarantee the correctness of the EPSG code
+    //nor is it currently supported by CsMap's NameMapper anyway
+    clonedTransformDef->transformDefinition->epsgCode = 0;
+    clonedTransformDef->transformDefinition->epsgVariation = 0;
     clonedTransformDef->transformDefinition->protect = 0; //unset the protection flag; otherwise the caller wouldn't be able to change any values
 
     return clonedTransformDef.Detach();



More information about the mapguide-commits mailing list