Positioning Learning--Explanation of Coordinate Systems of Each Map and Coordinate Conversion

Part 1 Detailed explanation of various coordinate systems

1. Geodetic coordinate system WGS-84

A regional coordinate system used to express the location of points on the earth. It uses a reference ellipsoid that closely approximates the natural shape of the earth as a datum for describing and inferring the positions and relationships of ground points. A geodetic coordinate system must clearly define the orientation of its three axes and the location of its center. Usually people use the short axis of the spheroid to be parallel to the mean rotation axis of the earth at a certain moment and the corresponding true starting meridian plane to determine the direction of the coordinate axis. If the center of the reference ellipsoid coincides with the mean center of mass of the earth, the geocentric geodetic coordinate system is defined and established. It is the basis for various positioning, measurement and control orbits in aerospace and long-range weapons and space science. If the surface of the ellipsoid matches the local geoid of one or several countries best, then a local geodetic coordinate system of a country or region is established. The position of the midpoint of the geodetic coordinate system is represented by its geodetic coordinate, which is defined by the normal of the ellipsoid. Among them, the intersection angle between the ellipsoid normal passing through a certain point and the ellipsoid equatorial plane is the geodetic latitude; the dihedral angle including the normal and the geodetic meridian plane and the starting geodetic meridian plane is the geodetic longitude of the point; along the normal to The distance of the ellipsoid is the geodetic height of the point. The geodetic latitude, geodetic longitude and geodetic height are represented by capital letters B, L and H respectively.

Domestic Internet companies will not use GPS coordinates because this is not in line with national policy. So everyone will use the GCJ-02 coordinate system.

 

2. Mars coordinate system GCJ-02

The national security plug-in, also called encryption plug-in or biasing or SM module, is actually an artificial biasing process for the real coordinate system. According to the algorithm of a few lines of code, the real coordinates are encrypted into false coordinates, and this biasing The offset is not linear, so the offset will vary from place to place. The encrypted coordinates are also often referred to as the Mars coordinate system.

Map providers currently using the Mars coordinate system:

  • Tencent Soso Map
  • Sohu Sogou map
  • Alibaba Cloud Map
  • AutoNavi MapABC map
  • Lingtu 51ditu map

All electronic maps and all navigation devices need to join the national security plug-in. In the first step, the map company surveys and maps the map. After the survey and mapping is completed, it is sent to the National Bureau of Surveying and Mapping, and the electronic map of the real coordinates is encrypted into "Mars coordinates". Only such a map can be published and released, and then the GPS company can be used. deal with. The second step, all GPS companies, as long as they need car navigation, need to use electronic maps for navigation, they all need to add a national security algorithm to the software to encrypt and convert the real coordinate signals read from the COM port into the state required by the country. Confidential coordinates, in this way, the GPS navigator and the navigation electronic map can be completely matched, and the GPS can work normally.

Domestic Internet companies must use the GCJ-02 coordinate system.

 

 

3. Baidu coordinate system BD-09

Baidu coordinates encrypts the Mars coordinate system once to form the Baidu coordinate system.

Map providers currently using Baidu's coordinate system:

  • Baidu Baidu map

A small number of companies will perform another encryption on the basis of GCJ-02, but such coordinates are not universal and are only suitable for specific company maps.

 

4. Picture it

Figure bar is the result of multiplying Baidu coordinates by 10000.

The map quotient currently using the map bar coordinate system:

  • Map Bar MapBar Map

A small number of companies will perform another encryption on the basis of GCJ-02, but such coordinates are not universal and are only suitable for specific company maps.

 

5. Mobile Unicom Base Station

The mobile base station adopts the cell system, covering a range of several kilometers; while the China Unicom base station adopts the large-area system, which can cover dozens of kilometers; the frequency and energy of the radiation determine the coverage. From another point of view, from the point of view of energy conservation: mobile phone radiation is large, the base station radiation is small (GSM), otherwise the mobile phone radiation is small, the base station radiation is large (CDMA).

Unicom Unicom Base Station Format MNC MCC LAC CELLID

MNC (Mobile Network Code, mobile network number) is used to identify the mobile network to which a mobile customer belongs.

MCC (Mobile Country Code) is used to uniquely identify the country to which a mobile customer belongs. It consists of three decimal digits (000-999), for example, the MCC in our country is 460.

