To achieve the goal: the Baidu map latitude and longitude conversion to the Tencent map/google corresponding latitude and longitude degree.
Method 1: Use code to convert
The problem: After the conversion, the error is large, basically not available
public static void convert_bd09_to_gcj02 (double lat, double LNG) {
double x_pi = Math. PI * 3000.0/180.0;
Double x = lng-0.0065, y = lat-0.006;
Double z = Math. SQRT (x * x + y * y)-0.00002 * Math.sin (y * x_pi);
Double theta = math.atan2 (y, x)-0.000003 * MATH.COS (x * x_pi);
LNG = Z * Math. cos (theta);
Lat = z * Math. Sin (theta);
System. Out.println (LNG);
System. OUT.PRINTLN (LAT);
}
Method 2:
The site provides conversion services, the coordinates are more accurate, available, background calls are not carefully studied
Http://www.minigps.net/convert.html
Method 3:
Use the Tencent map for details, see 1.html
Tencent map old version of the address: http://api.map.soso.com/doc_v2/example.html?sample-convertor-library
Latest Address: http://lbs.qq.com/javascript_v2/doc/convertor.html
Direct call to the address < Baidu map into Tencent map >,points= latitude and longitude, the incoming Baidu can:
http://apic.map.qq.com/translate/?type=3&points=114.041993,22.667204&output=jsonp&pf=jsapi&cb= Qq.maps.__svcbi1x9al56.cbi1x9al9l0
Coordinate query Address:
http://api.map.baidu.com/lbsapi/getpoint/
Http://lbs.qq.com/javascript_v2/case-run.html#sample-geocoding-reverse
Summarize:
Because of Tencent's latitude and longitude and Google latitude and longitude is the same coordinate system, Baidu latitude and longitude for their own system, the current online search algorithm code, are not very accurate, so we recommend the use of Map developers to provide the API conversion.