瓦片行列号与坐标转换(经纬度、墨卡托)
我将其改写成了c++代码
#include <bits/stdc++.h>
using namespace std;
int main() {
double lg, la, r, c;
cout << "输入经度和纬度:" << endl;
cin >> lg >> la;
for (int i = 1; i < 20; i++) {
r = ( (90 - la) * pow(2, i) * 1.0 / 360 );
c = ( (lg + 180) * pow(2, i) * 1.0 / 360 );
cout << i << "级时,行: " << r << " 列: " << c << endl;
}
return 0;
}