- 百度坐标转高德坐标
+ (CLLocationCoordinate2D)GCJ02FromBD09:(CLLocationCoordinate2D)coor{
CLLocationDegrees x_pi =3.141592653589793243000.0/180.0;
CLLocationDegrees x = coor.longitude -0.0065, y = coor.latitude -0.006;
CLLocationDegrees z =sqrt(x * x + y * y) -0.00002sin(y * x_pi);
CLLocationDegrees theta =atan2(y, x) -0.000003*cos(x * x_pi);
CLLocationDegrees gg_lon = z *cos(theta);
CLLocationDegrees gg_lat = z *sin(theta);
returnCLLocationCoordinate2DMake(gg_lat, gg_lon);
} - 高德坐标转百度坐标
+ (CLLocationCoordinate2D)BD09FromGCJ02: (CLLocationCoordinate2D)coor{
CLLocationDegrees x_pi =3.141592653589793243000.0/180.0;
CLLocationDegrees x = coor.longitude, y = coor.latitude;
CLLocationDegrees z =sqrt(x * x + y * y) +0.00002sin(y * x_pi);
CLLocationDegrees theta =atan2(y, x) +0.000003*cos(x * x_pi);
CLLocationDegrees bd_lon = z *cos(theta) +0.0065;
CLLocationDegrees bd_lat = z *sin(theta) +0.006;
return CLLocationCoordinate2DMake(bd_lat, bd_lon);
}
百度地图坐标与苹果自带地图经纬度之间的相互转换方法
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- // // coordinatesChangeHelper.h //// Created by 冰泪 on 201...
- #import<CoreLocation/CoreLocation.h> CLLocation类扩展 */ @in...