[mapserver-commits] r7430 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Tue Mar 4 15:27:23 EST 2008
Author: warmerdam
Date: 2008-03-04 15:27:22 -0500 (Tue, 04 Mar 2008)
New Revision: 7430
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/mapwcs.c
Log:
Throw an exception if the WCS request does not overlap layer (#2503)
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2008-03-04 02:20:27 UTC (rev 7429)
+++ trunk/mapserver/HISTORY.TXT 2008-03-04 20:27:22 UTC (rev 7430)
@@ -13,6 +13,8 @@
Current Version (5.1-dev, SVN trunk):
-------------------------------------
+- Throw an exception if the WCS request does not overlap layer (#2503)
+
- Acquire TLOCK_PROJ for pj_transform() calls (#2533).
- Fixed problem with large imagemaps generating no output (#2526)
Modified: trunk/mapserver/mapwcs.c
===================================================================
--- trunk/mapserver/mapwcs.c 2008-03-04 02:20:27 UTC (rev 7429)
+++ trunk/mapserver/mapwcs.c 2008-03-04 20:27:22 UTC (rev 7430)
@@ -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 = map->extent.minx;
+ reqextent.miny = map->extent.miny;
+ reqextent.maxx = map->extent.maxx;
+ reqextent.maxy = map->extent.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()" );
More information about the mapserver-commits
mailing list