[mapserver-commits] r12717 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Fri Oct 28 10:31:31 EDT 2011


Author: assefa
Date: 2011-10-28 07:31:31 -0700 (Fri, 28 Oct 2011)
New Revision: 12717

Modified:
   trunk/mapserver/mapogcsld.c
Log:
SLD: add support for size parameter using literal expression (#4065)

Modified: trunk/mapserver/mapogcsld.c
===================================================================
--- trunk/mapserver/mapogcsld.c	2011-10-28 12:19:40 UTC (rev 12716)
+++ trunk/mapserver/mapogcsld.c	2011-10-28 14:31:31 UTC (rev 12717)
@@ -690,7 +690,23 @@
 }
 
 
+int _msSLDParseSizeParameter(CPLXMLNode *psSize)
+{
+    int nSize = 0;
+    CPLXMLNode *psLiteral = NULL;
 
+    if (psSize)
+    {
+	psLiteral = CPLGetXMLNode(psSize, "Literal");
+	if (psLiteral && psLiteral->psChild && psLiteral->psChild->pszValue)
+	  nSize = atof(psLiteral->psChild->pszValue);
+	else if (psSize->psChild && psSize->psChild->pszValue)
+	  nSize = atof(psSize->psChild->pszValue);
+    }
+
+    return nSize;
+}
+
 /************************************************************************/
 /*                           _SLDApplyRuleValues                        */
 /*                                                                      */
@@ -1671,8 +1687,8 @@
         {
             /* extract symbol size */
             psSize = CPLGetXMLNode(psGraphic, "Size");
-            if (psSize && psSize->psChild && psSize->psChild->pszValue)
-              psStyle->size = atof(psSize->psChild->pszValue);
+            if (psSize)
+	      psStyle->size = _msSLDParseSizeParameter(psSize);
             else 
             {
                 /*do not set a default for external symbols #2305*/



More information about the mapserver-commits mailing list