Longitude and latitude encoding conversion

Source: Internet
Author: User

As we all know, maps of all navigation software, including lt, are the set of coordinates of longitude and latitude. Then, the GPS longitude and latitude signals can be matched before being applied to navigation.
However, due to national policies, lt cannot be used to locate a target directly by longitude and latitude. For this reason, lt uses a work und: The Phantom code.

What is the pattern of this ghost code? I hope you can study the following:

A total of 12 bits are encoded in three sections, in the form of ABCD-efgh-ijkl.
You can check your machine.

However, in fact, this method of separation is a compromise and a lie. It cannot openly confront National Policies and Regulations, so it has to make some disguise.

Let's try and locate 6993-0563-3391 to see where it is. Everyone is familiar with this point. Let's name it.
Then, change the number to 4993-0563-3391. Where can I see it? Well, it's about 200 metres south of.
Let's change the number to 8993-0563-3391. Where is it? Well, it's about 200 metres north of point.
Well, we have found some regularity. Next:
So let's look at the application: 9993-0563-3391, where is it? Well, it's good. For example, it's about 300 metres north of.
Now there is a question. We need to carry it! How to carry it? Simple input 0993 ...... It must be carried. Where should I go?
If you try it, change the first digit in section 2nd (that is, the 5th-digit 12-bit encoding) from "0" to "1 ",
Let's enter 0993-1563-3391.
Good! If it appears around 400 metres north of Point!

Now we have found a rule.
Let's continue to observe and get:

The 12-digit code contains 1st digits. If each value is 1, the system moves about 100 to the north. If the value is 1, the system moves about 100 to the south;
2nd digits move 100 kilometers south every time one minus one;
The number is 3rd digits. Every time one minus one digit, it will move 1 kilometer to the west;
The number is 4th digits. After each minus 1, it is about 7 meters south;
5th digits, one kilometer north after each addition;
The number is 6th digits. Every time one minus one, the number is shifted to the West by 100;
7th digits move 100 kilometers to the west every time one minus one;
8th digits, moving 10 kilometers to the west every time one minus one;
The number is 9th digits. Every time 1 is added, the system moves 10 meters to the east;
The number of digits is 10th. Every 1 minus, the system moves 1000 kilometers south;
The number of digits is 11th. Every 1 minus, it is 10 kilometers south;
The number of digits is 12th, and every 1 minus the number is 1000 km.

Now we know a little bit about it. This "Phantom code" is an XY coordinate system.

Let's try. If we define an origin point and find a place 1234.5 west of the origin point, how can we calculate the spiritual map code?
According to the above test:
1234.5 km to the west, that is, 1 minus the 12th digits of the origin point (representing 1000 km to the west), 2 minus the 7th digits (representing 200 km to the west ), 8th minus 3 (representing the west 30 kilometers), 3rd minus 4 (representing the West 4 kilometers), 6th minus 5 (representing the West 500 meters ).

Let's perform an operation to see if it is correct. First, we set up an origin. For the convenience of calculation, we found an address called "Middle East Auto Repair" in Beijing. The figure code is 6993-0864-6391. We set it as the starting point (set it as the starting point to show the distance of the destination to see if it is 1234.5 kilometers ).
Based on the above algorithm, we calculate:
6993-0864-6391
There are already too many other
6953-0341-6390

Click "destination", "Next page", select "encoding location", and enter the 695303416390 calculated as the destination. Now we can see that the new coordinates of our positioning are indeed 1234.5 km west of the origin (starting point.
This proves that our calculation is correct.

In the 12-bit phantom code
The number is 1st digits. After each addition of 1, the system moves about 100 m to the north. After each subtraction of 1, the system moves about 100 m to the south;
2nd digits move 100 kilometers south every time one minus one;
The number is 3rd digits. Every time one minus one digit, it will move 1 kilometer to the west;
The number is 4th digits. After each minus 1, it is about 7 meters south;
5th digits, one kilometer north after each addition;
The number is 6th digits. Every time one minus one, the number is shifted to the West by 100;
7th digits move 100 kilometers to the west every time one minus one;
8th digits, moving 10 kilometers to the west every time one minus one;
The number is 9th digits. Every time 1 is added, the system moves 10 meters to the east;
The number of digits is 10th. Every 1 minus, the system moves 1000 kilometers south;
The number of digits is 11th. Every 1 minus, it is 10 kilometers south;
The number of digits is 12th, and every 1 minus the number is 1000 km.

Based on this, we further analyze the factors that affect the east-west direction as the longitude element and the North-South direction as the latitude element. If the impact is large, it is regarded as high, and if the impact is small, it is regarded as low. For example, the maximum effect of 12th bits on the longitude is the highest bit of the longitude, and that of the 9th BITs has the least effect on the longitude. According to this principle, it is not difficult to get the result:
Longitude: 12, 7, 8, 3, 6, 9;
Latitude;
We use an actual location to illustrate that the coordinates of the sihui Bridge in Beijing are 7981-0364-6391 in the Spirit map. According to the above arrangement rules, the longitude value is 1 6 4 8 3 6, and the latitude value is 3 9 9 0 7 1. According to my field test, the location of sihui bridge was 116 degrees 29.062 points on the east longitude and 54.395 points on the north latitude. The comparison between the two allows us to make such a judgment. The Phantom code is a two-digit integer plus a four-digit decimal latitude and longitude (omitted the longitude of a hundred digits ). Here, the longitude value of the sprite code is 164836 = 16.4836 degrees = 16 degrees 29.016 points, and the latitude value is 399071 = 39.9071 degrees = 39 degrees 54.426 points. The error is very small compared with my actual measurement, this error is not only within the allowable range of a simple GPS measurement error, but also within the s of the cursor position when a point is retrieved on an electronic map.
I used several distant points nationwide for verification. I found the calibrated Ozi maps in Kunming and Guangzhou on the Internet as the benchmark for comparison. At the intersection of Renmin Road and qingnian Road, the lingtu code is 5513-4427-3200. Based on the above calculation, the east longitude is 102.7143 degrees = 102 degrees 42.858 points, and the north latitude is 25.0453 degrees = 25 degrees 2.718 points; the lingtu code of Tianhe overpass in Guangzhou is 6316-3033-0211. According to the above calculation, it is east longitude 113.3100 degrees = 113 degrees 18.600 points, north latitude 23.1366 degrees = 23 degrees 8.196 points. Compared with the longitude and latitude in the Ozi map, there is no error that the eyes can tell.
As for the number of digits in the longitude, we can consider this. In the spirit map, we can take a bit of 9902-7535-1337 for the west part of China. The conversion result is 73.5051 degrees for the east longitude and 7803-0850 for the east part, the conversion result is a longitude of 135.0085 degrees. Therefore, if the maximum longitude bit is greater than 5, the hundred bits are 0. If the longitude bit is smaller than 5, the hundred bits are 1.

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.