[mapguide-commits] r7619 - trunk/MgDev/Server/src/Services/Feature

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Jun 13 23:08:57 PDT 2013


Author: christinebao
Date: 2013-06-13 23:08:57 -0700 (Thu, 13 Jun 2013)
New Revision: 7619

Modified:
   trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp
Log:
#2258: Serve WFS in alternate CS: SRSNAME not respected in getfeature, alternate SRS not available
Fix bug of parsing primary SRS. It's possible to contain other SRS so need to find "_PrimarySRS" first.

Modified: trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp	2013-06-14 06:00:09 UTC (rev 7618)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp	2013-06-14 06:08:57 UTC (rev 7619)
@@ -1844,16 +1844,21 @@
         //  <Name>_PrimarySRS</Name>
         //  <Value>EPSG:4326</Value>
         //</Property>
-        std::string begin("EPSG:");
-        std::size_t beginPos = resourceHeader.find(begin);
-        if (beginPos != std::string::npos)
+        std::string primary("<Name>_PrimarySRS</Name>");
+        std::size_t primaryPos = resourceHeader.find(primary);
+        if (primaryPos != std::string::npos)
         {
-            std::size_t endPos = resourceHeader.find("</Value>", beginPos);
-            if (endPos != std::string::npos)
+            std::string begin("<Value>EPSG:");
+            std::size_t beginPos = resourceHeader.find(begin, primaryPos);
+            if (beginPos != std::string::npos)
             {
-                std::string primarySRS = resourceHeader.substr(beginPos+begin.length(), endPos-beginPos-begin.length());
-                int epsgCode = atoi(primarySRS.c_str());
-                wkt = fact.ConvertEpsgCodeToWkt(epsgCode);
+                std::size_t endPos = resourceHeader.find("</Value>", beginPos);
+                if (endPos != std::string::npos)
+                {
+                    std::string primarySRS = resourceHeader.substr(beginPos+begin.length(), endPos-beginPos-begin.length());
+                    int epsgCode = atoi(primarySRS.c_str());
+                    wkt = fact.ConvertEpsgCodeToWkt(epsgCode);
+                }
             }
         }
     }



More information about the mapguide-commits mailing list