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.
Constructors
gweather_location_new_detached
Construct a new location from the given data, supplementing any missing information from the static database.
Functions
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_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_code
Gets the METAR station code associated with a
GWEATHER_LOCATION_WEATHER_STATION
location.
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_sort_name
Gets the location’s name, localized into the current language, in a representation useful for comparisons.
gweather_location_get_timezones
Gets an array of all timezones associated with any location under
loc
.
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.
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.