<?php function Convert_GCJ02_To_BD09($lat,$lng){ $x_pi = 3.14159265358979324 * 3000.0 / 180.0; $x = $lng; $y = $lat; $z =sqrt($x * $x + $y * $y) + 0.00002 * sin($y * $x_pi); $theta = atan2($y, $x) + 0.000003 * cos($x * $x_pi); $lng = $z * cos($theta) + 0.0065; $lat = $z * sin($theta) + 0.006; return array('lng'=>$lng,'lat'=>$lat); } function Convert_BD09_To_GCJ02($lat,$lng){ $x_pi = 3.14159265358979324 * 3000.0 / 180.0; $x = $lng - 0.0065; $y = $lat - 0.006; $z = sqrt($x * $x + $y * $y) - 0.00002 * sin($y * $x_pi); $theta = atan2($y, $x) - 0.000003 * cos($x * $x_pi); $lng = $z * cos($theta); $lat = $z * sin($theta); return array('lng'=>$lng,'lat'=>$lat); } ?>
China's normal GCJ02 coordinates---->Baidu map BD09 coordinates
Tencent map also uses GCJ02 coordinates
@param double $lat latitude
@ param double $lng Longitude
Baidu map BD09 coordinates---->China normal GCJ02 coordinates
Tencent map also uses GCJ02 coordinates
@param double $lat latitude
@param double $lng longitude
@return array();
All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn
Related Article
25Jul2016
PHP Tencent map longitude and latitude to Baidu map longitude and latitude
13Jul2016
The longitude and latitude of Baidu map are converted to the corresponding longitude and latitude of Tencent Map/Google, and the longitude and latitude of Google. Convert the longitude and latitude of Baidu Map to the corresponding longitude and latitude of Tencent Map/Google. The purpose of the longitude and latitude of Google is to convert the longitude and latitude of Baidu Map to the corresponding longitude and latitude of Tencent Map/Google. Method
21Aug2017
The PHP Tencent Map Longitude and Latitude Conversion to Baidu Map Longitude and Latitude class can convert the Baidu Map Longitude and Latitude into the corresponding longitude and latitude of Tencent Map/Google.
19Apr2023
During the development process, we usually need to process some geographical location information, and the longitude and latitude formats of different platforms are different, which requires conversion. This article will introduce how to convert Baidu longitude and latitude into Tencent longitude and latitude, and use PHP code to implement it. 1. The difference between Baidu’s longitude and latitude and Tencent’s longitude and latitude. Longitude and latitude are symbols of the position on the earth’s surface. They are expressed in different ways in different positioning systems. There are currently three mainstream positioning systems: WGS84, GCJ02 and BD09. Among them, WGS84 is the coordinate system used by the GPS positioning system, G
11Jul2024
As a map navigation application favored by users, Baidu Maps provides great convenience to users' lives. Today, the editor brings you the method of querying and positioning the longitude and latitude of Baidu map. Users in need should quickly learn it! I hope to be helpful! How to query the longitude and latitude positioning on Baidu map 1. First open Baidu from the computer and enter the homepage and click [Map] on the upper left; 2. Then enter the map page and find the [Map Open Platform] at the bottom and click; 3. Then come to the map After opening the platform page, slide the screen upward to find the tool that supports the click [Coordinate Picker] function; 4. Finally, move the mouse to see the latitude and longitude coordinates of any place on the map;
01Jul2024
How to check the longitude and latitude of a region on Baidu Map? Baidu Maps allows you to query the latitude and longitude coordinates of where you are or where you want to go. Many friends still don’t know how to check the longitude and latitude of a Baidu map area. Here we have compiled a method for querying the longitude and latitude of a Baidu map area. Let’s take a look. How to check the longitude and latitude of a Baidu map area 1. First step, click on the map open platform to open the Baidu map web version, and then we click on the small blue text below, the map open platform function. 2 The second step is to click on the coordinate picker. After we enter the map open platform, we then slide down and find the coordinate picker tool. 3 The third step is to view the coordinates. After we click the coordinate picker, we can then place it at any location to view the latitude and longitude.
Hot Tools
PHP library for dependency injection containers
PHP library for dependency injection containers
A collection of 50 excellent classic PHP algorithms
Classic PHP algorithm, learn excellent ideas and expand your thinking
Small PHP library for optimizing images
Small PHP library for optimizing images