LAC (Location Area Code, Mobile Location Area Code) is an area set up for paging, covering a geographical area. In the beginning, it was generally divided by administrative area (a county or a district), but now it is very flexible, according to the number of paging Divide. When the paging volume under a LAC reaches an early warning threshold, it must be split. In order to determine the location of the mobile station, the coverage area of ​​each GSMPLMN is divided into many location areas, and the location area code (LAC) is used to identify different location areas. The Location Area Code (LAC) is included in the LAI and consists of two bytes, encoded in hexadecimal. The available range is 0x0000-0xFFFF, the code group 0x0000 and 0xFFFE cannot be used (see GSM specification 03.03, 04.08 and 11.11). A location area may contain one or more cells.

CELLID (Cell Tower ID, mobile base station number), cell refers to the geographical area covered by a DVB-T signal, this signal is transmitted by one or more transmitters using a single frequency, each transmitter can transmit a specific transport stream . The unit may also include the area covered by the repeater. There can be overlapping areas between two adjacent cells. Within a network identified by the original network identifier (original_network_id), the cell identifier (cell_id) that identifies a cell is unique.

 

6. Telecom base station format

SID NID BID

SID and NID determine the network you are using now and see if you are roaming. BID is mainly to determine which base station you are using.

 

2. How to convert the coordinates

  • GPS to Google Maps  http://ditujiupian.com/service/api.ashx?key=your KEY&  feature phone
       type=wgs2gcj&lng=116.420817&lat=39.906987
  • GPS to Gaode map: same as above
  • GPS to Baidu Map  http://ditujiupian.com/service/api.ashx?key=your KEY&type=wgs2bd&lng=116.420817&lat=39.906987
  • GPS to map map  http://ditujiupian.com/service/api.ashx?key=yourKEY&type=wgs2mb&lng=116.420817&lat=39.906987
  • Google Maps to GPS  http://ditujiupian.com/service/api.ashx?key=yourKEY&type=gcj2wgs&lng=116.420817&lat=39.906987
  • Google Maps to Baidu Maps  http://ditujiupian.com/service/api.ashx?key=your KEY&type=gcj2bd&lng=116.420817&lat=39.906987
  • Baidu map to GPS  http://ditujiupian.com/service/api.ashx?key=your KEY&type=bd2wgs&lng=116.420817&lat=39.906987
  • Baidu map to Google map  http://ditujiupian.com/service/api.ashx?key=your KEY&type=bd2gcj&lng=116.420817&lat=39.906987
  • Baidu map to Gaode map: same as above
  • Map it to GPS  http://ditujiupian.com/service/api.ashx?key=your KEY&type=mb2wgs&lng=116.420817&lat=39.906987
  • Base station to GPS  http://ditujiupian.com/service/api.ashx?key=your KEY&type=cellid2wgs&lac=4340&cellid=13178
  • Base station to Google map  http://ditujiupian.com/service/api.ashx?key=your KEY&type=cellid2gcj&lac=4340&cellid=13178
  • The base station goes to the Gaode map: same as above
  • Base station to Baidu map  http://ditujiupian.com/service/api.ashx?key=your KEY&type=cellid2bd&lac=4340&cellid=13178
  • latitude and longitude to address (earth: lnglat2address-wgs, Mars: lnglat2address-gcj, Baidu: lnglat2address-bd)  http://ditujiupian.com/service/api.ashx?key=your KEY&type=lnglat2address-wgs&lng=116.420817&lat=39.906987

The above services are provided by the coordinate correction website. For more details, you can visit the website and apply for a key. http://ditujiupian.com/

 

3. Algorithm for converting Baidu coordinates to Gaode coordinates

1. Linear conversion

var TO_GLNG = function (lng) { return lng-0.0065 ;};
var TO_GLAT = function (lat) { return lat-0.0060;};

 

2. Spherical coordinate conversion

bubuko.com, bubuko
#include <math.h>    
const double x_pi = 3.14159265358979324 * 3000.0 / 180.0;  
void bd_decrypt(double bd_lat, double bd_lon, 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); }
bubuko.com, bubuko

 

3. Network interface

http://ditujiupian.com/service/api.ashx?key=您的KEY&type=bd2gcj&lng=116.420817&lat=39.906987

 

----------------------------------------------------------

Another article about coordinate conversion, "Why are your coordinates inaccurate?

http://www.cnblogs.com/milkmap/p/3627940.html

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326907116&siteId=291194637