[mapserver-commits] r7407 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Feb 27 09:13:44 EST 2008


Author: tomkralidis
Date: 2008-02-27 09:13:43 -0500 (Wed, 27 Feb 2008)
New Revision: 7407

Modified:
   trunk/mapserver/mapwcs.c
   trunk/mapserver/mapwms.c
Log:
Restore version as optional behaviour  (#2528)


Modified: trunk/mapserver/mapwcs.c
===================================================================
--- trunk/mapserver/mapwcs.c	2008-02-26 21:23:21 UTC (rev 7406)
+++ trunk/mapserver/mapwcs.c	2008-02-27 14:13:43 UTC (rev 7407)
@@ -1309,6 +1309,8 @@
   char *bandlist=NULL;
   char numbands[8]; /* should be large enough to hold the number of bands in the bandlist */
   coverageMetadataObj cm;
+  rectObj reqextent;
+  rectObj covextent;
 
   /* make sure all required parameters are available (at least the easy ones) */
   if(!params->crs) {
@@ -1613,6 +1615,33 @@
 
   map->projection.gt = map->gt;
 
+  // check for overlap
+
+  // get extent of bbox passed, and reproject
+  reqextent.minx = params->bbox.minx;
+  reqextent.miny = params->bbox.miny;
+  reqextent.maxx = params->bbox.maxx;
+  reqextent.maxy = params->bbox.maxy;
+
+  // reproject incoming bbox
+  msProjectRect(&map->projection, &lp->projection, &(reqextent));
+
+  // get extent of layer
+  covextent.minx = cm.extent.minx;
+  covextent.miny = cm.extent.miny;
+  covextent.maxx = cm.extent.maxx;
+  covextent.maxy = cm.extent.maxy;
+
+  if(msRectOverlap(&reqextent, &covextent) == MS_FALSE) {
+      msSetError(MS_WCSERR, "\nBBOX NATIVE    = %.15g,%.15g,%.15g,%.15g\nEXTENT NATIVE  = %.15g,%.15g,%.15g,%.15g\nBBOXLL         = %.15g,%.15g,%.15g,%.15g\nEXTENTLL       = %.15g,%.15g,%.15g,%.15g",
+                            "msWCSGetCoverage()",
+                            reqextent.minx, reqextent.miny, reqextent.maxx, reqextent.maxy,
+                            cm.extent.minx, cm.extent.miny, cm.extent.maxx, cm.extent.maxy,
+                            params->bbox.minx, params->bbox.miny, params->bbox.maxx, params->bbox.maxy,
+                            cm.llextent.minx, cm.llextent.miny, cm.llextent.maxx, cm.llextent.maxy);
+      return msWCSException(map, "NoApplicableCode", "bbox", params->version);
+  }
+
   /* check and make sure there is a format, and that it's valid (TODO: make sure in the layer metadata) */
   if(!params->format) {
     msSetError( MS_WCSERR,  "Missing required FORMAT parameter.", "msWCSGetCoverage()" );

Modified: trunk/mapserver/mapwms.c
===================================================================
--- trunk/mapserver/mapwms.c	2008-02-26 21:23:21 UTC (rev 7406)
+++ trunk/mapserver/mapwms.c	2008-02-27 14:13:43 UTC (rev 7407)
@@ -2941,8 +2941,8 @@
       return MS_DONE;  /* Not a WMS request */
 
   nVersion = msOWSParseVersionString(version);
-  if (nVersion == -1)
-    return msWMSException(map, OWS_1_1_1, NULL); /* Invalid format */
+  //if (nVersion == -1)
+  //  return msWMSException(map, OWS_1_1_1, NULL); /* Invalid format */
 
   /*
   ** GetCapbilities request needs the service parametr defined as WMS:



More information about the mapserver-commits mailing list