3

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?

  • What software are you using? Some software will allow you to create a CRS with your local origin. Are the points in metres from the origin? Can you give an example of some of the points you have? – Michael Stimson Jun 18 at 1:14
  • Currently, I am looking to achieve this without any software. Yes the points are in metres from the origin. Apparently its the lidar data, below is the example of one such point 0.12 4.8 -7.6 50 (x y z intensity) – ewaolx Jun 18 at 1:32
  • You can project to geographic coordinates with OGR if you're keen on writing your own package. You will need to define your own CRS with a vertical datum (ellipsoidal perhaps) and offset the standard false easting and northing with your known starting point. – Michael Stimson Jun 18 at 1:36
  • Thanks for the info. Can you please elaborate more on this technique, as I am new to these type of conversions and standards. – ewaolx Jun 18 at 1:46
  • 1
    It might be simpler to add the values to your known coordinate, but it will need to be UTM (Universal Transverse Mercator), what is your origin for the example point? Are the relative coordinates positive up, positive east, positive north? what programming language are you using? I know python, VB6, VBA, VB.net, C# and C++ (and others that aren't used any more) it would be more useful to frame an answer in a programming language that you understand. – Michael Stimson Jun 18 at 1:56
4

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).

  • Thanks so much for the detailed response! Will certainly take this route. – ewaolx Jun 18 at 2:56
  • I think I missed the minor detail regarding this conversion. As I mentioned, I have the long, lat corresponding to the origin of my local coordinate system. But the orientation of my coordinate system is not aligned with the GPS(the 0 degree of my local frame is not necessarily pointing North). So considering this information, what additional steps should I need to perform, before going ahead with the steps mentioned above. As far as I think, I will need to rotate each point by the angle my coordinate system makes with the North. Please share some info regarding this. – ewaolx Jun 18 at 19:31
  • Your data does not look like bearing and distance rather an offset X and Y from an origin. What does your data look like when offset using the method outlined? Try a small section of a file in Python (quicker to write) and see if it aligns (within accuracy) with known to be accurate data. – Michael Stimson Jun 18 at 23:14
  • Sure, I will try small section of my data, but my origin is not pointing to the North(0 degrees). So when I add UTM based offset to each point in my data, will it transform to correct UTM as I am not considering the orientation of my coordinate system. – ewaolx Jun 18 at 23:21
  • The LiDAR data I work with is all projected and absolute, I find the data you have to be odd though I do understand that some drone data is reduced to a local datum to match other data. Your origin doesn't point anywhere it's a point and therefore has no orientation. Did you get metadata with your LAS data or can you contact the source of the data? I have assumed that this data is UTM, as that is the most common, reduced to a local datum but you're right it could be any projected coordinate system. – Michael Stimson Jun 18 at 23:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.