A `GWeatherLocation` represents a "location" of some type known to libgweather; anything from a single weather station to the entire
world.
See [enum@GWeather.LocationLevel] for information about how the hierarchy of locations works.
- public Location deserialize (Variant serialized)
This call undoes the effect of
serialize, that is, it turns a
Variant into a Location.
- public async Location detect_nearest_city (double lat, double lon, Cancellable? cancellable) throws Error
Initializes geocode reversing to find place for (lat,
lon) coordinates.
- public bool equal (Location two)
Compares two Location and sees if they
represent the same place.
- public Location find_by_country_code (string country_code)
Retrieves the country identified by the specified ISO 3166 code, if
present in the database.
- public Location? find_by_station_code (string station_code)
Retrieves the weather station identifier by station_code.
- public Location find_nearest_city (double lat, double lon)
Finds the nearest city to the passed latitude and longitude, among the
descendants of this.
- 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.
- public void free_timezones (owned TimeZone[] zones)
- public string? get_city_name ()
Retrieves the city name for the given location.
- public unowned string? get_code ()
Gets the METAR station code associated with a
`GWEATHER_LOCATION_WEATHER_STATION` location.
- public void get_coords (out double latitude, out double longitude)
Gets this's coordinates.
- public unowned string? get_country ()
Gets the ISO 3166 country code of the given location.
- public string? get_country_name ()
Retrieves the country name for the given location.
- public double get_distance (Location loc2)
Determines the distance in kilometers between
this and loc2.
- public unowned string? get_english_name ()
Gets the location's name.
- public unowned string? get_english_sort_name ()
Gets the location's name, in a representation useful for comparisons.
- public LocationLevel get_level ()
Gets this's level, from
gweather_location_world, to gweather_location_weather_station.
- public unowned string? get_name ()
Gets the location's name, localized into the current language.
- public Location? get_parent ()
Gets the location's parent.
- public unowned string? get_sort_name ()
Gets the location's name, localized into the current language, in a
representation useful for comparisons.
- public unowned TimeZone? get_timezone ()
Gets the timezone associated with this
, if known.
- public unowned string? get_timezone_str ()
Gets the timezone associated with this
, if known, as a string.
- public TimeZone[] get_timezones ()
Gets an array of all timezones associated with any location under
this.
- public bool has_coords ()
Checks if this has valid latitude
and longitude.
- public bool has_timezone ()
Checks whether the location has a timezone.
- public Location? next_child (owned Location? child)
Allows iterating all children of a location.
- public unowned Variant serialize ()
Transforms a Location into a
Variant, in a way that calling
deserialize will hold an equivalent Location
.