[mapguide-commits] r5077 - in trunk/MgDev: Server/src/Wms Web/src/HttpHandler

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Aug 7 07:53:15 EDT 2010


Author: liuar
Date: 2010-08-07 11:53:15 +0000 (Sat, 07 Aug 2010)
New Revision: 5077

Modified:
   trunk/MgDev/Server/src/Wms/1.3.0.xml.awd
   trunk/MgDev/Server/src/Wms/OgcWmsService.config.awd
   trunk/MgDev/Web/src/HttpHandler/OgcWmsServer.cpp
   trunk/MgDev/Web/src/HttpHandler/WmsMapUtil.cpp
Log:
Ticket #1392 OGC WMS 1.3.0 Support
In order to pass the OGC certification, the implementation of MapGuide web map service should be updated.


Modified: trunk/MgDev/Server/src/Wms/1.3.0.xml.awd
===================================================================
--- trunk/MgDev/Server/src/Wms/1.3.0.xml.awd	2010-08-07 10:04:47 UTC (rev 5076)
+++ trunk/MgDev/Server/src/Wms/1.3.0.xml.awd	2010-08-07 11:53:15 UTC (rev 5077)
@@ -396,8 +396,11 @@
   Exception format - XML
 
 -->
-<Response request="Exception" content-type="XML">
-<ServiceExceptionReport version="&TemplateVersion;">
+<Response request="Exception" content-type="text/xml">
+<ServiceExceptionReport version="&TemplateVersion;" 
+   xmlns="http://www.opengis.net/ogc"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd">
  <ServiceException code="&Exception.Type;">
   &Exception.message;
  </ServiceException>

Modified: trunk/MgDev/Server/src/Wms/OgcWmsService.config.awd
===================================================================
--- trunk/MgDev/Server/src/Wms/OgcWmsService.config.awd	2010-08-07 10:04:47 UTC (rev 5076)
+++ trunk/MgDev/Server/src/Wms/OgcWmsService.config.awd	2010-08-07 11:53:15 UTC (rev 5077)
@@ -242,7 +242,7 @@
        finding the WKT for EPSG:21781 in the CS library.
   -->
   <translate from="EPSG:21781">PROJCS["CH1903.LV03/01",GEOGCS["LLCH1903",DATUM["CH-1903",SPHEROID["BESSEL",6377397.155,299.15281535],TOWGS84[660.0770,13.5510,369.3440,0.804816,0.577692,0.952236,5.66000000]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Swiss_Oblique_Cylindrical"],PARAMETER["false_easting",600000.000],PARAMETER["false_northing",200000.000],PARAMETER["latitude_of_origin",46.95240555555556],PARAMETER["central_meridian",7.43958333333333],UNIT["Meter",1.00000000000000]]</translate>
-
+  <translate from="CRS:84">GEOGCS["LL84",DATUM["WGS84",SPHEROID["WGS84",6378137.000,298.25722293]],PRIMEM["Greenwich",0],UNIT["Degree",0.01745329251994]]</translate>
  </Define>
 
 </Definitions>

Modified: trunk/MgDev/Web/src/HttpHandler/OgcWmsServer.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/OgcWmsServer.cpp	2010-08-07 10:04:47 UTC (rev 5076)
+++ trunk/MgDev/Web/src/HttpHandler/OgcWmsServer.cpp	2010-08-07 11:53:15 UTC (rev 5077)
@@ -86,6 +86,7 @@
 CPSZ kpszExceptionMessageInvalidImageFormat   = _("The request uses an unsupported image format. (Found FORMAT=&Request.format;)"); // Localize
 CPSZ kpszExceptionMessageMissingImageFormat   = _("The request must contain a FORMAT parameter to specify the required image format."); // Localize
 CPSZ kpszExceptionMessageMissingInfoFormat    = _("The request must contain an INFO_FORMAT parameter to specify the format of feature information (MIME type)."); // Localize
+CPSZ kpszExceptionMessageInvalidInfoFormat    = _("The request uses an unsupported info format. (Found INFO_FORMAT=&Request.info_format;)"); // Localize
 CPSZ kpszExceptionMessageMissingVersion       = _("The request must contain a VERSION parameter to specify the WMS version."); // Localize
 // END LOCALIZATION
 
@@ -654,6 +655,31 @@
                                                          kpszExceptionMessageMissingInfoFormat));
                 bValid = false;
             }
+
+            CPSZ pszSupportedFormats = this->Definition(_("Formats.GetFeatureInfo")); //NOXLATE
+            bool bSupport = false;
+
+            if(pszSupportedFormats != NULL)
+            {
+                MgXmlParser SupportedFormats(pszSupportedFormats);
+                
+                while(SupportedFormats.Next())
+                {
+                    MgXmlNode& node = SupportedFormats.Current();
+                    if(node.Contents() == pszFormat)
+                    {
+                        bSupport = true;
+                        break;
+                    }
+                }
+            }
+
+            if(!bSupport)
+            {
+                ServiceExceptionReportResponse(MgOgcWmsException(MgOgcWmsException::kpszInvalidFormat,
+                                                         kpszExceptionMessageInvalidInfoFormat));
+                bValid = false;
+            }
         }
     }
     if(bValid)

Modified: trunk/MgDev/Web/src/HttpHandler/WmsMapUtil.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/WmsMapUtil.cpp	2010-08-07 10:04:47 UTC (rev 5076)
+++ trunk/MgDev/Web/src/HttpHandler/WmsMapUtil.cpp	2010-08-07 11:53:15 UTC (rev 5077)
@@ -222,7 +222,7 @@
 
 void MgWmsMapUtil::ProcessBoundingBoxAxes(STRING sSrs,REFSTRING bbox)
 {
-    if(sSrs.empty() || bbox.empty())
+    if(sSrs.empty() || bbox.empty() ||sSrs == _("CRS:84")) //Workaround
         return;
 
     Ptr<MgCoordinateSystemFactory> factory = new MgCoordinateSystemFactory();



More information about the mapguide-commits mailing list