GWeather.Location.find_nearest_city

### Method

# GWeather Locationfind_nearest_city

#### Declaration [src]

    GWeatherLocation*
    gweather_location_find_nearest_city (
      GWeatherLocation* loc,
      double lat,
      double lon
    )

#### Description [src]

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

The given location must be at most a `GWEATHER_LOCATION_ADM1` location. This restriction may be lifted in a future version.

Note that this function does not check if (`lat`, `lon`) fall inside `loc`, or are in the same region and time zone as the return value.

#### Parameters

`lat` | `double`
| Latitude, in degrees.
`lon` | `double`
| Longitude, in degrees.

#### Return value

Returns: | `GWeatherLocation`
| The city closest to (`lat`, `lon`), in the region or administrative district of `loc`.
| The caller of the method takes ownership of the data, and is responsible for freeing it.