find_nearest_city_full


Description:

public Location find_nearest_city_full (double lat, double lon, owned FilterFunc? func)

Finds the nearest city to the passed latitude and longitude, among the descendants of this.

Supports the use of own filter function to filter out locations.

Geocoding should be done on the application side if needed.

this must be at most a gweather_location_adm1 location. This restriction may be lifted in a future version.

Parameters:

this

the parent location, which will be searched recursively

lat

Latitude, in degrees

lon

Longitude, in degrees

func

a function to iterate over the locations; the function must return `TRUE` to continue checking for the location, and `FALSE` to filter the location out

destroy

to destroy user_data

user_data

for customization

Returns:

the city closest to (lat, lon), in the region or administrative district of this with validation of filter function