### Method

# GWeather Location find_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`

  Type: `double`

  Latitude, in degrees.

`lon`

  Type: `double`

  Longitude, in degrees.

#### Return value

Type: `GWeatherLocation`

The city closest to (`lat`, `lon`), in the region or administrative district of `loc`.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.