Method
GWeatherLocationfind_nearest_city_full
Declaration [src]
GWeatherLocation*
gweather_location_find_nearest_city_full (
GWeatherLocation* loc,
double lat,
double lon,
GWeatherFilterFunc func,
gpointer user_data,
GDestroyNotify destroy
)
Description [src]
Finds the nearest city to the passed latitude and
longitude, among the descendants of loc.
Supports the use of own filter function to filter out locations.
Geocoding should be done on the application side if needed.
loc must be at most a GWEATHER_LOCATION_ADM1 location.
This restriction may be lifted in a future version.
Parameters
lat-
Type:
doubleLatitude, in degrees.
lon-
Type:
doubleLongitude, in degrees.
func-
Type:
GWeatherFilterFuncA function to iterate over the locations; the function must return
TRUEto continue checking for the location, andFALSEto filter the location out.The argument can be NULL. user_data-
Type:
gpointerFor customization.
The argument can be NULL.The data is owned by the caller of the function. destroy-
Type:
GDestroyNotifyTo destroy user_data.
Return value
Type: GWeatherLocation
The city closest to (lat, lon), in the
region or administrative district of loc with validation of
filter function.
| The caller of the method takes ownership of the data, and is responsible for freeing it. |