XEP-0080: User Location

This document defines an XMPP protocol extension for communicating information about the current geographical location of an entity.

NOTICE: The protocol defined herein is a Draft Standard of the XMPP Standards Foundation. Implementations are encouraged and the protocol is appropriate for deployment in production systems, but some changes to the protocol are possible before it becomes a Final Standard.

Document Information

Series: XEP
Number: 0080
Publisher: XMPP Standards Foundation
Status: Draft
Type: Standards Track
Version: 1.4
Last Updated: 2007-07-16
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0163
Supersedes: None
Superseded By: None
Short Name: geoloc
Schema: <http://www.xmpp.org/schemas/geoloc.xsd>
Wiki Page: <http://wiki.jabber.org/index.php/User Location (XEP-0080)>

Author Information

Joe Hildebrand

Email: jhildebrand@jabber.com
JabberID: hildjj@jabber.org

Peter Saint-Andre

JabberID: stpeter@jabber.org
URI: https://stpeter.im/

Legal Notices

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which may be found at <http://www.xmpp.org/extensions/ipr-policy.shtml> or obtained by writing to XSF, P.O. Box 1641, Denver, CO 80201 USA).


This XMPP Extension Protocol is copyright (c) 1999 - 2007 by the XMPP Standards Foundation (XSF).


