[mapserver-commits] r10527 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Sep 28 11:35:41 EDT 2010


Author: warmerdam
Date: 2010-09-28 15:35:41 +0000 (Tue, 28 Sep 2010)
New Revision: 10527

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapwmslayer.c
Log:
Avoid EPSG lookups for WMS client layers if possible (#3533)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2010-09-28 15:05:24 UTC (rev 10526)
+++ trunk/mapserver/HISTORY.TXT	2010-09-28 15:35:41 UTC (rev 10527)
@@ -14,6 +14,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Avoid EPSG lookups for WMS client layers if possible (#3533)
+
 - RFC-60: Add ability to skip ANGLE FOLLOW labels with too much character overlap (#3523)
 
 - Fixed SWF: not a valid Bitmap FillStyle (#3548)

Modified: trunk/mapserver/mapwmslayer.c
===================================================================
--- trunk/mapserver/mapwmslayer.c	2010-09-28 15:05:24 UTC (rev 10526)
+++ trunk/mapserver/mapwmslayer.c	2010-09-28 15:35:41 UTC (rev 10527)
@@ -626,18 +626,29 @@
     if ((pszTmp = msOWSGetEPSGProj(&(lp->projection), NULL, "MO", MS_TRUE)) == NULL ||
         strcasecmp(pszEPSG, pszTmp) != 0)
     {
-        if (strncasecmp(pszEPSG, "EPSG:", 5) == 0)
+        const char *ows_srs;
+
+        /* no need to set lp->proj if it is already set and there is only 
+           one item in the _srs metadata for this layer - we will assume
+           the projection block matches the _srs metadata (the search for ' '
+           in ows_srs is a test to see if there are multiple EPSG: codes) */
+        if( lp->projection.numargs == 0 
+            || (ows_srs = msOWSGetEPSGProj(NULL,&(lp->metadata), "MO", MS_FALSE)) == NULL
+            || (strchr(ows_srs,' ') != NULL) )
         {
-            char szProj[20];
-            sprintf(szProj, "init=epsg:%s", pszEPSG+5);
-            if (msLoadProjectionString(&(lp->projection), szProj) != 0)
-                return MS_FAILURE;
+            if (strncasecmp(pszEPSG, "EPSG:", 5) == 0)
+            {
+                char szProj[20];
+                sprintf(szProj, "init=epsg:%s", pszEPSG+5);
+                if (msLoadProjectionString(&(lp->projection), szProj) != 0)
+                    return MS_FAILURE;
+            }
+            else
+            {
+                if (msLoadProjectionString(&(lp->projection), pszEPSG) != 0)
+                    return MS_FAILURE;
+            }
         }
-        else
-        {
-            if (msLoadProjectionString(&(lp->projection), pszEPSG) != 0)
-                return MS_FAILURE;
-        }
     }
 
 /* ------------------------------------------------------------------
@@ -660,10 +671,9 @@
 
 /* -------------------------------------------------------------------- */
 /*      Sometimes our remote WMS only accepts square pixel              */
-/*      requests.  If this is the case adjust grow the bbox so that     */
-/*      the pixels will be square given our map width/height.  It       */
-/*      seems it is difficult to adjust width/height the way things     */
-/*      are structured now.                                             */
+/*      requests.  If this is the case adjust adjust the number of      */
+/*      pixels or lines in the request so that the pixels are           */
+/*      square.                                                         */
 /* -------------------------------------------------------------------- */
         {
             const char *nonsquare_ok = 



More information about the mapserver-commits mailing list