[mapguide-commits] r5025 - trunk/MgDev/Web/src/HttpHandler

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sun Jul 11 22:23:54 EDT 2010


Author: liuar
Date: 2010-07-12 02:23:54 +0000 (Mon, 12 Jul 2010)
New Revision: 5025

Modified:
   trunk/MgDev/Web/src/HttpHandler/OgcWmsServer.cpp
   trunk/MgDev/Web/src/HttpHandler/WmsLayerDefinitions.cpp
Log:
Ticket #1392 OGC WMS 1.3.0 Support

In this submission:

1. The default response format of 1.0.0 is text/xml for GetCapabilities request 
and the default format of 1.1.0 and 1.1.1 is application/vnd.ogc.wms_xml. From 
1.3.0 on, OGC decides to change the format back to text/xml. Therefore, I adapt 
the implementation of MgOgcWmsServer::GetCapabilitiesResponse() for this update.

2. The term SRS(Spatial Reference System) is deprecated from WMS 1.3.0 and CRS
(Coordinate Reference System) is suggested to be used. Most part of code has 
been update previously, and I made a supplement in 
MgWmsLayerDefinitions::LayerSupportsReferenceSystem().

Modified: trunk/MgDev/Web/src/HttpHandler/OgcWmsServer.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/OgcWmsServer.cpp	2010-07-12 01:36:50 UTC (rev 5024)
+++ trunk/MgDev/Web/src/HttpHandler/OgcWmsServer.cpp	2010-07-12 02:23:54 UTC (rev 5025)
@@ -263,13 +263,13 @@
     // or we were unable to honor the requested format. So we try the
     // default format instead.
 
-    // Default mime type for version 1.1.0 and higher
-    CPSZ pszDefaultFormat = kpszMimeTypeApplicationWmsXml;
+    // Default mime type for version 1.0.0, 1.3.0 and higher
+    CPSZ pszDefaultFormat = kpszMimeTypeXml;
     CPSZ pszVersion = NegotiatedVersion();
-    if(pszVersion != NULL && SZ_EQI(pszVersion, _("1.0.0")))
+    if(pszVersion != NULL && (SZ_EQI(pszVersion, _("1.1.0")) || SZ_EQI(pszVersion, _("1.1.1"))))
     {
-        // Default mime type for 1.0.0 requests
-        pszDefaultFormat = kpszMimeTypeXml;
+        // Default mime type for 1.1.0 and 1.1.1 requests
+        pszDefaultFormat = kpszMimeTypeApplicationWmsXml;
     }
 
     // Make a request for the default format

Modified: trunk/MgDev/Web/src/HttpHandler/WmsLayerDefinitions.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/WmsLayerDefinitions.cpp	2010-07-12 01:36:50 UTC (rev 5024)
+++ trunk/MgDev/Web/src/HttpHandler/WmsLayerDefinitions.cpp	2010-07-12 02:23:54 UTC (rev 5025)
@@ -268,6 +268,11 @@
     sSRS += pszSRS;
     sSRS += _("\"");
 
+    // WMS 1.3.0 spec changed "SRS" to "CRS"
+    STRING sCRS(_("CRS=\""));
+    sCRS += pszSRS;
+    sCRS += _("\"");
+
     // Gotta rewind things, in case somebody's already called us.
     Reset();
     while(Next()) {
@@ -286,7 +291,7 @@
                 CPSZ pszBounds = oLayerDefinitions[_("Layer.Bounds")];
                 if(pszBounds != NULL) {
                     STRING sBounds(pszBounds);
-                    if(sBounds.find(sSRS) != STRING::npos)
+                    if(sBounds.find(sSRS) != STRING::npos || sBounds.find(sCRS) != STRING::npos)
                         return true;
                 }
             }



More information about the mapguide-commits mailing list