Methods
RequestLocation | (u: Contact) | → | a{sv}: Location | |
SetLocation | (a{sv}: Location) | → | nothing |
Signals
LocationUpdated | (u: Contact, a{sv}: Location) |
Properties
LocationAccessControlTypes | au (Access_Control_Type_List) | Read only | ||
LocationAccessControl | (uv) (Access_Control) | Read/Write | ||
SupportedLocationFeatures | u (Location_Features) | Read only |
Contact Attributes
im.telepathy.v1.Connection.Interface.Location1/location | a{sv} (Location) |
Types
Location_Features | Flags | u | |
Location | Mapping | a{sv} | |
Contact_Locations | Mapping | a{ua{sv}} |
Description
An interface on connections to support protocols which allow users to publish their current geographical location, and subscribe to the current location of their contacts.
This interface is geared strongly towards automatic propagation and use of this information, so focuses on latitude, longitude and altitude which can be determined by GPS, although provision is also included for an optional human-readable description of locations. All co-ordinate information is required to be relative to the WGS84 datum.
The information published through this interface is intended to have the same scope as presence information, so will normally be made available to those individuals on the user's "publish" contact list. Even so, user interfaces should not automatically publish location information without the consent of the user, and it is recommended that an option is made available to reduce the accuracy of the reported information to allow the user to maintain their privacy.
Location information is represented using the terminology of XMPP's XEP-0080 or the XEP-0080-derived Geoclue API where possible.
Clients of this interface SHOULD register an interest in it by calling Connection.AddClientInterest with an argument containing the name of this interface, before calling any Location method. If they do so, they SHOULD also call Connection.RemoveClientInterest after use to allow the CM to release resources associated with this interface.
Methods
RequestLocation (u: Contact) → a{sv}: Location
Parameters
- Contact — u (Contact_Handle)
Returns
- Location — a{sv} (Location)
Rationale:
Possible Errors
- Disconnected
- Network Error
- Invalid Handle
- Permission Denied
Rationale:
SetLocation (a{sv}: Location) → nothing
Parameters
- Location — a{sv}
Possible Errors
- Disconnected
- Not Implemented
- Permission Denied
Rationale:
Can_Set
flag will not be set in
SupportedLocationFeatures.
Signals
LocationUpdated (u: Contact, a{sv}: Location)
Parameters
- Contact — u (Contact_Handle)
- Location — a{sv} (Location)
Properties
LocationAccessControlTypes — au (Access_Control_Type_List)
LocationAccessControl — (uv) (Access_Control)
SupportedLocationFeatures — u (Location_Features)
Connected
, but MUST remain constant thereafter.
Contact Attributes
im.telepathy.v1.Connection.Interface.Location1/location — a{sv} (Location)
The contact's current location, if already known. If contact's location is not known, request their current locations, but return immediately without waiting for a reply; if a reply with a non-empty location is later received, the LocationUpdated signal will be emitted.
Rationale:
This method is appropriate for "lazy" location finding, for instance displaying the location (if available) of everyone in your contact list.
Types
Location_Features — u
- Can_Set (1)
Location — a{sv}
- Key — s
- countrycode - s: an ISO-3166-1 alpha-2 (two-letter) country code, e.g. "us", "gb", "fr"
- country - s: a country name in unspecified locale, e.g. "USA"
- region - s: an administrative region of the nation, such as a state or province
- locality - s: a locality within the administrative region, such as a town or city
- area - s: a named area such as a campus or neighborhood
- postalcode - s: a code used for postal delivery
- street - s: a thoroughfare within the locality, or a crossing of two thoroughfares
- building - s: a specific building on a street or in an area
- floor - s: a particular floor in a building
- room - s: a particular room in a building
- text - s: any more specific information, e.g. "Northwest corner of the lobby"
- description - s: A natural-language name for or description of the location, e.g. "Bill's house"
- uri - s: a URI representing the location or pointing to more information about it
- language - s: a specific language or locale of location information in a format compatible to RFC 4646. Note that UTF-8 is the only allowed encoding, e.g. "en" or "fr-CA".
- lat - d: latitude in decimal degrees north, -90 to +90,
relative to the WGS-84 datum
Rationale:
This is from XEP-0080; the XEP allows use of a different datum, but recommends this one. We enforce sanity by requiring a consistent datum: a minimal compliant implementation of this specification in terms of XEP-0080 would simply ignore the <lat> and <lon> elements if <datum> exists and has a value other than WGS-84, while an advanced implementation might correct for the different datum. - lon - d: Longitude in decimal degrees east, -180 to +180,
relative to the WGS-84 datum
Rationale:
Same rationale as 'lat' - alt - d: altitude in metres above sea level (negative
if below sea level)
Rationale:
This is from XEP-0080 - accuracy - d: horizontal position error in metres if
known
Rationale:
This is from XEP-0080 - speed - d: speed in metres per second
Rationale:
This is from XEP-0080 - bearing - d: direction of movement in decimal degrees,
where North is 0 and East is 90
Rationale:
This is from XEP-0080, and is equivalent to the struct field called "direction" in GeoClue - timestamp - x (Unix_Timestamp64): the time
that the contact was at this location, in seconds since
1970-01-01T00:00:00Z (i.e. the beginning of 1970 in UTC)
Rationale:
XEP-0080 uses an ISO 8601 string for this, but a number of seconds since the epoch is probably easier to work with. - Value — v
Civic addresses are represented by the following well-known keys (all of which have string values), which should be kept in sync with those used in XEP-0080 and in the Geoclue project:
The following address keys are defined in XEP-0080 but not by Geoclue, and are also allowed:
Since the previous strings have data intended to be read by users, the language used should be stated using:
Positions are represented by the following well-known keys:
Velocities are represented by the following well-known keys:
Other well-known keys:
Contact_Locations — a{ua{sv}}
- Contact — u (Contact_Handle)
- Location — a{sv} (Location)