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

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Dec 2 15:00:06 EST 2010


Author: baertelchen
Date: 2010-12-02 12:00:05 -0800 (Thu, 02 Dec 2010)
New Revision: 5432

Modified:
   trunk/MgDev/Common/CoordinateSystem/CoordSys.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp
   trunk/MgDev/Common/CoordinateSystem/MentorDictionary.h
Log:
Follow up submission for trac ticket 1538.

When reading all available definitions from the dictionaries, all code names have been takes "as-is". Unfortunately, the CsMap's coordsys.dsc contains some coordinate systems that reference datums via lowercased strings - but the corresponding datums in datums.dsc contain uppercased versions of these strings. For example, "Afgooye.LL" references "Afgooye" as its datum but that has the key "AFGOOYE" in the dictionary. Changed the code in MentorDictionary.h so that the std::maps are filled with lower cased strings only and also the lookup into these std::maps is done with lowercased versions of the key strings (changes in CoordSys.cpp and CoordSysDatum.cpp).

Reviewed by Hugues.

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSys.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSys.cpp	2010-12-02 09:59:15 UTC (rev 5431)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSys.cpp	2010-12-02 20:00:05 UTC (rev 5432)
@@ -137,7 +137,7 @@
     if (bGeodetic)
     {
         wchar_t* pwszDtName = Convert_Ascii_To_Wide(csdef.dat_knm);
-        STRING sDtName(pwszDtName);
+        STRING sDtName(::ToLower(pwszDtName));
 
         delete[] pwszDtName;
         pwszDtName = NULL;
@@ -181,7 +181,7 @@
     else
     {
         wchar_t* pwszElName = Convert_Ascii_To_Wide(csdef.elp_knm);
-        STRING sElName(pwszElName);
+        STRING sElName(::ToLower(pwszElName));
         delete[] pwszElName;
         pwszElName = NULL;
 

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp	2010-12-02 09:59:15 UTC (rev 5431)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp	2010-12-02 20:00:05 UTC (rev 5432)
@@ -154,7 +154,7 @@
     {
         throw new MgOutOfMemoryException(L"MgCoordinateSystemDatum.InitFromCatalog", __LINE__, __WFILE__, NULL, L"", NULL);
     }
-    STRING sElName(pwszElName);
+    STRING sElName(::ToLower(pwszElName));
     delete[] pwszElName;
     pwszElName = NULL;
 

Modified: trunk/MgDev/Common/CoordinateSystem/MentorDictionary.h
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/MentorDictionary.h	2010-12-02 09:59:15 UTC (rev 5431)
+++ trunk/MgDev/Common/CoordinateSystem/MentorDictionary.h	2010-12-02 20:00:05 UTC (rev 5432)
@@ -216,7 +216,8 @@
         {
             Ptr<T> entry = static_cast<T*>(entryList->GetItem(entryIndex));
             STRING entryCode = CALL_MEMBER_FN(entry, GetCode)();
-            definitions.insert(pair<STRING, Ptr<MgDisposable> >(entryCode, entry));
+            STRING entryCodeLc = ::ToLower(entryCode);
+            definitions.insert(pair<STRING, Ptr<MgDisposable> >(entryCodeLc, entry));
         }
     }
 



More information about the mapguide-commits mailing list