Top | ![]() |
![]() |
![]() |
![]() |
GeoclueGeocode contains geocoding 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()
,
geoclue_geocode_freeform_address_to_position()
methods and their
asynchronous counterparts can be used to obtain the position (coordinates)
of the given address.
Address GHashTable keys are defined in
geoclue-types.h. See alsoconvenience functions in
geoclue-address-details.h.GeoclueGeocode * geoclue_geocode_new (const char *service
,const char *path
);
Creates a GeoclueGeocode with given D-Bus service name and path.
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
.
geocode |
A GeoclueGeocode object |
|
details |
Hashtable with address data |
|
latitude |
Pointer to returned latitude in degrees or |
|
longitude |
Pointer to returned longitude in degrees or |
|
altitude |
Pointer to returned altitude in meters or |
|
accuracy |
Pointer to returned GeoclueAccuracy or |
|
error |
Pointer to returned Gerror or |
void (*GeoclueGeocodeCallback) (GeoclueGeocode *geocode
,GeocluePositionFields fields
,double latitude
,double longitude
,double altitude
,GeoclueAccuracy *accuracy
,GError *error
,gpointer userdata
);
Callback function for the asynchronous methods.
geocode |
A GeoclueGeocode object |
|
fields |
A GeocluePositionFields bitfield representing the validity of the position values |
|
latitude |
Latitude in degrees |
|
longitude |
Longitude in degrees |
|
altitude |
Altitude in meters |
|
accuracy |
Accuracy of measurement as GeoclueAccuracy |
|
error |
Error as Gerror or |
|
userdata |
User data pointer |
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
.
geocode |
A Geocluegeocode object |
|
details |
A GHashTable with address data |
|
callback |
A GeoclueAddressCallback function that should be called when return values are available |
|
userdata |
pointer for user specified data |
GeocluePositionFields geoclue_geocode_freeform_address_to_position (GeoclueGeocode *geocode
,const char *address
,double *latitude
,double *longitude
,double *altitude
,GeoclueAccuracy **accuracy
,GError **error
);
Geocodes given address to coordinates (latitude
, longitude
, altitude
).
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
.
geocode |
A GeoclueGeocode object |
|
address |
freeform address |
|
latitude |
Pointer to returned latitude in degrees or |
|
longitude |
Pointer to returned longitude in degrees or |
|
altitude |
Pointer to returned altitude in meters or |
|
accuracy |
Pointer to returned GeoclueAccuracy or |
|
error |
Pointer to returned Gerror or |
void geoclue_geocode_freeform_address_to_position_async (GeoclueGeocode *geocode
,const char *address
,GeoclueGeocodeCallback callback
,gpointer userdata
);
Function returns (essentially) immediately and calls callback
when the geocoded
position data is available or when D-Bus timeouts.
geocode |
A Geocluegeocode object |
|
address |
freeform address |
|
callback |
A GeoclueAddressCallback function that should be called when return values are available |
|
userdata |
pointer for user specified data |