[Digikam-devel] GPS wrong coordinate conversion?

Gerhard Kulzer gerhard at kulzer.net
Sat Sep 9 13:53:29 BST 2006


Am Samstag, 9. September 2006 11:19 schrieb Arnd Baecker:
> Hi Gilles,
>
> On Sat, 9 Sep 2006, Caulier Gilles wrote:
> > Le Vendredi 08 Septembre 2006 05:43 PM, Arnd Baecker a écrit :
> > > Hi,
> > >
> > > maybe I am wrong, but I think that the conversion in the example
> > > given at
> > > http://docs.kde.org/development/en/extragear-graphics/digikam/using-kap
> > >p-ca mera.html#using-kapp-gps is not correct:
> > >
> > > """The positional data (e.g. 13.44088333) must be converted into H.MS
> > > format (13.235990) and split into its constituents as shown in the
> > > given example."""
> > >
> > > which leads to the entry
> > >   add Exif.GPSInfo.GPSLatitude Rational "13/1 23/1 5990/100"
> > >
> > > Doesn't 13.44088333 convert to: 13 26 27.18:
> > >   int(13.44088333)       = 13
> > >   int(0.44088333*60)     = 26
> > >   (0.44088333*60-26) *60 = 27.18
> > >
> > > The converter at http://www2.comp.polyu.edu.hk/~04329143d/Location.html
> > > also gives these numbers.
> > > If this is correct, it should read
> > >   add Exif.GPSInfo.GPSLatitude Rational "13/1 26/1 2718/100"
> > >
> > > The other way round, "13/1 23/1 5990/100"
> > > would correspond to: 13.399972.
> > >
> > > Best, Arnd
> >
> > Arnd,
> >
> > The code relevant of GPS position decoding is in this source file :
> >
> > http://websvn.kde.org/trunk/extragear/graphics/digikam/libs/widgets/metad
> >ata/gpswidget.cpp?rev=580664&view=auto
> >
> > Look the method decodeGPSPosition() at end of file.
>
> I think that the code in the routine PSWidget::decodeGPSPosition
> is alright.
> It is just the example in the documentation which I cannot reproduce
> (Maybe I am messing up things, as I don't have any experience
> with GPS and all the coordinate stuff...).
>
> > I'm busy this week end to check if something is wrong...
>
> No problem - nothing urgent anyway ;-)
>
> > Gerhard, can you check this part please. Thanks in advance.
>
> I just checked the GPS plugin with two different places
> (using exiv2 to add GPS info) and it seems to work fine
> (of course I cannot check it precisely due to the lack of zooming
> and also not to the accuracy of a few meters
> because of the scale of the map - don't  get me wrong, no criticism
> here, I know that further GPS stuff is post 0.9, and all this is a
> great start!!)
>
> Many thanks, Arnd
>
Well there are no hard feeling here, rather the contrary. I'm still a bit 
puzzled because I used a HP calculator (which is usually a rock-solid 
reference) to make the conversion. It still gives me the same (wrong values). 
I believe you are right.

By the way, I recently updated the maps.google interface to include a marker 
at the spot of the location. When you zoom in you should be able to verify 
your coordinates. I will do that too: take coordinates from maps.google, 
convert them stick them into a picture and open maps.google from digikam. 
They should match exactly.
Gerhard

-- 
http://www.gerhard.fr



More information about the Digikam-devel mailing list