(经纬度)坐标转换到(墨卡托)瓦片行列号c++代码

瓦片行列号与坐标转换(经纬度、墨卡托)

我将其改写成了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;
}

猜你喜欢

转载自blog.csdn.net/weixin_45940369/article/details/128891694