[mapserver-commits] r7634 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Fri May 30 09:15:24 EDT 2008


Author: Assefa
Date: 2008-05-30 09:15:24 -0400 (Fri, 30 May 2008)
New Revision: 7634

Modified:
   trunk/mapserver/mapogcsld.c
Log:
Save a temporary map file in debug mode #2635

Modified: trunk/mapserver/mapogcsld.c
===================================================================
--- trunk/mapserver/mapogcsld.c	2008-05-30 13:05:43 UTC (rev 7633)
+++ trunk/mapserver/mapogcsld.c	2008-05-30 13:15:24 UTC (rev 7634)
@@ -78,6 +78,14 @@
     if (map && szURL)
     {
         pszSLDTmpFile = msTmpFile(map->mappath, map->web.imagepath, "sld.xml");
+        if (pszSLDTmpFile == NULL)
+        {
+#ifndef _WIN32
+            pszSLDTmpFile = msTmpFile(NULL, "/tmp/", "sld.xml" );
+#else
+            pszSLDTmpFile = msTmpFile(NULL, "C:\\", "sld.xml");
+#endif
+        }
         if (msHTTPGetFile(szURL, pszSLDTmpFile, &status,-1, 0, 0) ==  MS_SUCCESS)
         {
             if ((fp = fopen(pszSLDTmpFile, "rb")) != NULL)
@@ -144,6 +152,7 @@
     int bFreeTemplate = 0;
     int nLayerStatus = 0;
     /*const char *pszSLDNotSupported = NULL;*/
+    char *tmpfilename = NULL;
 
     pasLayers = msSLDParseSLD(map, psSLDXML, &nLayers);
 
@@ -323,7 +332,24 @@
         }
 
     }
-    
+    if(map->debug == MS_DEBUGLEVEL_VVV)
+    {
+        tmpfilename = msTmpFile(map->mappath, map->web.imagepath, "_sld.map");
+        if (tmpfilename == NULL)
+        {
+#ifndef _WIN32
+            tmpfilename = msTmpFile(NULL, "/tmp/", "_sld.map" );
+#else
+            tmpfilename = msTmpFile(NULL, "C:\\", "_sld.map");
+#endif
+        }
+        if (tmpfilename)
+        {
+            msSaveMap(map,tmpfilename);
+            msDebug("msApplySLD(): Map file after SLD was applied %s", tmpfilename);
+            msFree(tmpfilename);
+        }
+    }
     return MS_SUCCESS;
 
 
@@ -2512,8 +2538,7 @@
                     }
                     else if (psTmpNode->eType == CXT_Element && 
                              strcasecmp(psTmpNode->pszValue,"PropertyName") ==0 &&
-                             psTmpNode->psChild &&
-                             psTmpNode->psChild->pszValue)
+                             CPLGetXMLValue(psTmpNode, NULL, NULL))
                     {
                         sprintf(szTmp, "[%s]", CPLGetXMLValue(psTmpNode, NULL, NULL));
                         pszClassText = msStringConcatenate(pszClassText, szTmp);



More information about the mapserver-commits mailing list