From geographical coordinates to local coordinates

Description:

There are coordinates of objects in the format returned by the Google Api. That is, latitude, longitude, etc.

For example, I have 3 objects, take the object (1) its local coordinates become [0,0]. Object (2) is located 5 meters to the north and 2 meters to the east relative to object (1), its coordinates should become [5,2]. Object number (3) is located 75 meters to the south and 35 meters to the west, its coordinates should become [-75, -35].

Question:

How to translate objects to the local coordinate system knowing their latitude and longitude, please help?

Visible solutions:

  • There was an idea to get the distance between objects using the following solution. (however, here the accuracy is in km, how can I increase it to meters?) And then calculate the angle between the geographical coordinate of the north pole, object (1) (which is taken as [0,0] in local) and object (2) and already knowing the distance and angle calculate the coordinate of object (2) in local coordinates. Will there be a distortion at the angle if I apply similar calculations? The earth is not square .

P.S. It is necessary to calculate on the phone, and such calculations will be up to 50 pieces at a time, or even more, preferably the most optimal solution, but accuracy is important up to 1 meter. (Similar calculations on the phone cause me to concerns)

P. P. S. Can you please provide the C# code for solving this issue?

P. P. P. S. According to the idea, this is all similar to a system where the object (1) is a person, and you need to calculate the position of objects in meters in local coordinates (meters). However, I couldn't find how this is implemented in gps navigators.

Author: Amil Shafeev, 2017-07-31

1 answers

The positioning accuracy is determined by the accuracy of the coordinates. If Google returns you kilometers, then there will be kilometers. Returns meters - there will be meters.

Yes, of course, there will be distortions. Read about projections of coordinates on the plane. Choose what you like best-equiangular, equilateral, or any other.

After you translate the geographical coordinates to the coordinates on the plane, subtracting the y/x of one object from another is not possible for you it will be difficult.

As long as the numbers are less than 1,000,000, you can use any solution, you will not notice any speed loss, you will spend more on the display.

There is a ready-made solution for all occasions, it is not necessary to invent your own bicycle.

 2
Author: Lunar Whisper, 2017-08-01 10:17:49