[mapguide-commits] r8332 - trunk/MgDev/Server/src/Services/Rendering

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Aug 15 01:25:11 PDT 2014


Author: hubu
Date: 2014-08-15 01:25:11 -0700 (Fri, 15 Aug 2014)
New Revision: 8332

Modified:
   trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp
Log:
Fix Linux build. 

Linux build failed with the error below.
ServerRenderingService.cpp:298: error: call of overloaded 'pow(double, INT32&)' is ambiguous
/usr/include/bits/mathcalls.h:154: note: candidates are: double pow(double, double)
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/cmath:361: note:                 long double std::pow(long double, int)
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/cmath:357: note:                 float std::pow(float, int)
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/cmath:353: note:                 double std::pow(double, int)
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/cmath:349: note:                 long double std::pow(long double, long double)
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/cmath:345: note:                 float std::pow(float, float)

The original code is: 
double nMin = M_PI - 2.0 * M_PI * y / pow(2.0, z);
Now we change it to:
double nMin = M_PI - 2.0 * M_PI * y / pow((double)2.0, z); 
to fix the build.

Modified: trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp	2014-08-12 12:00:45 UTC (rev 8331)
+++ trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp	2014-08-15 08:25:11 UTC (rev 8332)
@@ -295,11 +295,11 @@
     //XYZ to lat/lon math. From this we can convert to the bounds in the map's CS
     //
     //Source: http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
-    double nMin = M_PI - 2.0 * M_PI * y / pow(2.0, z);
-    double nMax = M_PI - 2.0 * M_PI * (y + 1) / pow(2.0, z);
-    double lonMin = x / pow(2.0, z) * 360.0 - 180;
+    double nMin = M_PI - 2.0 * M_PI * y / pow((double)2.0, z);
+    double nMax = M_PI - 2.0 * M_PI * (y + 1) / pow((double)2.0, z);
+    double lonMin = x / pow((double)2.0, z) * 360.0 - 180;
 	double latMin = 180.0 / M_PI * atan(0.5 * (exp(nMin) - exp(-nMin)));
-    double lonMax = (x + 1) / pow(2.0, z) * 360.0 - 180;
+    double lonMax = (x + 1) / pow((double)2.0, z) * 360.0 - 180;
 	double latMax = 180.0 / M_PI * atan(0.5 * (exp(nMax) - exp(-nMax)));
 
     double mcsMinX = std::min(lonMin, lonMax);



More information about the mapguide-commits mailing list