bd09ToGcj02 static method

List<double> bd09ToGcj02(
  1. double bd_lng,
  2. double bd_lat
)

百度坐标系(BD-09)转火星坐标系(GCJ-02) @param bd_lng 百度坐标纬度 @param bd_lat 百度坐标经度 @return 火星坐标数组 @info 百度——>谷歌、高德

Implementation

static List<double> bd09ToGcj02(double bd_lng, double bd_lat) {
    double x = bd_lng - 0.0065;
    double y = bd_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 gg_lng = z * Math.cos(theta);
    double gg_lat = z * Math.sin(theta);
    return [gg_lng, gg_lat];
}