GeocodeGlib.Location¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
The accuracy of this location in meters |
||
r/w |
The altitude of this location in meters |
||
r/w/co |
Coordinate Reference System Identification |
||
r/w |
Description of this location |
||
r/w |
The latitude of this location in degrees |
||
r/w |
The longitude of this location in degrees |
||
r/w/co |
The timestamp of this location in seconds since Epoch |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class GeocodeGlib.Location(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
All the fields in the
GeocodeGlib.Location
structure are private and should never be accessed directly.- classmethod new(latitude, longitude, accuracy)¶
- Parameters:
- Returns:
a new
GeocodeGlib.Location
object. UseGObject.Object.unref
() when done.- Return type:
Creates a new
GeocodeGlib.Location
object.
- classmethod new_with_description(latitude, longitude, accuracy, description)¶
- Parameters:
- Returns:
a new
GeocodeGlib.Location
object. UseGObject.Object.unref
() when done.- Return type:
Creates a new
GeocodeGlib.Location
object.
- equal(b)¶
- Parameters:
b (
GeocodeGlib.Location
) – another location- Returns:
- Return type:
Compare two
GeocodeGlib.Location
instances for equality. This compares all fields and only returnsTrue
if the instances are exactly equal. For example, if both locations have the same physical coordinates, but one location has itsGeocodeGlib.Location
:description
property set and the other does not,False
will be returned. Similarly, if both locations have the sameGeocodeGlib.Location
:latitude
,GeocodeGlib.Location
:longitude
andGeocodeGlib.Location
:altitude
, but a differentGeocodeGlib.Location
:accuracy
orGeocodeGlib.Location
:timestamp
,False
will be returned. Or if both locations have the same:obj:GeocodeGlib.Location:latitude
andGeocodeGlib.Location
:longitude
but a differentGeocodeGlib.Location
:altitude
,False
will be returned.Both instances must be non-
None
.New in version 3.23.1.
- get_accuracy()¶
- Returns:
The accuracy of location self.
- Return type:
Gets the accuracy (in meters) of location self.
- get_altitude()¶
- Returns:
The altitude of location self.
- Return type:
Gets the altitude of location self.
- get_crs()¶
- Returns:
The CRS of location self.
- Return type:
Gets the Coordinate Reference System Identification of location self.
- get_description()¶
- Returns:
The description of location self.
- Return type:
Gets the description of location self.
- get_distance_from(locb)¶
- Parameters:
locb (
GeocodeGlib.Location
) – aGeocodeGlib.Location
- Returns:
a distance in km.
- Return type:
Calculates the distance in km, along the curvature of the Earth, between 2 locations. Note that altitude changes are not taken into account.
- get_latitude()¶
- Returns:
The latitude of location self.
- Return type:
Gets the latitude of location self.
- get_longitude()¶
- Returns:
The longitude of location self.
- Return type:
Gets the longitude of location self.
- get_timestamp()¶
- Returns:
The timestamp of location self.
- Return type:
Gets the timestamp (in seconds since the Epoch) of location self. See
GeocodeGlib.Location
:timestamp
.
- set_description(description)¶
- Parameters:
description (
str
) – a description for the location
Sets the description of self to description.
- set_from_uri(uri)¶
- Parameters:
uri (
str
) – a URI mapping out a location- Raises:
- Returns:
- Return type:
Initialize a
GeocodeGlib.Location
object with the given uri.The URI should be in the geo scheme (RFC 5870) which in its simplest form looks like:
geo:latitude,longitude
An Android extension to set a description is also supported in the form of:
geo:0,0?q=latitude,longitude(description)
- to_uri(scheme)¶
- Parameters:
scheme (
GeocodeGlib.LocationURIScheme
) – the scheme of the requested URI- Returns:
a URI representing the location. The returned string should be freed with
GLib.free
() when no longer needed.- Return type:
Creates a URI representing self in the scheme specified in scheme.
Property Details¶
- GeocodeGlib.Location.props.accuracy¶
-
The accuracy of this location in meters.
- GeocodeGlib.Location.props.altitude¶
-
The altitude of this location in meters.
- GeocodeGlib.Location.props.crs¶
- Name:
crs
- Type:
- Default Value:
- Flags:
The Coordinate Reference System Identification of this location. Only the value ‘wgs84’ is currently valid.
- GeocodeGlib.Location.props.description¶
-
The description of this location.
- GeocodeGlib.Location.props.latitude¶
-
The latitude of this location in degrees.
- GeocodeGlib.Location.props.longitude¶
-
The longitude of this location in degrees.