• 高德坐标转百度,百度转高德


    /**
         * 高德转百度
         *
         * @param longitude 经度
         * @param latitude  纬度
         * @return [经度, 纬度]
         */
        public static double[] calGCJ02toBD09(double longitude, double latitude) {
            double z = Math.sqrt(longitude * longitude + latitude * latitude) + 0.00002 * Math.sin(latitude * PI);
            double theta = Math.atan2(latitude, longitude) + 0.000003 * Math.cos(longitude * PI);
            double retLat = z * Math.sin(theta) + 0.006;
            double retLon = z * Math.cos(theta) + 0.0065;
            return new double[]{retLon, retLat};
        }
        
    
        //百度转高德
        public static double[] bd09ToGcj02(double bd_lon,double bd_lat )
    
        {
    
            double x = bd_lon - 0.0065, y = bd_lat - 0.006;
            double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y *
    
                    PI);
    
            double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x *
    
                    PI);
    
            double gg_lon = z * Math.cos(theta);
    
            double gg_lat = z * Math.sin(theta);
    
            return new double[]{gg_lon, gg_lat};
    
        }
  • 相关阅读:
    白话机器学习
    Intersecting Lines POJ
    Segments POJ
    Toy Storage POJ
    TOYS POJ
    2019CCPC秦皇岛赛区1004 Decimal
    Django 基本使用
    HTML页面布局
    微擎上传视频,音频,图片提示格式不支持
    微擎应用名称图标的修改
  • 原文地址:https://www.cnblogs.com/qq376324789/p/16087665.html
Copyright © 2020-2023  润新知