GeoClue: The Geolocation Service

Geoclue is a D-Bus service that provides location information. The primary goal of the Geoclue project is to make creating location-aware applications as simple as possible, while the secondary goal is to ensure that no application can access location information without explicit permission from user.

Geoclue is Free Software, licensed under GNU GPLv2+. It is developed for Linux.

The aim of project is to utilize all possible sources of geolocation to best find user's location:

  • WiFi-based geolocation (accuracy: in meters)
  • GPS(A) receivers (accuracy: in centimeters)
  • 3G modems (accuracy: in kilometers, unless modem has GPS)
  • GeoIP (accuracy: city-level)

WiFi-based geolocation makes use of Mozilla Location Service. If geoclue is unable to find you, you can easily fix that by installing and running a simple app on your phone.

Geoclue used to also do (reverse-)geocoding but that functionality has been dropped in favor of geocode-glib library.

Discuss & contribute

How to use it from an application

Here you can find documentation for the D-Bus API: http://www.freedesktop.org/software/geoclue/docs/

Here is an example of how a C application can locate its user: http://cgit.freedesktop.org/geoclue/plain/demo/where-am-i.c

Get the source

The code is licensed under the GNU LGPL and is available as a tar-ball and in a Git repository. You can also browse the source.

Latest releases available here.

Git repository:

  • git clone git://anongit.freedesktop.org/git/geoclue
    For help with Git, see Usage notes here on freedesktop.org and documentation on Git homepage.

History

Geoclue got started during GNOME Summit 2006 in Boston. At least Keith Preston and Tuomas Kuosmanen can be blamed.

There was a total rewrite after version 0.9. Use tag "0.9" (as in git checkout 0.9) if you need the old code. A copy of the Geoclue wiki page from that time is preserved here.

There was yet another rewrite that we call geoclue2. The first version to introduce the re-write was 1.99. You can find the rationale for the re-write here but I was way too lazy/busy to preserve the previous wiki page.