gps coordinates

Topics: ÐTools development forum, User Forum
Jan 1, 2008 at 8:40 PM
hi,
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?

thanks.
Lenny
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.

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

URational

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.

Bug

As I wrote in Issue Tracker (http://www.codeplex.com/DTools/WorkItem/View.aspx?WorkItemId=14597) 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
123123