Geoclue: Location Information Retrieval for Moblin 2.0 Linux

Update: Mar 29, 2011 MeeGo (v1.1 released Oct 2010) is the successor of Moblin 2.0. MeeGo still uses GeoClue as a Location Service for providing geolocation data. However, MeeGo has gained a robust set of APIs that utilize Qt. It is strongly encouraged that application developers code to the QtMobility Location APIs, which provide geolocation data. The Qt APIs are guaranteed to be a stable part of the MeeGo APIs, while the GeoClue APIs are not. However, the current implementation of the Qt Location APIs utilizes GeoClue for retrieving geolocation data on MeeGo devices. It may still be of interest to the reader to learn about how GeoClue works (article below), but LBS apps should code to the Qt Location APIs.
•          Geoclue

Geoclue is a geoinformation service that will be included in Moblin 2.0. It uses multiple providers (like Gypsy, gpsd, Hostip, Geonames, etc...) to provide more than the Position/Velocity information given by most location-based APIs. For example, it can also give postal address information based upon your current location. With Geoclue, a GPS device isn't the only way to judge your current position. Providers are included that can estimate your position based on GSM (cell towers) and IP / Mac address.

This article will briefly describe what you can do, as a developer, with Geoclue. A complete API[i] and tutorial[ii] are available at

•             The Geoclue Master Provider

Selecting a provider to use in Geoclue normally requires some knowledge about the hardware that is being used. You would not be able to use the GPS providers (Gypsy and Gpsd) without a GPS device. Likewise, only a compatible phone can get its position using GSM by communicating with cell towers. You may also need to know something about your environment. Providers using Wi-Fi, GPS satellites, and Cell towers will only work as long as you can get a signal from their respective service. Additionally, there are providers that will only give Position information, and there are others that will only give Address information.

The Master Provider is an attempt to take away all of the complications of choosing the right provider. Just like any other provider, you may query for position and address information. The master will choose the best provider to provide what you are looking for. As the environment changes and a provider's signal goes weak, the master automatically switches to another provider and continues the flow of geoinformation.

The master can be controlled via a D-Bus or C API. As previously noted, a simple example (in C) of how to access the master provider is available at

•             Selecting your own provider

For more control, you may wish to select your own provider. Below is a table of the standard providers[iii] that are included with Geoclue, along with the services that they provide.





Position, Address

A web service that guesses location based on the current IP address.


Position, Address

A web service that gets location based on your current router mac address. Interfaces with a user's Plazes account.



A user-specified address



User-specified address that maps to a router's mac address (home, office).



Gets cell ID data, and estimates location from a web service based upon that data


Position, Velocity

A GPS daemon that supports bluetooth and serial GPS devices


Position, Velocity

A GPS daemon that uses TCP sockets



A web service that converts an address to a position


Geocode, ReverseGeocode

A web service that can convert an address to a position. Conversely, it can also find the nearest address to a given position.

*Gypsy vs. Gpsd: As a note, the user should know that in Moblin 2.0, Gypsy is replacing gpsd as the default GPS daemon. See Gypsy's[iv] site for an article[v] that lists why Gypsy may be considered an improvement over gpsd.

•             How Geoclue data is organized

Geoclue divides its geoinformation into Glib Objects to create a modular separation of different types of data. As viewed in the table above, only certain objects / services are available with each provider.

GeocluePosition: holds position data (latitude, longitude, altitude)

GeoclueAddress: returns a HashTable of address information (divided into "street", "postalcode", "area", "locality", "region", "country", etc...)

GeoclueVelocity: reports velocity information, in the form of speed, direction, and climb

GeoclueGeocode: converts an address to a position (latitude, longitude, altitude)

GeoclueReverseGeocode: converts a position to an address

GeoclueAccuracy: reports the horizontal and vertical accuracy levels. This can be applied to each of the previous services, except for GeoclueVelocity

GeocluePosition, Address, and Velocity each use a method / signal architecture. For example, GeocluePosition has a method geoclue_position_get_position(...) that you can call at anytime to receive the current position. The other approach would be to use GeocluePosition's signal. You can create your own callback method that will  execute anytime a "position-changed" signal occurs. Instead of  continually polling Geoclue for updates, your application will be signaled anytime the position changes.

•             Debugging Geoclue Providers

Each provider has its own daemon that runs when it is asked to. The default location for the Geoclue daemons is in the /usr/libexec directory. Running these daemons in separate terminals can be useful for debugging purposes, if you are having trouble connecting to a provider.

•             Building a new ecosystem

In a world where devices are becoming increasingly more mobile, location information is becoming a  more integral part of a user's experience. Applications with location features are making it to a variety of different platforms, and are setting a new standard for mobile functionality. Look for Geoclue to help carry this standard to Moblin 2.0-based netbooks, MIDs and smartphones.



[i]     C API and D-Bus API

[ii]    Using basic Geoclue Providers tutorial

      Master Provider tutorial

[iii]   Geoclue Providers listed

[iv]   Gypsy - A GPS Daemon

[v]    Why should you use Gypsy over GPSD

For more complete information about compiler optimizations, see our Optimization Notice.