gps coordinates

Topics: ÐTools development forum, User Forum
Jan 1, 2008 at 8:40 PM
I've problems to get the GPS coordinates from the exif.
I'm not an expert programmer and I'm stuck with the Urational value.
GPS coordinates is an 3 dim array and I don't know how to retrieve a string or a decimal value for that.
I don't know if it exists or not, but why don't you create a method to directly access to the calculated value for the gps coordinates lat and long?

Jan 1, 2008 at 9:47 PM
ok , I think I found the way to calculate the value
Dim degreeslat As Double = ef.GPSSubIFD.GPSLatitude(0).Numerator
Dim minuteslat As Double = ef.GPSSubIFD.GPSLatitude(1).Numerator
Dim secondslat As Double = ef.GPSSubIFD.GPSLatitude(2).Numerator
Dim decimallat As Double = degreeslat + (minuteslat / 60) + (secondslat / 3600)
the same for the longitude

but maybe I found a bug because the GPSLatitude(1) and GPSLongitude(1) are always = 1 (verified with other sw that this is not the correct value)
check issue tracker for bug.

Jan 12, 2008 at 10:41 AM
Hi, and thank you for your investigation


There are casting operators (CType in VB / implicit/explicit in C#), so you can cast URational to Double, String and SRational and cast Single, Double, String and SRational to URational.
It is
  • Dim x as Double = CType(MyURational,Double) (in VB you can also simply assign URational to Double
  • Double x = (Double) MyURational; (in C# casting is always required)
I case I'll understand GPS coordinates I can create some more intuitive way to work with them.


As I wrote in Issue Tracker ( it will be very helpful for me if you can send me some images with embedded GPS, because I have no one :-(.
Looking in EXIF specification - it seems that there is a bug in ĐTools.
Dec 6, 2008 at 3:04 AM