GWeather.Location
Description: Reference for GWeather.Location

### Class

# GWeatherLocation

#### Description [src]

    final class GWeather.Location : GObject.Object
    {
      /* No available fields */
    }

A `GWeatherLocation` represents a “location” of some type known to libgweather; anything from a single weather station to the entire world.

See `GWeatherLocationLevel` for information about how the hierarchy of locations works.

#### Hierarchy

#### Ancestors

- GObject

#### Constructors

###### gweather_location_new_detached

Construct a new location from the given data, supplementing any missing information from the static database.

#### Functions

###### gweather_location_detect_nearest_city_finish

Fetches the location from `result`.

###### gweather_location_get_world

Obtains the shared `GWeatherLocation` of type `GWEATHER_LOCATION_WORLD`, representing a hierarchy containing all of the locations from the location data.

#### Instance methods

###### gweather_location_deserialize

This call undoes the effect of gweather_location_serialize(), that is, it turns a `GVariant` into a `GWeatherLocation`. The conversion happens in the context of `world` (i.e, for a city or weather station, the resulting location will be attached to a administrative division, country and region as appropriate).

###### gweather_location_detect_nearest_city

Initializes geocode reversing to find place for (`lat`, `lon`) coordinates.

###### gweather_location_equal

Compares two `GWeatherLocation` and sees if they represent the same place. It is only legal to call this for cities, weather stations or detached locations. Note that this function only checks for geographical characteristics, such as coordinates and METAR code. It is still possible that the two locations belong to different worlds (in which case care must be taken when passing them GWeatherLocationEntry and GWeatherInfo), or if one is them is detached it could have a custom name.

###### gweather_location_find_by_country_code

Retrieves the country identified by the specified ISO 3166 code, if present in the database.

###### gweather_location_find_by_station_code

Retrieves the weather station identifier by `station_code`.

###### gweather_location_find_nearest_city

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

###### gweather_location_find_nearest_city_full

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

###### gweather_location_free_timezones

Frees the array of timezones returned by gweather_location_get_timezones().

###### gweather_location_get_city_name

Retrieves the city name for the given location.

###### gweather_location_get_code

Gets the METAR station code associated with a `GWEATHER_LOCATION_WEATHER_STATION` location.

###### gweather_location_get_coords

Gets `loc`‘s coordinates.

###### gweather_location_get_country

Gets the ISO 3166 country code of the given location.

###### gweather_location_get_country_name

Retrieves the country name for the given location.

###### gweather_location_get_distance

Determines the distance in kilometers between `loc` and `loc2`.

###### gweather_location_get_english_name

Gets the location’s name.

###### gweather_location_get_english_sort_name

Gets the location’s name, in a representation useful for comparisons.

###### gweather_location_get_level

Gets `loc`‘s level, from `GWEATHER_LOCATION_WORLD`, to `GWEATHER_LOCATION_WEATHER_STATION`.

###### gweather_location_get_name

Gets the location’s name, localized into the current language.

###### gweather_location_get_parent

Gets the location’s parent.

###### gweather_location_get_sort_name

Gets the location’s name, localized into the current language, in a representation useful for comparisons.

###### gweather_location_get_timezone

Gets the timezone associated with `loc`, if known.

###### gweather_location_get_timezone_str

Gets the timezone associated with `loc`, if known, as a string.

###### gweather_location_get_timezones

Gets an array of all timezones associated with any location under `loc`.

###### gweather_location_has_coords

Checks if `loc` has valid latitude and longitude.

###### gweather_location_has_timezone

Checks whether the location has a timezone.

###### gweather_location_next_child

Allows iterating all children of a location.

###### gweather_location_serialize

Transforms a `GWeatherLocation` into a `GVariant`, in a way that calling `gweather_location_deserialize()` will hold an equivalent `GWeatherLocation`. The resulting variant can then be stored into GSettings or on disk. This call is only valid for cities, weather stations and detached locations. The format of the resulting `GVariant` is private to libgweather, and it is subject to change. You should use the “v” format in GSettings, to ensure maximum compatibility with future versions of the library.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct GWeatherLocationClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.