How to access geotag information?

How to access geotag information?

Till Harbaum
Karma: 664
2010-01-07 12:30 UTC
Hi,

i am planning to add a feature to Maep so that it displays small thumbnails of geotagged media data. How do i access geotags? I suppose the correct way to access any media files is to go via tracker. Are there any examples to request geoinformation from tracker? A little googling reveals many pages saying that "tracker doesn't index geotags". Is this true? What is the correct way to get geotags of all media stored on the device? It sure doesn't make much sense to ask tracker for a list of all media and than try to extract geotags from them. This would take forever on a big media collection.

Regards,
Till
  •  Reply

Re: How to access geotag information?

2010-01-07 14:43 UTC
Till Harbaum on 01/07/2010 06:30 AM wrote:
> How do i access geotags?


With libexif. GPS coordinates are in the EXIF data.
  •  Reply

Re: How to access geotag information?

Till Harbaum
Karma: 664
2010-01-07 16:15 UTC
Hi,

Am Donnerstag 07 Januar 2010 schrieb Michael Cronenworth:
> > How do i access geotags?
> With libexif. GPS coordinates are in the EXIF data.
This only works for jpeg images which are only a fraction of media
files stored on an n900.

I was fearing to get some answer like this. This has so many disadvantages:

- We'll have to scan all files in every geotag aware app
- This consumes much CPU power
- This takes a very, VERY long time
- This does not work with MP3/WAV/PNG/GIF/AVI/...
- This information can hardly be shared between different apps
- My app has to cache/store this information for all media files to
not be forced to re-scan everything everytime it's being started

I am afraid this will mean that such a project doesn't make much sense.

Thanks,
Till
  •  Reply

Re: How to access geotag information?

Cornelius Hald
Karma: 573
2010-01-08 11:02 UTC
Michael Cronenworth wrote:
> Till Harbaum on 01/07/2010 06:30 AM wrote:
>> How do i access geotags?
>
>
> With libexif. GPS coordinates are in the EXIF data.

I didn´t really look into this, but at least for image files tracker
seems to be prepared to handle geo tags. Not sure if this functionality
is available in reality, but have a look at the file
/usr/share/tracker/services/image.metadata

There are two properties that look interesting: Image:Location and
Image:Sublocation

Anyways, it´s just a guess.
Conny
  •  Reply

Re: How to access geotag information?

2010-01-08 14:35 UTC
Cornelius Hald on 01/08/2010 05:02 AM wrote:
> Anyways, it´s just a guess.

That's for images only. Till wants it for *all* file types.
  •  Reply

Re: How to access geotag information?

Ivan Frade
Karma: 259
2010-01-08 16:09 UTC
Hi,

El vie, 08-01-2010 a las 15:35 +0100, ext Michael Cronenworth escribió:
> Cornelius Hald on 01/08/2010 05:02 AM wrote:
> > Anyways, it´s just a guess.
>
> That's for images only. Till wants it for *all* file types.

In Fremantle, tracker 0.6 can store the location of Images (basically
the geotags the user set in the image viewer). Those properties contain
text, so you need to use the location API to turn them into coordinates
for your map application.

About other media types... there is no other format containing
location, so tracker cannot fill that information by itself.

Our idea for the future is that _applications_ can set location values
for the files (e.g. a shopping-list note in the supermarket, so i can
see it when i arrive there). This will be supported in tracker 0.7
(ready to play with on desktop), but not in 0.6/fremantle.

Some remarks to the previous comments in the thread:

1) EXIF is not the only format for metadata in images. There is XMP or
IPTC, and you need a hierarchy to choose between them, and handle broken
files and ... well, don't underestimate the problem

2) The idea of scanning and monitoring the filesystem means basically to
duplicate the functionality of tracker (and probably the code ;))

3) Scanning and reading files is not CPU expensive, but needs a lot of
IO, and IO is a very precious resource.

Regards,

Ivan

  •  Reply

Re: How to access geotag information?

Till Harbaum
Karma: 664
2010-01-08 19:45 UTC
Hi,

Am Freitag 08 Januar 2010 schrieb Ivan Frade:
> About other media types... there is no other format containing
> location, so tracker cannot fill that information by itself.
In this web site you can download wav files which claim to be geotagged:

http://www.freesound.org/samplesViewSingle.php?id=73423

That's why i thought the maemo-recorder could do the same.

> see it when i arrive there). This will be supported in tracker 0.7
> (ready to play with on desktop), but not in 0.6/fremantle.
Using tracker 0.6 limited to images is a start. Do you have example
code somewhere? I have never worked with tracker before.

> 3) Scanning and reading files is not CPU expensive, but needs a lot of
> IO, and IO is a very precious resource.
Whatever the limit is: You don't want to do this in every single app.

Reards,
Till
  •  Reply

Re: How to access geotag information?

Ivan Frade
Karma: 259
2010-01-11 09:38 UTC
Hi,

El vie, 08-01-2010 a las 20:45 +0100, ext Till Harbaum / Lists escribió:
> Hi,
>
> Am Freitag 08 Januar 2010 schrieb Ivan Frade:

> > see it when i arrive there). This will be supported in tracker 0.7
> > (ready to play with on desktop), but not in 0.6/fremantle.
> Using tracker 0.6 limited to images is a start. Do you have example
> code somewhere? I have never worked with tracker before.

We have some (basic) documentation here:
http://live.gnome.org/Tracker/Documentation/RDF-Query

Tracker is a daemon visible in DBus. In python, connect to the daemon
directly (an example in my own pet-project [1]). In C, use
libtracker-client (some examples in MAFW's tracker backend).

There should be some libtracker-client gtk-doc documentation, but it
looks like library.gnome.org only contains the last unstable version
(0.7). This is useless for you, the API in 0.7 is _completely_ different
from 0.6 API. Don't get confused with that.

The properties you can use in your queries are defined here:
http://git.gnome.org/browse/tracker/tree/data/services?h=tracker-0.6

You can also monitor dbus while using the image-viewer to see some
queries flying.

Regards,

Ivan

[1]
https://garage.maemo.org/plugins/ggit/browse.php/?p=mussorgsky;a=blob;f=src/tracker_backend.py;h=e956f38668066423fa9538a1cb69a4082f776fa8;hb=9d71d07b572bdf50114484b28a0e188d742fcdfc


  •  Reply

Re: How to access geotag information?

Till Harbaum
Karma: 664
2010-01-14 19:51 UTC
Hi,

i just realized that we are talking about completely different things when we say "geotagged". I am relating to GPS positions. You seem to relate to place names. I just learned that the n900 does not write GPS tags. Correct?

Unfortunately that completely spoils the idea to use maep to display these. Converting GPS positions into place names and back to coordinates will likely cause most images to show up pretty far from their real location and even worse will make them all show up at the same place.

Is there a way to enable real GPS tagging? Is there any reason why this isn't happending? It's so obvious that just i didn't expect this not to be there.

Till

Am Montag 11 Januar 2010 schrieb Ivan Frade:
> Hi,
>
> El vie, 08-01-2010 a las 20:45 +0100, ext Till Harbaum / Lists escribió:
> > Hi,
> >
> > Am Freitag 08 Januar 2010 schrieb Ivan Frade:
>
> > > see it when i arrive there). This will be supported in tracker 0.7
> > > (ready to play with on desktop), but not in 0.6/fremantle.
> > Using tracker 0.6 limited to images is a start. Do you have example
> > code somewhere? I have never worked with tracker before.
>
> We have some (basic) documentation here:
> http://live.gnome.org/Tracker/Documentation/RDF-Query
>
> Tracker is a daemon visible in DBus. In python, connect to the daemon
> directly (an example in my own pet-project [1]). In C, use
> libtracker-client (some examples in MAFW's tracker backend).
>
> There should be some libtracker-client gtk-doc documentation, but it
> looks like library.gnome.org only contains the last unstable version
> (0.7). This is useless for you, the API in 0.7 is _completely_ different
> from 0.6 API. Don't get confused with that.
>
> The properties you can use in your queries are defined here:
> http://git.gnome.org/browse/tracker/tree/data/services?h=tracker-0.6
>
> You can also monitor dbus while using the image-viewer to see some
> queries flying.
>
> Regards,
>
> Ivan
>
> [1]
> https://garage.maemo.org/plugins/ggit/browse.php/?p=mussorgsky;a=blob;f=src/tracker_backend.py;h=e956f38668066423fa9538a1cb69a4082f776fa8;hb=9d71d07b572bdf50114484b28a0e188d742fcdfc
>
>
>

  •  Reply