This material may be distributed only subject to the terms and conditions set forth in the Creative Commons Attribution License (<http://creativecommons.org/licenses/by/2.5/>).

Discussion Venue

The preferred venue for discussion of this document is the Standards discussion list: <http://mail.jabber.org/mailman/listinfo/standards>.

Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.

Conformance Terms

The following keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".

Table of Contents

1. Introduction
2. Requirements
3. Data Format
4. Recommended Transport
    4.1. Entity publishes location via PEP
5. Implementation Notes
6. Mapping to Other Formats
7. Internationalization Considerations
8. Security Considerations
9. IANA Considerations
10. XMPP Registrar Considerations
    10.1. Protocol Namespaces
11. XML Schema
Revision History

1. Introduction

This document defines a format for capturing data about an entity's geographical location (geoloc). The format defined herein can describe most earthbound geographical locations, especially locations that may change fairly frequently. Potential uses for this approach include:

Geographical location is captured in terms of Global Positioning System (GPS) coordinates as well as civil location (city, street, building, etc.).

2. Requirements

The format defined herein was designed to address the following requirements:

3. Data Format

Information about the entity's location is provided by the entity and propagated on the network by the entity's associated application (usually a client). The information is structured by means of a <geoloc/> element that is qualified by the 'http://jabber.org/protocol/geoloc' namespace; the location information itself is provided as the XML character data of the following child elements:

Table 1: Child Elements

Element Name Datatype Definition Example
alt xs:decimal Altitude in meters above or below sea level 1609
area xs:string A named area such as a campus or neighborhood Central Park
bearing xs:decimal GPS bearing (direction in which the entity is heading to reach its next waypoint), measured in decimal degrees relative to true north [1]  
building xs:string A specific building on a street or in an area The Empire State Building
country xs:string The nation where the user is located USA
datum xs:string GPS datum [2]  
description xs:string A natural-language name for or description of the location Bill's house
error xs:decimal Horizontal GPS error in arc minutes 10
floor xs:string A particular floor in a building 102
lat xs:decimal Latitude in decimal degrees North 39.75
locality xs:string A locality within the administrative region, such as a town or city New York City
lon xs:decimal Longitude in decimal degrees East -104.99
postalcode xs:string A code used for postal delivery 10027
region xs:string An administrative region of the nation, such as a state or province New York
room xs:string A particular room in a building Observatory
street xs:string A thoroughfare within the locality, or a crossing of two thoroughfares 34th and Broadway
text xs:string A catch-all element that captures any other information about the location Northwest corner of the lobby
timestamp xs:datetime UTC timestamp specifying the moment when the reading was taken (MUST conform to the DateTime profile of XMPP Date and Time Profiles [3]) 2004-02-19T21:12Z
uri A URI or URL pointing to information about the location http://beta.plazes.com/plazes/1940:jabber_inc xs:anyURI

NOTE: The datatypes specified above are defined in XML Schema Part 2 [4].

4. Recommended Transport

Location information about human users SHOULD be communicated and transported by means of Publish-Subscribe [5] or the subset thereof specified in Personal Eventing via Pubsub [6] (the examples below assume that the user's XMPP server supports PEP, thus the publish request lacks a 'to' address and the notification message has a 'from' address of the user's bare JID).

Although the XMPP publish-subscribe extension is the preferred means for transporting location information about human users, applications that do not involve human users (e.g., device tracking) MAY use other transport methods; however, because location information is not pure presence information and can change independently of network availability, it SHOULD NOT be provided as an extension to <presence/>.

4.1 Entity publishes location via PEP

Example 1. Entity publishes location

<iq type='set' from='portia@merchantofvenice.lit/pda' id='publish1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='http://jabber.org/protocol/geoloc'>
        <geoloc xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'>

Example 2. Subscriber receives event with payload

<message from='portia@merchantofvenice.lit' 
  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='http://jabber.org/protocol/geoloc'>
      <item id='d81a52b8-0f9c-11dc-9bc8-001143d5d5db'>
        <geoloc xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'>

5. Implementation Notes

Avoid "Mars probe" issues: as specified in Table 1, the units for <lat/> and <lon/> MUST be decimal degrees (where South and West are negative, North and East are positive), the units for <alt/> MUST be meters above or below sea level, and the units for <error/> MUST be arc minutes.

In applications where updates are sent whenever there is a certain distance change in location, those applications SHOULD account for time as well, to avoid rate-limiting when the user is (for example) on a jet plane. One possible way to do this would be to send updates at most once per minute of time (every time 60 seconds have elapsed).

Inferences SHOULD NOT be made about accuracy from the number of digits specified in the location or altitude.

Why the datum madness? See <http://www.jabber.org/protocol/geoloc/gps_datum.html> for an example.

An entity can provide a GPS path by publishing a series of items (i.e., multiple pubsub events) with appropriate values of the <timestamp/> element.

6. Mapping to Other Formats

There are many XML data formats for physical location or address information. It is beyond the scope of this document to provide a mapping from the extension defined herein to every such format. However, it would be valuable to provide a mapping from the XMPP format to the formats used in other presence or extended presence protocols. The two main protocols of interest are:

  1. The Wireless Village (now "IMPS") specifications for mobile instant messaging; these specifications define a presence attribute for address information as encapsulated in the IMPS "Address" element [7].

  2. The SIP-based SIMPLE specifications; in particular, the IETF's GEOPRIV Working Group has defined an extension to the IETF's Presence Information Data Format (PIDF) [8] for location information, as specified in RFC 4119 [9] (also known as "PIDF-LO").

The following table also maps the format defined herein to the vCard XML format specified in vcard-temp [10].

Table 2: Mapping XMPP Physical Location to IMPS, PIDF-LO, and vCard

XMPP Wireless Village / IMPS SIMPLE (PIDF-LO) vCard XML
<country/> <Country/> <country/> <CTRY/> [11]
<region/> -- <A1/> and/or <A2/> <REGION/>
<locality/> <City/> <A3/> <LOCALITY/>
<area/> <NamedArea/> <A4/> and/or <A5/> --
<street/> <Street/> [12] <A6/> [13] <STREET/>
<building/> <Building/> <LMK/> --
<floor/> -- <FLR/> --
<room/> -- -- --
<postalcode/> -- <PC/> <PCODE/>
<text/> <FreeTextLocation/> <LOC/> <EXTADR/>
-- <Accuracy/> [14] -- --
-- -- <NAM/> [15] --

7. Internationalization Considerations

Because the character data contained in <geoloc/> child elements of type 'xs:string' is intended to be readable by humans, the <geoloc/> element SHOULD possess an 'xml:lang' attribute specifying the natural language of such character data.

8. Security Considerations

It is imperative to control access to location information, at least by default. Imagine that a stalker got unauthorized access to this information, with enough accuracy and timeliness to be able to find the target person. This scenario could lead to loss of life, so please take access control checks seriously. If an error is deliberately added to a location, the error SHOULD be the same for all receivers, to minimize the likelihood of triangulation. In the case of deliberate error, the <error/> element SHOULD NOT be included.

9. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [16].

10. XMPP Registrar Considerations

10.1 Protocol Namespaces

The XMPP Registrar [17] includes 'http://jabber.org/protocol/geoloc' to its registry of protocol namespaces.

11. XML Schema

<?xml version='1.0' encoding='UTF-8'?>


      The protocol documented by this schema is defined in
      XEP-0080: http://www.xmpp.org/extensions/xep-0080.html

  <xs:element name='geoloc'>
      <xs:sequence minOccurs='0'>
        <xs:element name='alt' minOccurs='0' type='xs:decimal'/>
        <xs:element name='area' minOccurs='0' type='xs:string'/>
        <xs:element name='bearing' minOccurs='0' type='xs:decimal'/>
        <xs:element name='building' minOccurs='0' type='xs:string'/>
        <xs:element name='country' minOccurs='0' type='xs:string'/>
        <xs:element name='datum' minOccurs='0' type='xs:string'/>
        <xs:element name='description' minOccurs='0' type='xs:string'/>
        <xs:element name='error' minOccurs='0' type='xs:decimal'/>
        <xs:element name='floor' minOccurs='0' type='xs:string'/>
        <xs:element name='lat' minOccurs='0' type='xs:decimal'/>
        <xs:element name='locality' minOccurs='0' type='xs:string'/>
        <xs:element name='lon' minOccurs='0' type='xs:decimal'/>
        <xs:element name='postalcode' minOccurs='0' type='xs:string'/>
        <xs:element name='region' minOccurs='0' type='xs:string'/>
        <xs:element name='room' minOccurs='0' type='xs:string'/>
        <xs:element name='street' minOccurs='0' type='xs:string'/>
        <xs:element name='text' minOccurs='0' type='xs:string'/>
        <xs:element name='timestamp' minOccurs='0' type='xs:datetime'/>
        <xs:element name='uri' minOccurs='0' type='xs:anyURI'/>



1. It is the responsibility of the receiver to translate bearing into decimal degrees relative to magnetic north, if desired.

2. If datum is not included, receiver MUST assume WGS84; receivers MUST implement WGS84; senders MAY use another datum, but it is not recommended.

3. XEP-0082: XMPP Date and Time Profiles <http://www.xmpp.org/extensions/xep-0082.html>.

4. XML Schema Part 2: Datatypes <http://www.w3.org/TR/xmlschema-2/>.

5. XEP-0060: Publish-Subscribe <http://www.xmpp.org/extensions/xep-0060.html>.

6. XEP-0163: Personal Eventing via Pubsub <http://www.xmpp.org/extensions/xep-0163.html>.

7. The Wireless Village Initiative: Presence Attributes v1.1 (WV-029); for further information, visit <http://www.openmobilealliance.org/tech/affiliates/wv/wvindex.html>.

8. RFC 3863: Presence Information Data Format (PIDF) <http://tools.ietf.org/html/rfc3863>.

9. RFC 4119: A Presence-based GEOPRIV Location Object Format <http://tools.ietf.org/html/rfc4119>.

10. XEP-0054: vcard-temp <http://www.xmpp.org/extensions/xep-0054.html>.

11. As noted in XEP-0054, the XML vCard format defined in draft-dawson-vcard-xml-dtd-01 specified a <COUNTRY/> element rather than a <CTRY/> element; refer to XEP-0054 for details.

12. The IMPS specification also enables one to define an intersection (e.g., "Broadway and 34th Street") as the combination of a <Crossing1/> element (e.g., "Broadway") and a <Crossing2/> element (e.g., "34th Street"). To map from IMPS to XMPP, an application SHOULD map such a combination to one XMPP <street/> element.

13. The PIDF-LO format provides information elements for much more granular control over a traditional street address; in PIDF-LO the <A6/> element is the street name only, and further information is provided in distinct elements for a leading street direction (e.g., "N"), trailing street suffix (e.g., "SW"), street suffix (e.g., "Avenue"), house number (e.g., "909"), and house number suffix (e.g., "1/2"). To map from PIDF-LO to XMPP, an application SHOULD construct the complete street address from the PIDF-LO elements (<A6/>, <PRD/>, <POD/>, <STS/>, <HNO/>, and <HNS/>) and map the result to one XMPP <street/> element.

14. This element provides accuracy in meters. The location protocol defined in XEP-0080 specifies such an element for XMPP, which SHOULD be used when mapping from IMPS to XMPP.

15. This element provides a name for the location, e.g., a certain store in a building. This SHOULD be mapped to the XMPP <text/> element.

16. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.

17. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <http://www.xmpp.org/registrar/>.

Revision History

Version 1.4 (2007-07-16)

Renamed to User Location; corrected pubsub examples; recommended pubsub/PEP as transport for location information about human users; added uri element.


Version 1.3 (2006-08-21)

Folded in civil location from XEP-0112.


Version 1.2 (2005-05-12)

Changed xs:string to xs:decimal for bearing and specified that bearing is to be interpreted as decimal degrees relative to true north.


Version 1.1 (2004-10-29)

Changed xs:int to xs:decimal for altitude; changed MUST NOT to SHOULD NOT regarding inferences about accuracy.


Version 1.0 (2004-10-12)

Per a vote of the Jabber Council, advanced status to Draft; also added internationalization considerations and linked to an archived version of the GPS datum example.


Version 0.9 (2004-10-12)

Clarified several points in the implementation notes.


Version 0.8 (2004-09-15)

Specified error flow for IQ example.


Version 0.7 (2004-04-25)

Corrected several errors; added reference to XEP-0033.


Version 0.6 (2004-02-19)

Reverted from infobits to geoloc elements; moved physical address protocol back to XEP-0112.


Version 0.5 (2003-12-16)

Converted to use of infobits.


Version 0.4 (2003-09-08)

Merged in contents of XEP-0112.


Version 0.3 (2003-08-21)

Changed protocol name from 'location' to 'geoloc'.


Version 0.2 (2003-07-29)

Incorporated Standards list feedback; changed document type to Informational.


Version 0.1 (2003-04-15)

Initial version.