![]() |
![]() |
![]() |
geocode-glib Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#include <geocode-glib/geocode-glib.h> struct GeocodeObject; struct GeocodeObjectClass; GeocodeObjectPrivate; #define GEOCODE_OBJECT_FIELD_LONGITUDE #define GEOCODE_OBJECT_FIELD_LATITUDE #define GEOCODE_OBJECT_FIELD_RADIUS #define GEOCODE_OBJECT_FIELD_TIMEZONE #define GEOCODE_OBJECT_FIELD_CITY #define GEOCODE_OBJECT_FIELD_COUNTRY #define GEOCODE_OBJECT_FIELD_AIRPORT #define GEOCODE_OBJECT_FIELD_UZIP #define GEOCODE_OBJECT_FIELD_COUNTRYCODE #define GEOCODE_OBJECT_FIELD_NAME #define GEOCODE_OBJECT_FIELD_LINE1 #define GEOCODE_OBJECT_FIELD_LINE2 #define GEOCODE_OBJECT_FIELD_LINE3 #define GEOCODE_OBJECT_FIELD_LINE4 #define GEOCODE_OBJECT_FIELD_HOUSE #define GEOCODE_OBJECT_FIELD_STREET #define GEOCODE_OBJECT_FIELD_POSTAL #define GEOCODE_OBJECT_FIELD_NEIGHBORHOOD #define GEOCODE_OBJECT_FIELD_COUNTY #define GEOCODE_OBJECT_FIELD_HASH #define GEOCODE_OBJECT_FIELD_STATECODE #define GEOCODE_OBJECT_FIELD_STATE #define GEOCODE_OBJECT_FIELD_COUNTYCODE #define GEOCODE_OBJECT_FIELD_OFFSETLAT #define GEOCODE_OBJECT_FIELD_OFFSETLON GeocodeObject * geocode_object_new (void
); GeocodeObject * geocode_object_new_for_params (GHashTable *params
); GeocodeObject * geocode_object_new_for_coords (gdouble latitude
,gdouble longitude
); void geocode_object_add (GeocodeObject *object
,const char *key
,const char *value
); void geocode_object_resolve_async (GeocodeObject *object
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); GHashTable * geocode_object_resolve_finish (GeocodeObject *object
,GAsyncResult *res
,GError **error
); GHashTable * geocode_object_resolve (GeocodeObject *object
,GError **error
); gboolean geocode_object_get_coords (GHashTable *results
,gdouble *longitude
,gdouble *latitude
);
Contains functions for geocoding and reverse geocoding using the Yahoo! Place Finder APIs.
struct GeocodeObject;
All the fields in the GeocodeObject structure are private and should never be accessed directly.
#define GEOCODE_OBJECT_FIELD_LONGITUDE "longitude"
Metadata field for a result, representing the longitude at the center of the matched area.
#define GEOCODE_OBJECT_FIELD_LATITUDE "latitude"
Metadata field for a result, representing the latitude at the center of the matched area.
#define GEOCODE_OBJECT_FIELD_RADIUS "radius"
Metadata field for a result, representing the radius of the matched area in meters.
#define GEOCODE_OBJECT_FIELD_TIMEZONE "timezone"
Metadata field for a result, representing the timezone of the matched area.
#define GEOCODE_OBJECT_FIELD_CITY "city"
Metadata field for a result, representing the city of the matched area.
#define GEOCODE_OBJECT_FIELD_COUNTRY "country"
Metadata field for a result, representing the country of the matched area.
#define GEOCODE_OBJECT_FIELD_AIRPORT "airport"
Metadata field for a result, representing the closest airport to the matched area.
#define GEOCODE_OBJECT_FIELD_UZIP "uzip"
Metadata field for a result, representing the unique zip code (or postal code) for the matched area.
#define GEOCODE_OBJECT_FIELD_COUNTRYCODE "countrycode"
Metadata field for a result, representing the country code of the matched area.
#define GEOCODE_OBJECT_FIELD_NAME "name"
Metadata field for a result, representing the name of the matched area.
#define GEOCODE_OBJECT_FIELD_LINE1 "line1"
Metadata field for a result, representing the line1 of the matched area.
#define GEOCODE_OBJECT_FIELD_LINE2 "line2"
Metadata field for a result, representing the line2 of the matched area.
#define GEOCODE_OBJECT_FIELD_LINE3 "line3"
Metadata field for a result, representing the line3 of the matched area.
#define GEOCODE_OBJECT_FIELD_LINE4 "line4"
Metadata field for a result, representing the line4 of the matched area.
#define GEOCODE_OBJECT_FIELD_HOUSE "house"
Metadata field for a result, representing the house of the matched area.
#define GEOCODE_OBJECT_FIELD_STREET "street"
Metadata field for a result, representing the street of the matched area.
#define GEOCODE_OBJECT_FIELD_POSTAL "postal"
Metadata field for a result, representing the postal of the matched area.
#define GEOCODE_OBJECT_FIELD_NEIGHBORHOOD "neighborhood"
Metadata field for a result, representing the neighborhood of the matched area.
#define GEOCODE_OBJECT_FIELD_COUNTY "county"
Metadata field for a result, representing the county of the matched area.
#define GEOCODE_OBJECT_FIELD_HASH "hash"
Metadata field for a result, representing the hash of the matched area.
#define GEOCODE_OBJECT_FIELD_STATECODE "statecode"
Metadata field for a result, representing the statecode of the matched area.
#define GEOCODE_OBJECT_FIELD_STATE "state"
Metadata field for a result, representing the state of the matched area.
#define GEOCODE_OBJECT_FIELD_COUNTYCODE "countycode"
Metadata field for a result, representing the county code of the matched area.
#define GEOCODE_OBJECT_FIELD_OFFSETLAT "offsetlat"
Metadata field for a result, representing the latitude of the offset point in degrees, representing building/parcel setback from road center-line for the matched area.
#define GEOCODE_OBJECT_FIELD_OFFSETLON "offsetlon"
Metadata field for a result, representing the longitude the offset point in degrees, representing building/parcel setback from road center-line for the matched area.
GeocodeObject * geocode_object_new (void
);
Creates a new GeocodeObject to perform geocoding with. Use
geocode_object_add()
to add new parameters, and
geocode_object_resolve_async()
to perform the resolution.
Returns : |
a new GeocodeObject. Use g_object_unref() when done. |
GeocodeObject * geocode_object_new_for_params (GHashTable *params
);
Creates a new GeocodeObject to perform geocoding with. The GHashTable is in the format used by Telepathy, and documented on Telepathy's specification site.
See also: XEP-0080 specification.
|
a GHashTable with string keys, and GValue values. |
Returns : |
a new GeocodeObject. Use g_object_unref() when done. |
GeocodeObject * geocode_object_new_for_coords (gdouble latitude
,gdouble longitude
);
Creates a new GeocodeObject to perform reverse geocoding with.
Use geocode_object_resolve_async()
to perform the resolution.
|
a valid latitude |
|
a valid longitude |
Returns : |
a new GeocodeObject. Use g_object_unref() when done. |
void geocode_object_add (GeocodeObject *object
,const char *key
,const char *value
);
Adds parameters to pass to the web service. A copy of the key and value parameters are kept internally.
|
a GeocodeObject |
|
a string representing a parameter to the web service |
|
a string representing the value of a parameter |
void geocode_object_resolve_async (GeocodeObject *object
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously gets the result of a geocoding or reverse geocoding
query using a web service. Use geocode_object_resolve()
to do the same
thing synchronously.
When the operation is finished, callback
will be called. You can then call
geocode_object_resolve_finish()
to get the result of the operation.
|
a GeocodeObject representing a query |
|
optional GCancellable object, NULL to ignore. |
|
a GAsyncReadyCallback to call when the request is satisfied |
|
the data to pass to callback function |
GHashTable * geocode_object_resolve_finish (GeocodeObject *object
,GAsyncResult *res
,GError **error
);
Finishes a query operation. See geocode_object_resolve_async()
.
|
a GeocodeObject representing a query |
|
a GAsyncResult. |
|
a GError. |
Returns : |
a GHashTable containing the results of the query
or NULL in case of errors.
Free the returned string with g_hash_table_destroy() when done. [element-type utf8 utf8][transfer full]
|
GHashTable * geocode_object_resolve (GeocodeObject *object
,GError **error
);
Gets the result of a geocoding or reverse geocoding query using a web service.
|
a GeocodeObject representing a query |
|
a GError |
Returns : |
a GHashTable containing the results of the query
or NULL in case of errors.
Free the returned string with g_hash_table_destroy() when done. [element-type utf8 utf8][transfer full]
|
gboolean geocode_object_get_coords (GHashTable *results
,gdouble *longitude
,gdouble *latitude
);
Parses the results hashtable and exports the longitude and latitude as gdoubles.
|
a GHashTable as generated by geocode_object_resolve()
and geocode_object_resolve_async()
|
|
a pointer to a gdouble |
|
a pointer to a gdouble |
Returns : |
TRUE when the longitude and latitude have been
found and the return parameters set. |