您是第: 个访问我网站的人!
站内搜索:
浏览信息 您当前的位置:首页 >> 浏览信息
coordinate system / projection
【字体: 】   【时间:2021-04-13】  【作者:不学无数】  【关 闭】  【打 印

https://mygeodata.cloud/cs2cs/

CoordinateTrans::CoordinateTrans()
{
Xian80_3_degree_Gauss_Kruger_zone.resize(46);
Xian80_6_degree_Gauss_Kruger_zone.resize(23);
wgs84 = "+proj=longlat +datum=WGS84 +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[25] = "+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[26] = "+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[27] = "+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[28] = "+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[29] = "+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[30] = "+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[31] = "+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[32] = "+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";//
Xian80_3_degree_Gauss_Kruger_zone[33] = "+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[34] = "+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[35] = "+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[36] = "+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[37] = "+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[38] = "+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[39] = "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[40] = "+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[41] = "+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[42] = "+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[43] = "+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[44] = "+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
Xian80_3_degree_Gauss_Kruger_zone[45] = "+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs ";
}

bool CoordinateTrans::transform_wgs84_2_xian80(const double l, const double b, double& x, double& y)
{
int zone_num = l / 3.0 + 0.5;
projPJ pj_wgs84 = pj_init_plus(wgs84.c_str());
projPJ pj_city = pj_init_plus(Xian80_3_degree_Gauss_Kruger_zone[zone_num].c_str());
double xx, yy;
xx = l * DEG_TO_RAD;
yy = b * DEG_TO_RAD;
pj_transform(pj_wgs84, pj_city, 1, 1, &xx, &yy, NULL);
x = xx; y = yy;
return true;
}
bool CoordinateTrans::transform_xian80_2_wgs84(const double x, const double y, double& l, double& b)
{
int zone_num = x / 1000000.0;
projPJ pj_wgs84 = pj_init_plus(wgs84.c_str());
projPJ pj_city = pj_init_plus(Xian80_3_degree_Gauss_Kruger_zone[zone_num].c_str());
b = y;
l = x;
pj_transform(pj_city, pj_wgs84, 1, 1, &l, &b, NULL);
b /= DEG_TO_RAD;
l /= DEG_TO_RAD;
return true;
}

关闭页面】【页面顶部
本站所有资源未经许可不得转载复制,违者必究。
© Copyright 2020-2025 www.yuzhilin.com.cn All Right Reaserved. 不学无数之家 拥有所有版权
地址:中国·光谷 E-mail:zhilinyu@163.com  鄂ICP备20001861号 技术支持:不学无数之家