[mapserver-commits] r11845 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Jun 21 23:18:49 EDT 2011


Author: assefa
Date: 2011-06-21 20:18:49 -0700 (Tue, 21 Jun 2011)
New Revision: 11845

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapogcfiltercommon.c
   trunk/mapserver/mapogcsld.c
Log:
Correct SLD with spatial filters bbox and intersects (#3929)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2011-06-21 19:59:33 UTC (rev 11844)
+++ trunk/mapserver/HISTORY.TXT	2011-06-22 03:18:49 UTC (rev 11845)
@@ -14,6 +14,7 @@
 
 Current Version (SVN trunk, 6.1-dev, future 6.2): 
 ------------------------------------------------- 
+- Correct SLD with spatial filters bbox and intersects (#3929)
 
 - Applied patch for ticket (symbol writing issues) (#3589)
 

Modified: trunk/mapserver/mapogcfiltercommon.c
===================================================================
--- trunk/mapserver/mapogcfiltercommon.c	2011-06-21 19:59:33 UTC (rev 11844)
+++ trunk/mapserver/mapogcfiltercommon.c	2011-06-22 03:18:49 UTC (rev 11845)
@@ -566,21 +566,26 @@
             else if (lp->map->projection.numargs > 0)
               msProjectShape(&lp->map->projection, &lp->projection, psTmpShape);
         }
+/* ==================================================================== */
+/*      use within for bbox. Not Disjoint does not work.                */
+/* ==================================================================== */
         if (bBBoxQuery)
-          sprintf(szBuffer, "%s", " (NOT ([shape] ");
+          sprintf(szBuffer, "%s", " ([shape] ");
+        //sprintf(szBuffer, "%s", " (NOT ([shape] ");
         else
           sprintf(szBuffer, "%s", " ([shape] ");
 
         pszExpression = msStringConcatenate(pszExpression, szBuffer);
 
 
-        if (strcasecmp(psNode->pszValue, "intersect") == 0)
-          pszTmp = msStrdup(psNode->pszValue);
+        if (strncasecmp(psNode->pszValue, "intersect", 9) == 0)
+          pszTmp = msStrdup("intersects");
         else
           pszTmp = msStrdup(psNode->pszValue);
         msStringToLower(pszTmp);
         if (bBBoxQuery)
-          sprintf(szBuffer, " %s ", "disjoint");
+          sprintf(szBuffer, " %s ", "intersects");
+        //sprintf(szBuffer, " %s ", "disjoint");
         else
            sprintf(szBuffer, " %s ", pszTmp);
 
@@ -602,7 +607,7 @@
     sprintf(szBuffer, "%s", ")");
     pszExpression = msStringConcatenate(pszExpression, szBuffer);
 
-     if (bBBoxQuery)
+    if (0)//bBBoxQuery)
      {
           sprintf(szBuffer, "%s", ")");
           pszExpression = msStringConcatenate(pszExpression, szBuffer);

Modified: trunk/mapserver/mapogcsld.c
===================================================================
--- trunk/mapserver/mapogcsld.c	2011-06-21 19:59:33 UTC (rev 11844)
+++ trunk/mapserver/mapogcsld.c	2011-06-22 03:18:49 UTC (rev 11845)
@@ -400,6 +400,16 @@
                         nStatus = 
                             FLTApplyFilterToLayer(psNode, map,  
                                                   GET_LAYER(map, i)->index);
+/* -------------------------------------------------------------------- */
+/*      nothing found is a valid, do not exit.                          */
+/* -------------------------------------------------------------------- */
+                        if (nStatus !=  MS_SUCCESS)
+                        {
+                            errorObj   *ms_error;
+                            ms_error = msGetErrorObj();
+                            if(ms_error->code == MS_NOTFOUND)
+                              nStatus =  MS_SUCCESS;
+                        }
 
 
                         GET_LAYER(map, i)->status = nLayerStatus;
@@ -760,8 +770,7 @@
     CPLXMLNode *psElseFilter = NULL, *psFilter=NULL;
     CPLXMLNode *psTmpNode = NULL;
     FilterEncodingNode *psNode = NULL;
-    char *szExpression = NULL;
-    int i=0, nNewClasses=0, nClassBeforeFilter=0, nClassAfterFilter=0;
+    int nNewClasses=0, nClassBeforeFilter=0, nClassAfterFilter=0;
     int nClassAfterRule=0, nClassBeforeRule=0;
     char *pszTmpFilter = NULL;
     layerObj *psCurrentLayer = NULL;
@@ -876,8 +885,7 @@
                                     FLTPreParseFilterForAlias(psNode, psLayer->map, j, "G");
                                 }
 
-                                szExpression = FLTGetCommonExpression(psNode, psLayer);
-
+  
 /* ==================================================================== */
 /*      If the filter has a spatial filter or is a simple, we keep      */
 /*      the node. This node will be parsed when applying the SLD and    */
@@ -887,11 +895,14 @@
 /*      operators such as AND/OR/NOT) will be used to set the FILTER    */
 /*      element of the layer.                                           */
 /* ==================================================================== */
-                                if (FLTHasSpatialFilter(psNode)) 
-                                  psLayer->layerinfo = (void *)psNode;
-                                else
-                                  FLTFreeFilterEncodingNode(psNode);
-                                psNode = NULL;
+                                psLayer->layerinfo = (void *)psNode;
+                                /*
+                                szExpression = FLTGetCommonExpression(psNode, psLayer);
+                              if (FLTHasSpatialFilter(psNode)) 
+                                psLayer->layerinfo = (void *)psNode;
+                              else
+                                FLTFreeFilterEncodingNode(psNode);
+                              psNode = NULL;
 
                                 if (szExpression)
                                 {
@@ -906,6 +917,7 @@
                                     msFree(szExpression);
                                     szExpression = NULL;
                                 }
+                                */
                             }
                         }
                         nClassAfterRule = psLayer->numclasses;



More information about the mapserver-commits mailing list