[mapserver-commits] r13021 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Jan 31 12:49:09 EST 2012


Author: assefa
Date: 2012-01-31 09:49:09 -0800 (Tue, 31 Jan 2012)
New Revision: 13021

Modified:
   trunk/mapserver/mapogcsld.c
Log:
Correct problem with sld using multiple rules (#3929)

Modified: trunk/mapserver/mapogcsld.c
===================================================================
--- trunk/mapserver/mapogcsld.c	2012-01-28 12:29:44 UTC (rev 13020)
+++ trunk/mapserver/mapogcsld.c	2012-01-31 17:49:09 UTC (rev 13021)
@@ -887,6 +887,10 @@
 
                             if (psNode)
                             {
+				char *pszExpression = NULL;
+				char *pszEscapedExpression = NULL;
+				int i;
+
                                 /*preparse the filter for possible gml aliases set on the layer's metada:
                                   "gml_NA3DESC_alias" "alias_name" and filter could be  
                                 <ogc:PropertyName>alias_name</ogc:PropertyName> #3079*/
@@ -920,40 +924,28 @@
                                     }
                                     FLTPreParseFilterForAlias(psNode, psLayer->map, j, "G");
                                 }
-
   
-/* ==================================================================== */
-/*      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    */
-/*      be used to do queries on the layer.  Simple filers              */
-/*      (Comparision operators (PropertyIsEqualTo,                      */
-/*      PropertyNotEqualTo, ... combined or not with logical            */
-/*      operators such as AND/OR/NOT) will be used to set the FILTER    */
-/*      element of the layer.                                           */
-/* ==================================================================== */
-                                psLayer->layerinfo = (void *)psNode;
-                                /*
-                                szExpression = FLTGetCommonExpression(psNode, psLayer);
-                              if (FLTHasSpatialFilter(psNode)) 
-                                psLayer->layerinfo = (void *)psNode;
-                              else
+                                pszExpression = FLTGetCommonExpression(psNode, psLayer);
                                 FLTFreeFilterEncodingNode(psNode);
-                              psNode = NULL;
+				psNode = NULL;
 
-                                if (szExpression)
+                                if (pszExpression)
                                 {
+				    pszEscapedExpression = msStringEscape(pszExpression);
                                     nNewClasses = 
                                       nClassAfterFilter - nClassBeforeFilter;
                                     for (i=0; i<nNewClasses; i++)
                                     {
                                         msLoadExpressionString(&psLayer->
                                                              class[psLayer->numclasses-1-i]->
-                                                             expression, szExpression);
+                                                             expression, pszEscapedExpression);
                                     }
-                                    msFree(szExpression);
-                                    szExpression = NULL;
+                                    msFree(pszExpression);
+                                    pszExpression = NULL;
+				    msFree(pszEscapedExpression);
+                                    pszEscapedExpression = NULL;
                                 }
-                                */
+                                
                             }
                         }
                         nClassAfterRule = psLayer->numclasses;



More information about the mapserver-commits mailing list