[mapguide-commits] r8338 - trunk/MgDev/Server/src/Services/Rendering
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Aug 19 23:27:28 PDT 2014
Author: hubu
Date: 2014-08-19 23:27:28 -0700 (Tue, 19 Aug 2014)
New Revision: 8338
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)
I am sorry that my last fix #8332 is not correct. We need change the code like this:
double nMin = M_PI - 2.0 * M_PI * y / pow(2.0, (int)z);
This fix is built successful on CentOS 5.8.
Modified: trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp 2014-08-18 13:22:43 UTC (rev 8337)
+++ trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp 2014-08-20 06:27:28 UTC (rev 8338)
@@ -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((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 nMin = M_PI - 2.0 * M_PI * y / pow(2.0, (int)z);
+ double nMax = M_PI - 2.0 * M_PI * (y + 1) / pow(2.0, (int)z);
+ double lonMin = x / pow(2.0, (int)z) * 360.0 - 180;
double latMin = 180.0 / M_PI * atan(0.5 * (exp(nMin) - exp(-nMin)));
- double lonMax = (x + 1) / pow((double)2.0, z) * 360.0 - 180;
+ double lonMax = (x + 1) / pow(2.0, (int)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