[mapserver-commits] r11260 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Fri Mar 18 15:01:00 EDT 2011


Author: tbonfort
Date: 2011-03-18 12:01:00 -0700 (Fri, 18 Mar 2011)
New Revision: 11260

Modified:
   trunk/mapserver/mapogcsld.c
Log:
use style->pattern instead of symbol->pattern in sld output


Modified: trunk/mapserver/mapogcsld.c
===================================================================
--- trunk/mapserver/mapogcsld.c	2011-03-18 18:54:40 UTC (rev 11259)
+++ trunk/mapserver/mapogcsld.c	2011-03-18 19:01:00 UTC (rev 11260)
@@ -3835,7 +3835,6 @@
     char szTmp[100];
     char szHexColor[7];
     int nSymbol = -1;
-    symbolObj *psSymbol = NULL;
     int i = 0;
     double dfSize = 1.0;
     char *pszDashArray = NULL;
@@ -3933,23 +3932,18 @@
 /* -------------------------------------------------------------------- */
                             
                             
-    if (nSymbol > 0 && nSymbol < psLayer->map->symbolset.numsymbols)
+    if (psStyle->patternlength > 0)
     {
-        psSymbol =  psLayer->map->symbolset.symbol[nSymbol];
-        if (psSymbol->patternlength > 0)
+        for (i=0; i<psStyle->patternlength; i++)
         {
-            for (i=0; i<psSymbol->patternlength; i++)
-            {
-                snprintf(szTmp, sizeof(szTmp), "%d ", psSymbol->pattern[i]);
-                pszDashArray = msStringConcatenate(pszDashArray, szTmp);
-            }
-            snprintf(szTmp, sizeof(szTmp),
-                     "<%s name=\"stroke-dasharray\">%s</%s>\n", 
-                     sCssParam, pszDashArray, sCssParam);
-            pszSLD = msStringConcatenate(pszSLD, szTmp);
-        }  
-                                           
-    }
+            snprintf(szTmp, sizeof(szTmp), "%.2f ", psStyle->pattern[i]);
+            pszDashArray = msStringConcatenate(pszDashArray, szTmp);
+        }
+        snprintf(szTmp, sizeof(szTmp),
+                 "<%s name=\"stroke-dasharray\">%s</%s>\n", 
+                 sCssParam, pszDashArray, sCssParam);
+        pszSLD = msStringConcatenate(pszSLD, szTmp);
+    }  
 
     snprintf(szTmp, sizeof(szTmp), "</%sStroke>\n",  sNameSpace);
 



More information about the mapserver-commits mailing list