美文网首页
百度坐标转换为高德坐标进行导航

百度坐标转换为高德坐标进行导航

作者: 呦嚯嚯嚯12138 | 来源:发表于2017-02-15 11:08 被阅读45次

+ (CLLocationCoordinate2D)bd09Decrypt:(double)bdLat bdLon:(double)bdLon {

CLLocationCoordinate2D gcjPt;

double x = bdLon - 0.0065, y = bdLat - 0.006;

double z = sqrt(x * x + y * y) - 0.00002 * sin(y * M_PI);

double theta = atan2(y, x) - 0.000003 * cos(x * M_PI);

gcjPt.longitude = z * cos(theta);

gcjPt.latitude = z * sin(theta);

return gcjPt;

}

相关文章

网友评论

      本文标题:百度坐标转换为高德坐标进行导航

      本文链接:https://www.haomeiwen.com/subject/qcqqwttx.html