[mapserver-commits] r7257 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Sat Jan 12 00:13:13 EST 2008


Author: warmerdam
Date: 2008-01-12 00:13:13 -0500 (Sat, 12 Jan 2008)
New Revision: 7257

Modified:
   trunk/mapserver/mapwcs11.c
Log:
implement interpolation support for WCS 1.1

Modified: trunk/mapserver/mapwcs11.c
===================================================================
--- trunk/mapserver/mapwcs11.c	2008-01-12 04:54:04 UTC (rev 7256)
+++ trunk/mapserver/mapwcs11.c	2008-01-12 05:13:13 UTC (rev 7257)
@@ -28,6 +28,7 @@
  * DEALINGS IN THE SOFTWARE.
  *****************************************************************************/
 
+#include <assert.h>
 #include "mapserver.h"
 #include "maperror.h"
 #include "mapthread.h"
@@ -835,14 +836,15 @@
 /*                      msWCSGetCoverageBands11()                       */
 /*                                                                      */
 /*      We expect input to be of the form:                              */
-/*      RangeSubset=raster[bands[1]].                                   */
+/*      RangeSubset=raster:interpolation[bands[1]].                     */
 /*                                                                      */
-/*      We really need to support pulling interpolation out of this     */
-/*      as well.  eg.                                                   */
+/*      RangeSet=raster:[bands[1,2]]                                    */
+/*       or                                                             */
+/*      RangeSet=raster:bilinear                                        */
 /*                                                                      */
-/*      RangeSet=raster:bilinear[bands[1,2]]                            */
-/*       or                                                              */
-/*      RangeSet=raster:bilinear                                        */
+/*      This function tries to return a bandlist if found, and will     */
+/*      also push an INTERPOLATION keyword into the parameters list     */
+/*      if found in the RangeSubset.                                    */
 /************************************************************************/
 
 int msWCSGetCoverageBands11( mapObj *map, cgiRequestObj *request, 
@@ -882,9 +884,11 @@
 /* -------------------------------------------------------------------- */
 /*      Parse out the field identifier from the request and verify.     */
 /* -------------------------------------------------------------------- */
+    value = rangesubset + strlen(field_id);
+
     if( strlen(rangesubset) <= strlen(field_id)+1 
         || strncasecmp(rangesubset,field_id,strlen(field_id)) != 0 
-        || rangesubset[strlen(field_id)] != '[' )
+        || (*value != '[' && *value != ':') )
     {
         msSetError( MS_WCSERR, 
                     "RangeSubset field name malformed, expected '%s', got RangeSubset=%s",
@@ -893,14 +897,36 @@
         return msWCSException(map, params->version, NULL, NULL );
     }
 
+    free( field_id );
+    field_id = NULL;
+    
 /* -------------------------------------------------------------------- */
+/*      Parse out the interpolation, if found.                          */
+/* -------------------------------------------------------------------- */
+    if( *value == ':' )
+    {
+        assert( params->interpolation == NULL );
+        params->interpolation = strdup(value+1);
+        for( i = 0; params->interpolation[i] != '\0'; i++ )
+        {
+            if( params->interpolation[i] == '[' )
+            {
+                params->interpolation[i] = '\0';
+                break;
+            }
+        }
+
+        value += strlen(params->interpolation) + 1;
+    }
+
+/* -------------------------------------------------------------------- */
 /*      Parse out the axis name, and verify.                            */
 /* -------------------------------------------------------------------- */
-    value = rangesubset + strlen(field_id)+1;
+    if( *value != '[' )
+        return MS_SUCCESS;
 
-    free( field_id );
-    field_id = NULL;
-    
+    value++;
+
     if( strlen(value) <= strlen(axis_id)+1
         || strncasecmp(value,axis_id,strlen(axis_id)) != 0
         || value[strlen(axis_id)] != '[' )



More information about the mapserver-commits mailing list