当前位置:网站首页>Coordinate conversion WGS-84 to gcj-02 and gcj-02 to WGS-84
Coordinate conversion WGS-84 to gcj-02 and gcj-02 to WGS-84
2022-04-23 19:09:00 【GIS roast lamb leg is delicious】
/*//WGS-84 to GCJ-02*/
static wgs_gcj(lng, lat){
if (this.out_of_china(lng, lat)) {
return [lng, lat];
}else{
var a = 6378245.0; // a: The projection factor of the satellite ellipsoid coordinate projected to the plane map coordinate system .
var ee = 0.00669342162296594323; // ee: Eccentricity of ellipsoid .
var dlat = this.transformlat(lng - 105.0, lat - 35.0);
var dlng = this.transformlng(lng - 105.0, lat - 35.0);
var radlat = lat / 180.0 * PI;
var magic = Math.sin(radlat);
magic = 1 - ee * magic * magic;
var sqrtmagic = Math.sqrt(magic);
dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI);
dlng = (dlng * 180.0) / (a / sqrtmagic * Math.cos(radlat) * PI);
var mglat = lat + dlat;
var mglng = lng + dlng;
return {j:mglng, w:mglat};
}
}
//gcj-02 turn wgs84
static gcj_wgs(lng, lat){
if (this.out_of_china(lng, lat)) {
return [lng, lat];
}
else {
var a = 6378245.0; // a: The projection factor of the satellite ellipsoid coordinate projected to the plane map coordinate system .
var ee = 0.00669342162296594323; // ee: Eccentricity of ellipsoid .
var dlat = this.transformlat(lng - 105.0, lat - 35.0);
var dlng = this.transformlng(lng - 105.0, lat - 35.0);
var radlat = lat / 180.0 * PI;
var magic = Math.sin(radlat);
magic = 1 - ee * magic * magic;
var sqrtmagic = Math.sqrt(magic);
dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI);
dlng = (dlng * 180.0) / (a / sqrtmagic * Math.cos(radlat) * PI);
var mglat = lat + dlat;
var mglng = lng + dlng;
return {j:lng * 2 - mglng, w:lat * 2 - mglat};
}
}
版权声明
本文为[GIS roast lamb leg is delicious]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231908120743.html
边栏推荐
- From technical system to business insight, the closing chapter of the practice of small and medium-sized R & D team structure
- openlayers 5.0 两种居中方式
- Client interns of a large factory share their experience face to face
- Methods of nested recycleview to solve sliding conflict and incomplete item display
- 2022.04.23(LC_714_买卖股票的最佳时机含手续费)
- WebView saves the last browsing location
- 在渤海期货办理开户安全吗。
- Simplified path (force buckle 71)
- WebView opens H5 video and displays gray background or black triangle button. Problem solved
- ESP32 LVGL8. 1 - calendar (calendar 25)
猜你喜欢
Introduction to micro build low code zero Foundation (lesson 3)
开关电源设计分享及电源设计技巧图解
Android Development: the client obtains the latest value in the database in real time and displays it on the interface
FTP、ssh远程访问及控制
2022.04.23 (the best time for lc_714_to buy and sell stocks, including handling charges)
[today in history] April 23: the first video uploaded on YouTube; Netease cloud music officially launched; The inventor of digital audio player was born
Sword finger offer II 116 Number of provinces - spatial complexity O (n), time complexity O (n)
Wechat video extraction and receiving file path
Esp32 (UART ecoh) - serial port echo worm learning (2)
[record] typeerror: this getOptions is not a function
随机推荐
Redis optimization series (III) solve common problems after master-slave configuration
Go language GUI framework Fyne Chinese garbled or not displayed
浅谈c语言指针的强制转换
7、 DOM (Part 2) - chapter after class exercises and answers
ESP32 LVGL8. 1 - checkbox (checkbox 23)
[record] typeerror: this getOptions is not a function
Raspberry pie 18b20 temperature
mysql_linux版本的下載及安裝詳解
2022.04.23(LC_714_买卖股票的最佳时机含手续费)
[报告] Microsoft :Application of deep learning methods in speech enhancement
SSDB Foundation
Sogou cell thesaurus analysis (only extract words and word frequency)
c1000k TCP 连接上限测试
2022.04.23 (the best time for lc_714_to buy and sell stocks, including handling charges)
【玩转Lighthouse】腾讯云轻量服务器搭建全平台视频解析视频下载网站
Go 语言 GUI 框架 fyne 中文乱码或者不显示的问题
在渤海期货办理开户安全吗。
C: generic reflection
Quick start to static class variables
Nacos as service registry