Location
Object Hierarchy:
GWeather.Location
GWeather.Location
GWeather.Location
GLib.Object
GLib.Object
GLib.Object->GWeather.Location
Description:
[ CCode ( type_id = "gweather_location_get_type ()" ) ]public class Location : Object
A `GWeatherLocation` represents a "location" of some type known to libgweather; anything from a single weather station to the entire
world.
See [[email protected] ] for information about how the hierarchy of locations works.
Content:
Static methods:
Creation methods:
Methods:
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 .
Inherited Members:
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref