[Telepathy] Geolocation in Telepathy

Jussi Kukkonen jhkukkon at cc.hut.fi
Sun Mar 2 12:38:53 PST 2008


Hi, sorry for taking my time with replying...

> On Wed, Feb 27, 2008 at 3:03 PM, Simon McVittie
> <simon.mcvittie at collabora.co.uk> wrote:
>> We at the Telepathy project are interested in integrating
>> geolocation into our presence APIs, implemented using things like 
>> <http://www.xmpp.org/extensions/xep-0080.html>. Since GeoClue is 
>> designing a D-Bus API for geolocation, it would make sense for us
>> to use the same D-Bus representations for locations.

For others' information: we've been chatting with Simon on #geoclue
(irc.gimp.org) quite amicably and even productively: Iain already fixed
a design weirdness based on Simons feedback. I hope others join the
channel too, discussion and feedback is really welcome.

XEP-0080 support in telepathy sounds seriously cool, and I think this is
a prime example of what geoclue is for... I definitely think the new API
 should be used, and not the current freedesktop.org code (more on this
below).

Using a dictionary for position data is somehow compelling, but I am
worried about the "heaviness" and somehow it feels conceptually wrong: a
Position is latitude/longitude (and possibly altitude) in WGS-84, not a
varying collection of values like Address... That said, it is an
interesting idea, one that I hadn't thought of.


Henri Bergius wrote:
> Jussi, what is the status of the GeoClue API rewrite?

I'd say we've now passed the features of the current/old implementation,
and should push this code to freedesktop now: large architectural
changes are not expected so others could comfortably work on the code
base at the same time. Also, client app developers could start working
with the API and comments would be really welcome right about now...

The "actual APIs" (Position, Address, Velocity, Geocode, ReverseGeocode)
are solid I think. Same for the C wrappers.

We have the following providers implemented:
    example -- a minimal position provider example
    geonames -- geocode, reversegeocode
    gpsd -- position (velocity not implemented yet)
    gypsy -- position, velocity
    hostip -- position, address
    manual -- address
Still missing plazes and yahoo from the "old" implementations. These
should not be difficult.

The master API is fairly good IMO, but we might need some small changes
still. The implementation can currently handle Position and Address
interfaces (the most difficult ones, I believe). The implementation
works but is fairly untested and needs a bit of refactoring -- I'm
currently working on this.

Stuff on TODO list (not in any particular order, and some items may not
be necessary for a release):
  * master API review
  * test master (position and address interfaces)
  * add velocity, geocode and reversegeocode -support to master
  * add geoclue support to some applications as example
  * implement plazes and yahoo providers

I included a pseudocode client example below to show how the master
works, in case it hasn't been explained.

  Jussi


---

    ## master is a single instance D-Bus service.
    ## It will give us our own client service (and dbus path)
    master = geoclue_master.get_default ()
    client = master.create_client (&path)

    ## set our preferences: we want city-level accuracy and change
    ## signals, allow network use but not GPS use
    client.set_requirements
    	(GEOCLUE_ACCURACY_LEVEL_LOCALITY, 0,
    	 TRUE,
    	 GEOCLUE_RESOURCE_FLAGS_NETWORK)

    ## we want address data
    pos = geoclue_position (GEOCLUE_MASTER_DBUS_SERVICE, path)

    ## ...later in application...
    pos.get_position (&time, &lat, &lon, &alt, &accuracy)

Note that the code does not specify the provider that should be used, it
only sets preferences. When get_address is called the master client will
use the best provider available that fulfills the requirements.
Connecting to PositionChanged signal works similarly.

The same example using a specified provider would look like this:

    pos = geoclue_position ("org.freedesktop.Geoclue.Providers.Hostip",
                            "/org/freedesktop/Geoclue/Providers/Hostip")

    ## ...later in application...
    pos.get_position (&time, &lat, &lon, &alt, &accuracy)

A bit simpler, but if hostip doesn't have the position, you get nothing...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 307 bytes
Desc: OpenPGP digital signature
Url : http://lists.freedesktop.org/archives/telepathy/attachments/20080302/c63b45b0/attachment.pgp 


More information about the Telepathy mailing list