![]() |
![]() |
![]() |
Geoclue Reference Manual | ![]() |
---|---|---|---|---|
#define GEOCLUE_GEOCODE_INTERFACE_NAME GeoclueGeocode; GeoclueGeocode* geoclue_geocode_new (const char *service, const char *path); GeocluePositionFields geoclue_geocode_address_to_position (GeoclueGeocode *geocode, GHashTable *details, double *latitude, double *longitude, double *altitude, GeoclueAccuracy **accuracy, GError **error); void (*GeoclueGeocodeCallback) (GeoclueGeocode *geocode, GeocluePositionFields fields, double latitude, double longitude, double altitude, GeoclueAccuracy *accuracy, GError *error, gpointer userdata); void geoclue_geocode_address_to_position_async (GeoclueGeocode *geocode, GHashTable *details, GeoclueGeocodeCallback callback, gpointer userdata);
GeoclueGeocode contains Geocoding-related methods. It is part of the Geoclue public C client API which uses D-Bus to communicate with the actual provider.
After a GeoclueGeocode is created with geoclue_geocode_new()
, the
geoclue_geocode_address_to_position()
and geoclue_geocode_address_to_position_async()
methods can be used to obtain the position (coordinates) of a given address.
Address GHashTable keys are defined in geoclue-types.h. See also convenience functions in geoclue-address-details.h.
#define GEOCLUE_GEOCODE_INTERFACE_NAME "org.freedesktop.Geoclue.Geocode"
GeoclueGeocode* geoclue_geocode_new (const char *service, const char *path);
Creates a GeoclueGeocode with given D-Bus service name and path.
|
D-Bus service name |
|
D-Bus path name |
Returns : |
Pointer to a new GeoclueGeocode |
GeocluePositionFields geoclue_geocode_address_to_position (GeoclueGeocode *geocode, GHashTable *details, double *latitude, double *longitude, double *altitude, GeoclueAccuracy **accuracy, GError **error);
Geocodes given address to coordinates (latitude
, longitude
, altitude
).
see geoclue-types.h for the
hashtable keys usable in details
. accuracy
is a rough estimate of
the accuracy of the returned position.
If the caller is not interested in some values, the pointers can be
left NULL
.
|
A GeoclueGeocode object |
|
Hashtable with address data |
|
Pointer to returned latitude in degrees or NULL
|
|
Pointer to returned longitude in degrees or NULL
|
|
Pointer to returned altitude in meters or NULL
|
|
Pointer to returned GeoclueAccuracy or NULL
|
|
Pointer to returned Gerror or NULL
|
Returns : |
A GeocluePositionFields bitfield representing the validity of the returned coordinates. |
void (*GeoclueGeocodeCallback) (GeoclueGeocode *geocode, GeocluePositionFields fields, double latitude, double longitude, double altitude, GeoclueAccuracy *accuracy, GError *error, gpointer userdata);
Callback function for geoclue_geocode_address_to_position_async()
.
|
A GeoclueGeocode object |
|
A GeocluePositionFields bitfield representing the validity of the position values |
|
Latitude in degrees |
|
Longitude in degrees |
|
Altitude in meters |
|
Accuracy of measurement as GeoclueAccuracy |
|
Error as Gerror or NULL
|
|
User data pointer set in geoclue_geocode_address_to_position_async()
|
void geoclue_geocode_address_to_position_async (GeoclueGeocode *geocode, GHashTable *details, GeoclueGeocodeCallback callback, gpointer userdata);
Function returns (essentially) immediately and calls callback
when the geocoded
position data is available or when D-Bus timeouts.
see geoclue-types.h for the
hashtable keys usable in details
.
|
A Geocluegeocode object |
|
A GHashTable with address data |
|
A GeoclueAddressCallback function that should be called when return values are available |
|
pointer for user specified data |