百度經緯度轉谷歌/高德經緯度

public static double x_pi = 3.14159265358979324 * 3000.0 / 180.0; 
     
public static void main(String[] args) {
    /**
     * 百度經緯度轉谷歌經緯度
     */
     double x = lon - 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);
     double tempLon = z * Math.cos(theta);
     double tempLat = z * Math.sin(theta);
     System.out.println(tempLon);
     System.out.println(tempLat);
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章