Shumate.Location

g GObject.GInterface GObject.GInterface Shumate.Location Shumate.Location GObject.GInterface->Shumate.Location

Implementations:

Shumate.Coordinate, Shumate.Marker, Shumate.SymbolEvent, Shumate.Viewport

Methods

distance (other)

get_latitude ()

get_longitude ()

set_location (latitude, longitude)

Virtual Methods

do_get_latitude ()

do_get_longitude ()

do_set_location (latitude, longitude)

Properties

Name

Type

Flags

Short Description

latitude

float

r/w

The latitude coordonate in degrees

longitude

float

r/w

The longitude coordonate in degrees

Signals

None

Fields

None

Class Details

class Shumate.Location
Bases:

GObject.GInterface

Structure:

Shumate.LocationInterface

An interface common to objects having latitude and longitude

By implementing Shumate.Location the object declares that it has latitude and longitude and can be used to specify location on the map.

distance(other)
Parameters:

other (Shumate.Location) – a [iface`Location`]

Returns:

the distance in meters between self and other

Return type:

float

Calculates the distance in meters between two locations.

This function uses the great-circle distance formula, which assumes Earth is a perfect sphere. This limits the accuracy of the result, but is good enough for most purposes.

New in version 1.2.

get_latitude()
Returns:

the latitude coordinate in degrees.

Return type:

float

Gets the latitude coordinate in degrees.

get_longitude()
Returns:

the longitude coordinate in degrees.

Return type:

float

Gets the longitude coordinate in degrees.

set_location(latitude, longitude)
Parameters:
  • latitude (float) – the latitude in degrees

  • longitude (float) – the longitude in degrees

Sets the coordinates of the location

do_get_latitude() virtual
Returns:

the latitude coordinate in degrees.

Return type:

float

Gets the latitude coordinate in degrees.

do_get_longitude() virtual
Returns:

the longitude coordinate in degrees.

Return type:

float

Gets the longitude coordinate in degrees.

do_set_location(latitude, longitude) virtual
Parameters:
  • latitude (float) – the latitude in degrees

  • longitude (float) – the longitude in degrees

Sets the coordinates of the location

Property Details

Shumate.Location.props.latitude
Name:

latitude

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

The latitude coordonate in degrees

Shumate.Location.props.longitude
Name:

longitude

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

The longitude coordonate in degrees