Top | ![]() |
![]() |
![]() |
![]() |
void | geonames_query_cities () |
gint * | geonames_query_cities_finish () |
gint * | geonames_query_cities_sync () |
gint | geonames_get_n_cities () |
GeonamesCity * | geonames_get_city () |
void | geonames_city_free () |
const gchar * | geonames_city_get_name () |
const gchar * | geonames_city_get_state () |
const gchar * | geonames_city_get_country () |
const gchar * | geonames_city_get_country_code () |
const gchar * | geonames_city_get_timezone () |
gdouble | geonames_city_get_latitude () |
gdouble | geonames_city_get_longitude () |
guint | geonames_city_get_population () |
This library provides access to a local copy of a subset of the city and country data of geonames.org.
void geonames_query_cities (const gchar *query
,GeonamesQueryFlags flags
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously queries the geonames city database with the search
terms in query
. When the operation is finished, callback
is called
from the thread-default main context you are calling this method
from. Call geonames_query_cities_finish()
from callback
to retrieve
the list of results.
Results are weighted by how well and how many tokens match a particular city, as well as importance of a city.
If query
is empty, no results are returned.
gint * geonames_query_cities_finish (GAsyncResult *result
,guint *length
,GError **error
);
Finishes an operation started with geonames_query_cities()
and
returns the resulting matches.
result |
the GAsyncResult from the callback passed to
|
|
length |
optional location for storing the number of returned cities. |
[out][optional] |
error |
a GError |
The list of cities matching the
search query, as indices that can be passed into cities with
geonames_get_city()
.
[array length=@length]
gint * geonames_query_cities_sync (const gchar *query
,GeonamesQueryFlags flags
,guint *length
,GCancellable *cancellable
,GError **error
);
Synchronous version of geonames_query_cities()
.
query |
the search string |
|
flags |
||
cancellable |
a GCancellable. |
[nullable] |
length |
optional location for storing the number of returned cities. |
[out][optional] |
error |
a GError |
The list of cities matching the
search query, as indices that can be passed into cities with
geonames_get_city()
.
[array length=@length]
gint
geonames_get_n_cities (void
);
Returns the amount of cities in the geonames database.
GeonamesCity *
geonames_get_city (gint index
);
Retrieves the city at index
in the geonames database.
const gchar *
geonames_city_get_country_code (GeonamesCity *city
);