[mapserver-commits] r9249 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Aug 12 13:45:17 EDT 2009


Author: assefa
Date: 2009-08-12 13:45:16 -0400 (Wed, 12 Aug 2009)
New Revision: 9249

Modified:
   trunk/mapserver/mapogcsld.c
Log:
SLD filters with property aliases do not work #3079

Modified: trunk/mapserver/mapogcsld.c
===================================================================
--- trunk/mapserver/mapogcsld.c	2009-08-12 15:02:24 UTC (rev 9248)
+++ trunk/mapserver/mapogcsld.c	2009-08-12 17:45:16 UTC (rev 9249)
@@ -311,6 +311,9 @@
 
                         nLayerStatus =  GET_LAYER(map, i)->status;
                         GET_LAYER(map, i)->status = MS_ON;
+
+                        
+
                         FLTApplyFilterToLayer(psNode, map,  
                                               GET_LAYER(map, i)->index,
                                               !FLTIsSimpleFilter(psNode));
@@ -602,6 +605,9 @@
     int i=0, nNewClasses=0, nClassBeforeFilter=0, nClassAfterFilter=0;
     int nClassAfterRule=0, nClassBeforeRule=0;
     char *pszTmpFilter = NULL;
+    layerObj *psCurrentLayer = NULL;
+    const char *pszWmsName=NULL;
+    int j=0;
 
 
     if (psRoot && psLayer)
@@ -676,6 +682,30 @@
 
                             if (psNode)
                             {
+                                /*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*/
+                                for (j=0; j<psLayer->map->numlayers; j++)
+                                {
+                                    psCurrentLayer = GET_LAYER(psLayer->map, j);
+
+                                    pszWmsName = msOWSLookupMetadata(&(psCurrentLayer->metadata), "MO", "name");
+
+                                    if ((psCurrentLayer->name && psLayer->name && 
+                                         strcasecmp(psCurrentLayer->name, psLayer->name) == 0) ||
+                                        (psCurrentLayer->group && psLayer->name &&
+                                         strcasecmp(psCurrentLayer->group, psLayer->name) == 0) ||
+                                        (psLayer->name && pszWmsName &&
+                                         strcasecmp(pszWmsName, psLayer->name) == 0))
+                                      break;
+                                }
+                                if (j < psLayer->map->numlayers)
+                                {
+                                   
+                                    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    */
@@ -687,9 +717,9 @@
 /* ==================================================================== */
                                 if (FLTHasSpatialFilter(psNode)) 
                                   psLayer->layerinfo = (void *)psNode;
+                                
+                                szExpression = FLTGetMapserverExpression(psNode, psLayer);
 
-                              szExpression = FLTGetMapserverExpression(psNode, psLayer);
-
                                 if (szExpression)
                                 {
                                     szClassItem = 



More information about the mapserver-commits mailing list