国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

[C#]火星坐標(biāo)系 (GCJ-02)與百度坐標(biāo)系 (BD-09) 轉(zhuǎn)換幫助類

2019-11-17 02:42:58
字體:
供稿:網(wǎng)友

[C#]火星坐標(biāo)系 (GCJ-02)與百度坐標(biāo)系 (BD-09) 轉(zhuǎn)換幫助類

關(guān)鍵代碼:

using System;using YanZhiwei.DotNet2.Utilities.Models;namespace YanZhiwei.DotNet2.Utilities.Common{    /// <summary>    /// 火星坐標(biāo)系 (GCJ-02)與百度坐標(biāo)系 (BD-09) 轉(zhuǎn)換幫助類    /// </summary>    public class BDGCJLatLonHelper    {        /*         *參考:         *BD09坐標(biāo)系:即百度坐標(biāo)系,GCJ02坐標(biāo)系經(jīng)加密后的坐標(biāo)系。         */        #region 常量        const double x_pi = 3.14159265358979324 * 3000.0 / 180.0;        #endregion         #region 將GCJ-02坐標(biāo)轉(zhuǎn)換成BD-09坐標(biāo)        /// <summary>        /// 將GCJ-02坐標(biāo)轉(zhuǎn)換成BD-09坐標(biāo)        /// </summary>        /// <param name="gcjPoint">GCJ-02坐標(biāo)</param>        /// <returns>BD-09坐標(biāo)</returns>        public LatLngPoint GCJ02ToBD09(LatLngPoint gcjPoint)        {            LatLngPoint _bdPoint = new LatLngPoint();            double _x = gcjPoint.LonX, y = gcjPoint.LatY;            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);            _bdPoint.LonX = _z * Math.Cos(_theta) + 0.0065;            _bdPoint.LatY = _z * Math.Cos(_theta) + 0.006;            return _bdPoint;        }        #endregion         #region 將BD-09坐標(biāo)轉(zhuǎn)換成GCJ-02坐標(biāo)        /// <summary>        /// 將BD-09坐標(biāo)轉(zhuǎn)換成GCJ-02坐標(biāo)        /// </summary>        /// <param name="bdPoint">BD-09坐標(biāo)</param>        /// <returns>GCJ-02坐標(biāo)</returns>        public LatLngPoint BD09ToGCJ02(LatLngPoint bdPoint)        {            LatLngPoint _gcjPoint = new LatLngPoint();            double _x = bdPoint.LonX - 0.0065, _y = bdPoint.LatY - 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);            _gcjPoint.LonX = _z * Math.Cos(_theta);            _gcjPoint.LatY = _z * Math.Sin(_theta);            return _gcjPoint;        }        #endregion     }}

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 莎车县| 汉阴县| 土默特右旗| 昆山市| 南昌市| 大竹县| 吕梁市| 潮安县| 青岛市| 广丰县| 林芝县| 香港| 景泰县| 呼和浩特市| 分宜县| 尼木县| 鹤庆县| 礼泉县| 彭泽县| 萍乡市| 蒙阴县| 和硕县| 健康| 三明市| 耒阳市| 琼海市| 石河子市| 中山市| 福建省| 禹城市| 兴国县| 砀山县| 临安市| 海兴县| 惠来县| 万山特区| 顺昌县| 光山县| 扶绥县| 武定县| 阿拉尔市|