[mapserver-commits] r13286 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Mar 20 12:10:32 EDT 2012


Author: schpidi
Date: 2012-03-20 09:10:32 -0700 (Tue, 20 Mar 2012)
New Revision: 13286

Modified:
   trunk/mapserver/mapwcs20.c
Log:
Adjusting axis order in offsetVector (#4191).


Modified: trunk/mapserver/mapwcs20.c
===================================================================
--- trunk/mapserver/mapwcs20.c	2012-03-20 10:46:28 UTC (rev 13285)
+++ trunk/mapserver/mapwcs20.c	2012-03-20 16:10:32 UTC (rev 13286)
@@ -1671,19 +1671,19 @@
 
                 psPos = xmlNewChild(psOrigin, psGmlNs, BAD_CAST "pos", BAD_CAST point);
             }
-            snprintf(resx, sizeof(resx), "%f 0", cm->xresolution);
-            snprintf(resy, sizeof(resy), "0 %f", -fabs(cm->yresolution));
 
             if (swapAxes == MS_FALSE)
             {
-                psOffsetX = xmlNewChild(psGrid, psGmlNs, BAD_CAST "offsetVector", BAD_CAST resx);
-                psOffsetY = xmlNewChild(psGrid, psGmlNs, BAD_CAST "offsetVector", BAD_CAST resy);
+                snprintf(resx, sizeof(resx), "%f 0", cm->xresolution);
+                snprintf(resy, sizeof(resy), "0 %f", -fabs(cm->yresolution));
             }
             else
             {
-                psOffsetY = xmlNewChild(psGrid, psGmlNs, BAD_CAST "offsetVector", BAD_CAST resy);
-                psOffsetX = xmlNewChild(psGrid, psGmlNs, BAD_CAST "offsetVector", BAD_CAST resx);
+                snprintf(resx, sizeof(resx), "0 %f", cm->xresolution);
+                snprintf(resy, sizeof(resy), "%f 0", -fabs(cm->yresolution));
             }
+            psOffsetX = xmlNewChild(psGrid, psGmlNs, BAD_CAST "offsetVector", BAD_CAST resx);
+            psOffsetY = xmlNewChild(psGrid, psGmlNs, BAD_CAST "offsetVector", BAD_CAST resy);
 
             xmlNewProp(psOffsetX, BAD_CAST "srsName", BAD_CAST cm->srs_uri);
             xmlNewProp(psOffsetY, BAD_CAST "srsName", BAD_CAST cm->srs_uri);
@@ -3729,6 +3729,10 @@
             msProjectRect(&(map->projection), &outputProj, &bbox);
             msFreeProjection(&(map->projection));
             map->projection = outputProj;
+
+            /* recalculate resolutions, needed if UOM changes (e.g: deg -> m) */
+            params->resolutionX = (bbox.maxx - bbox.minx) / params->width;
+            params->resolutionY = (bbox.maxy - bbox.miny) / params->height;
         }
     }
 



More information about the mapserver-commits mailing list