Map API coordinate system comparison and conversion in China

Source: Internet
Author: User
Tags comparison cos sin

Map API coordinate system comparison and conversion in China   Note: The source of information and online, here a little collation, the wrong welcome to point out


Overview of the various coordinate systems it is well known that the earth is an irregular ellipsoid, the definition of the coordinate system in GIS is determined by the Datum plane and the map projection two sets of parameters, while the datum definition is determined by the specific ellipsoid and its corresponding conversion parameters. The datum is the approximation of a particular ellipsoid to the Earth's surface in a particular region, so that each country or region has its own datum. The Datum is established on the basis of an ellipsoid, which can correspond to multiple datum planes, and the datum plane can only correspond to one ellipsoidal body. It means whether it is Google Map, search the map or the gold map, Baidu Map difference is only for different geographical coordinate system standard production of latitude and longitude, there is no quasi-forbidden problem, we are quasi-only reference or standard is not the same. Google Maps using WGS84 geographic coordinate system (except China), Google China map and search China map using the GCJ02 geographic coordinate system, Baidu uses BD09 coordinate system, and equipment generally includes GPS chip or Beidou chip obtained by the latitude and longitude for the WGS84 geographic coordinate system, Why not unify with WGS84 geographic coordinate system This is the National Geographic Survey Authority for publishing maps requirements, publishing maps must conform to the GCJ02 coordinate system standard, that is, the state regulations can not directly use the WGS84 geographic coordinate system. So the positioning of the people feel inaccurate many also called the publication map for the Mars map is actually a coordinate system is not the same. This is why device acquisition of latitude and longitude on the map is often a large deviation, far beyond the civil GPS 10 meters offset technical specifications.

Above reference from: haotsp.com


Summary:

WGS84 coordinate system: the earth coordinate system, the international universal coordinate system.

GCJ02 coordinate system: The Mars coordinate system, the WGS84 coordinate system after the encrypted coordinate system.

BD09 coordinate system: that is, the Baidu coordinate system, GCJ02 coordinate system after the encrypted coordinate system.

Sogou coordinate system, graph bar coordinate system, etc., are also estimated to be based on the GCJ02 encryption.

Ii. coordinate system used by each map API

Api Coordinates
Baidu Map API Baidu coordinates
Tencent Search Map API Mars coordinates
Sohu Sogou Map API Sogou coordinates *
Alibaba Cloud Map API Mars coordinates
Figure Bar Mapbar Map API Figure Bar Coordinates
German MAPABC Map API Mars coordinates
Turing 51ditu Map API Mars coordinates

Note 1: Baidu map using Baidu coordinates, support from the Earth coordinates and Mars coordinates into Baidu coordinates, but cannot export. and the batch coordinate conversion can only convert 20 at a time (to be verified).

NOTE 2: Sogou map supports direct display of Earth coordinates, support the earth coordinates, MARS coordinates, Baidu coordinates into Sogou coordinates, similarly, sogou coordinates can not be exported.

Personally, the use of their own coordinate system, rather than using the domestic general Mars coordinate system, is to seek shortcomings. Of course, Baidu is due to do big enough, good enough, so very overbearing, but also for the future eminence and not let others carve up and prepare it. Although Sogou with its own coordinate system, but can be directly imported Earth coordinates, this is also the only. and figure Bar Map do not know what encryption method, used the Earth coordinate with a good, now with the map bar own coordinates, is because Baidu did so also came so a trick. or Baidu. Unknown.

The purpose of this article is to: Do map development, do not want to be a map API to accommodate, so the use of Mars coordinates is the right choice, I hope this article can choose who to use the home API developers to provide a little help. Personally, I will never use the map API of the non-Mars coordinate system, although the Baidu map API is very good and powerful indeed attracts me.


Above reference from: http://rovertang.com/labs/map-compare/


Three, the mutual transformation of each coordinate system

1. The conversion algorithm of the Mars coordinate System (GCJ-02) and the Baidu coordinate system (BD-09), where Bd_encrypt converts GCJ-02 coordinates to BD-09 coordinates, bd_decrypt vice versa.

[Java]  View plain copy void bd_encrypt (double gg_lat, double gg_lon, double &bd_ Lat, double &bd_lon)       {           double x = gg_lon, y = gg_lat;           Double z = sqrt (x * x + y * y)  + 0.00002 *  Sin (y * x_pi);          double theta = atan2 (y,  x)  + 0.000003 * cos (X * X_PI);           bd_lon = z * cos (theta)  + 0.0065;           bd_lat = z * sin (theta)  + 0.006;     }              void bd_decrypt (double bd_lat, double bd_ Lon,&nbsP;double &gg_lat, double &gg_lon)       {          double x = bd_lon - 0.0065, y = bd_lat -  0.006;          double z = sqrt (x * x  + y * y)  - 0.00002 * sin (Y * X_PI);          double theta = atan2 (y, x)  - 0.000003 * cos (x  * X_PI);          gg_lon = z * cos (theta) ;          gg_lat = z * sin (theta);     }  [Java]View plain copy void Bd_encrypt (double Gg_lat, double Gg_lon, double &bd_lat, double &bd_lon) {Dou ble x = gg_lon, y = Gg_lat;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.