GPS – Converting Local Coordinates to GPS (Lat, Long)

coordinate systemgpsspherical-geometry

I am having the XYZ points in some local coordinate frame. Each point I have, can also be represented as the distance from the origin and the azimuth angle it makes with one of the horizontal axis.

I also have the GPS coordinates(lat,long) and the heading corresponding to the (0,0,0) point of the local coordinate frame.

I need to convert all the points in the lat,long.

The approach I can think of is to use the Destination point given distance and bearing from start point formula from this link, as I have the:

  • starting point(long,lat corresponding to the origin)
  • distance between the origin and the actual point being converted to long,lat

But I am not sure what will be the bearing required in the formula. Does it relate to the azimuth, I have for each point?

Best Answer

Python would be so slow at this, I would use C++. Read your XYZ file using a normal ifstream then use strtok to break apart the single line into tokens and make the string tokens into double.

You will need to find the local WGS UTM coordinate reference system and project your origin to this CRS (sorry the OGR API is offline at the moment). From here you can obtain the local X,Y,Z of your origin, add your offset X,Y,Z, create an OGRPoint from the adjusted X,Y,Z, assign the local WGS84 UTM and then project to EPSG:4326 (WGS84/Geographic).