4

I need to take some photos capturing the GPS coords and direction of camera. I'm using an iPhone 8+ and this is the relevant output I get from Acute Photo EXIF Viewer:

EXIF GPS Tags
GPSDestBearing:74041/49085
GPSDestBearingRef:M
GPSImgDirection:74041/49085
GPSImgDirectionRef:M

I have searched for about an hour to find a way to convert the bearing/direction into degrees, and every source said the numbers should be between 0-359.99 (i.e. degrees from N, clockwise). So what does 74041/49085 mean and how can it be converted into degrees?

I understand the Ref tags have M for Magnetic North. I need the direction using North the same way that Google Maps does, which is True North. Assuming I can get the direction as degrees from Magnetic North, how would I convert them to degrees from True North?

2
  • Does look very odd. Have you tried taking a photo knowing you are point North or South to see what the values are, you might be able to discern some sort of value sequence?
    – Hornbydd
    Commented Apr 4, 2020 at 15:32
  • I did with a couple of photos. Really I should do what you say methodically, maybe I'll see a connection if I compare the numbers for each of N E S and W.
    – msm1089
    Commented Apr 5, 2020 at 23:15

1 Answer 1

10
+50

I give it a try, but as @Hornbydd said in comment, you would better do some testing to validate or invalidate this hypothesis.

Hypothesis

On floating point division

It may be related to how numbers are stored by the device, in other words, how are handled integer vs floating point arithmetic. Maybe the device manufacturer decided to represent floating point number as an approximate given by two integer (which division tends towards the "right" value) and because it is sufficient to store it this way. In that case you can spare memory.

For example, if you simply take the division (here in Python):

>>> import math
>>> 180*(74041/49085)/math.pi
86.42633820776467

Now you can try to figure out how is defined the 0 for your device (see e.g. Fig.1). This thread can help: https://stackoverflow.com/questions/24516794/what-sensor-can-be-used-to-detect-rotation-when-upright
And this is some documentation from Apple: https://developer.apple.com/documentation/coremotion/getting_raw_gyroscope_events

Device axes
Fig.1 Apple definition of reference frame for their smartphones

But beware, there can be some extra rotation(s) to apply between the coordinate system of the device, and the one used by the camera (they also can be the same of course, you have to figure it out).

On Norths

On your second question, I let you explore the solution on your own because it depends on where you actually are (i.e. in which country).
There is two things;

Magnetic declination

First, the magnetic declination which relate the true North as defined by the rotation axis of the Earth and the magnetic North. It is possible that this difference, which slowly varies over time because of the movement of the magnetic North, is embedded somehow in your device, hence the two same numbers. If not the case, you have to take this difference into consideration.

Meridian convergence

Then, depending on what you want to do with your data, especially if you would like to map them, i.e. project them on cartographic plane, you would have to take into account the difference between the true North defined by the rotation axis of the Earth, and the cartographic North of the place (country mainly) you're living. Therefore, it depends on how is your local cartographic projection defined. This difference is called meridian convergence (Fig. 2).

Meridian convergence
Fig.2 The meridian convergence



Further readings

  • On floating point arithmetic

https://stackoverflow.com/a/24588581/6630397
https://en.wikipedia.org/wiki/Floating-point_arithmetic
https://web.fhnw.ch/plattformen/llp/vorlesungsunterlagen/threading/intandfloat.pdf

Checkout the StackExchange questions!

2
  • Thanks - I'll try your suggestions out after gathering the values for the cardinal directions. If it turns out to be some sort of memory saving method I'll be surprised tho, as I turned up nothing of that sort when Googling.
    – msm1089
    Commented Apr 5, 2020 at 23:20
  • You were right - they were just fractions that gave a range from 0-360
    – msm1089
    Commented Apr 12, 2020 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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